#8626: Translations from "en_US" locale being used even though request.LANGUAGE_CODE is "en" ----------------------------------+----------------------------------------- Reporter: francisoreilly | Owner: nobody Status: new | Milestone: Component: Internationalization | Version: SVN Keywords: | Stage: Unreviewed Has_patch: 0 | ----------------------------------+----------------------------------------- I've got a situation where even though the template has request.LANGUAGE_CODE=="en", the "en_US" translations are being rendered instead of the "en" translations. Furthermore, if request.LANGUAGE_CODE =="en-gb", the "en_GB" translation '''is''' being pulled back, correctly. In summary:
* if LANGUAGE_CODE=="en" -> pulls back "en_US" translations (incorrect) * if LANGUAGE_CODE=="en-gb" -> pulls back "en_GB" translations (expected result) * if LANGUAGE_CODE=="en-us" -> pulls back "en_US" translations (expected result) To demonstrate the problem I put together and attached a tar.gz of a simple project directory: 1. A homepage that has a dropdown control for selecting/setting the user's chosen language, choices are "en", "en-gb" and "en-us". The form sets the request.LANGUAGE_CODE via the set-language view (django.conf.urls.i18n). urls.py is setup to activate the set-language view when user clicks Submit. The homepage itself lives at /index.html/ 2. Three locale translations corresponding, i.e. "en", "en_GB" and "en_US" in the locale subdir. I've localized the text "Homepage" with different text strings for each of the three locales. django.po 3. A settings.py which specifies the three LANGUAGES, a LANGUAGE_CODE of "en". It also pulls in the LocaleMiddleware as is necessary for locale translations. I think the other settings/files included are not relevant to the problem (e.g. the sqlite_db database file, etc), they're only included to form a runnable project. I've been able to show this behaviour in 1.0-beta_2-SVN-8643 - simply go to the homepage at /index.html/ and choose the different language values and submit. The page refreshes to show the current value of request.LANGUAGE_CODE and also which translation has been pulled back. -- Ticket URL: <http://code.djangoproject.com/ticket/8626> Django Code <http://code.djangoproject.com/> The web framework for perfectionists with deadlines --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---
