jingo icon indicating copy to clipboard operation
jingo copied to clipboard

*: install_null_translations -> install_gettext_translations

Open kwist-sgr opened this issue 12 years ago • 3 comments

Use install_gettext_translations instead of install_null_translations

kwist-sgr avatar Oct 09 '13 07:10 kwist-sgr

Why do we need to make this change?

jsocol avatar Oct 28 '13 21:10 jsocol

Though the localization option is enabled by this string

'extensions': ['jinja2.ext.i18n']  # get_env function,

it is not actually run because of the string

e.install_null_translations()

Because of this we have to overrun this limitation by extra code.

from django.utils import translation
from jingo import env

...
# Install gettext translations (jingo)
if ('jinja2.ext.i18n' in env.extensions or
    'jinja2.ext.InternationalizationExtension' in env.extensions):
    env.install_gettext_translations(translation)

kwist-sgr avatar Oct 31 '13 14:10 kwist-sgr

OK, thanks for clarifying!

jsocol avatar Oct 31 '13 14:10 jsocol