carlxaeron / django-rosetta

Automatically exported from code.google.com/p/django-rosetta
MIT License
0 stars 0 forks source link

Translate language names from settings.LANGUAGES #13

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The best-practice for translatable language name in settings.py is to use a
dummy gettext function around them and translating them when needed. This
is because settings.py can not import the translation module (import cycle).

Example:
_ = lambda s: s
LANGUAGES = (
    ('en', _(u'English')),
    ('nl', _(u'Nederlands')),
)

This means that language names need to be translated before being passed to
a template. Extraneous translation probably does no harm for people who do
not use translatable name, so I would suggest applying the attached patch
(or something similar).

Original issue reported on code.google.com by cas...@gmail.com on 7 Jun 2008 at 1:00

Attachments:

GoogleCodeExporter commented 8 years ago
Good point. Patch applied as of rev [26]

Original comment by mbonetti on 7 Jun 2008 at 6:16