简体   繁体   中英

Symfony 2 Locale Case Sensitive

I am using symfony 2.0 for a development, m using the locale names as for example, en_ZA, en_US, en_QA for different languages, Have set en_ZA as default locale using Config.yml,

My urls are called for example as below, for different languages,

http://mydomain.com/en_ZA/user/list

http://mydomain.com/en_QA/user/list

Now when i try to mistype the locale in url like

http://mydomain.com/en_AA/user/list

http://mydomain.com/en_BB/user/list

It uses fallback and returns the default language translations,

BUT it creates problematic when i call for the locales with below urls

http://mydomain.com/en_Za/user/list

http://mydomain.com/en_zA/user/list

http://mydomain.com/en_za/user/list

It just returns the template file with the translation variables. It doesn't returns the fallback nor the translations.

Thank you for any help.

If you are trying to cover different languages and translations, then I recommend you follow the way Symfony outlines it in their documentation.

Here's a great starter along with links to the documentation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM