#26337: Translations - No fallback used if requesting english variant -------------------------------------+------------------------------------- Reporter: cristianocca | Owner: nobody Type: | Status: new Cleanup/optimization | Component: Documentation | Version: 1.9 Severity: Normal | Resolution: Keywords: i18n translations | Triage Stage: Accepted english | Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by cristianocca): Example (high level, no actual code) - using message ids that are actually codes rather than text, but can be done with any case where the actual msgstr is not always the same as msgid for your default language (another example, if you do not use unicode characters as msgids for some reason like not wanting unicode on python code strings, so you always need the msgstr value even for default language for translations that have unicode characters) - default language = 'en-gb' - translations: en-gb = { 'BUTTON_1':'Colour', 'BUTTON_2':'Monday'}, en-us = { 'BUTTON_1':'Color', 'BUTTON_2':''} (note how I'm lazy and I don't translate the BUTTON_2 msgid because 'Monday' is the same in every language variant so I'm ok by falling to default. - Client requests the 'en-gb' translation, woops it starts with 'en' so it won't load your default language as fallback and you never get the actual BUTTON_2 translation, when requested you end up with the ugly msgid. -- Ticket URL: <https://code.djangoproject.com/ticket/26337#comment:7> Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.5c28e31648a0fb04f53cf18af644ca1f%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.