JMSI18nRoutingBundle
JMSI18nRoutingBundle copied to clipboard
How to combine prefix_except_default strategy with different hosts?
I love the prefix_except_default strategy but I would like to combine it with multiple hosts. What I would like to accomplish:
- http://example.ch/ -> de_CH
- http://example.ch/en/ -> en
- http://example.de/ -> de_DE
Tried it with the following configuration:
jms_i18n_routing:
default_locale: de_CH
locales: [de_CH, de_DE, en]
hosts:
de_CH : example.ch
de_DE : example.de
en: example.ch
strategy: prefix_except_default
No luck, this will give me the following error:
Invalid configuration for path "jms_i18n_routing.hosts": Every locale must map to a different host. You cannot have multiple locales map to the same host.
Can this be done with the current version of the JMSI18nRoutingBundle bundle or could you push this feature into a future version? Thanks. Best regards, Philip
I've spent past week playing around different approaches and finally came up with the following: https://github.com/MichaelKubovic/JMSI18nRoutingBundle. Let me know whether it helps!