Other Strategies
Appart from the default Prefix Routing Stragegy there are a few others available:
Domain Strategy
This Strategy uses the domain of a request to determine the language.
Domains must be unique for each language.
Detection-only Strategy
This strategy exclusively uses the Accept-Language
header to detect the language on first visit. Any subsequent visits will use the language set in the NEXT_LOCALE
cookie. Routing is not affected in any way.
Manual Language switches only work if JS is enabled when using this strategy.
Custom Strategy
The beatuy of the RoutingStrategy
interface is that you can easily create your own routing strategy. All you need to do is implement the following functions:
To get some inspiration you might want to read the source-code of the built-in strategies.