You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Unless I'm overlooking something, the internationalized routing as introduced in Symfony 4.1 has no fallback locale. We use 5 different locales within our application: nl_NL, nl_BE, en_GB, en_US and de_DE. We use a custom event listener to set the _locale value in the request. So we only use "full" locales, and not "nl", "en" etc.
For the Translator component, nl_NL and nl_BE automatically fall back to translations/messages.nl.yml while en_GB and en_US fall back to translations/messages.en.yml. This allows us to avoid duplicate translations.
The JMSI18nRoutingBundle has a similar approach as route translations are put in translations/routes.en.yml and translations/routes.nl.yml. As such we don't have to create duplicate translations files for en_GB and en_US.
As we try to migrate JMSI18nRoutingBundle to Symfony internationalized routing, we would like to have a similar approach (i.e. avoid duplicate translations). Right now, we have to configure routes like this:
As you can see, that's a lot of duplication. It would be nice if the Routing component could look for fallback locales, similar like the Translation component and JMSI18nRoutingBundle. In the example below, nl_NL and nl_BE would also match the nl path.
Description
Unless I'm overlooking something, the internationalized routing as introduced in Symfony 4.1 has no fallback locale. We use 5 different locales within our application: nl_NL, nl_BE, en_GB, en_US and de_DE. We use a custom event listener to set the
_locale
value in the request. So we only use "full" locales, and not "nl", "en" etc.For the Translator component, nl_NL and nl_BE automatically fall back to
translations/messages.nl.yml
while en_GB and en_US fall back totranslations/messages.en.yml
. This allows us to avoid duplicate translations.The JMSI18nRoutingBundle has a similar approach as route translations are put in
translations/routes.en.yml
andtranslations/routes.nl.yml
. As such we don't have to create duplicate translations files for en_GB and en_US.As we try to migrate JMSI18nRoutingBundle to Symfony internationalized routing, we would like to have a similar approach (i.e. avoid duplicate translations). Right now, we have to configure routes like this:
As you can see, that's a lot of duplication. It would be nice if the Routing component could look for fallback locales, similar like the Translation component and JMSI18nRoutingBundle. In the example below, nl_NL and nl_BE would also match the nl path.
The text was updated successfully, but these errors were encountered: