On 23-06-15 04:29:59, Gergely Kalmár wrote:
>It seems that gettext is currently quite permissive – it falls back to the 
>default language whenever a translation file is missing or if the requested 
>message ID is missing from the translation file. This can lead to errors 
>slipping through easily.
>
>I think it would be great if there was a way to make gettext raise an error 
>when the translation file is missing or when the msgid is missing.

Agreed that this is annoying behaviour, but as far as I can tell, there's not
much that Django can do. IIRC we only wrap Python's gettext module¹.

The relevant method, GNUTranslations.gettext, returns the original message if
no translation has been found, and it does so without indicating that this is
a fallback response².

AIUI this behaviour is rooted in GNU's gettext, which (just like the Python
version) allows you to set a priority list of languages to fall back to³.

Tobias

¹ https://docs.python.org/3/library/gettext.html
² https://docs.python.org/3/library/gettext.html#gettext.GNUTranslations
³ https://www.gnu.org/software/gettext/manual/gettext.html#The-LANGUAGE-variable

-- 
Tobias Kunze / rixx (er/he)
rixx.de software development
Mühlenbecker Weg 1, 16515 Oranienburg
https://rixx.de | https://pretalx.com
Tel.: +49 176 64636590

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/hwrmdsns7qerh2q5w34uthcb7pplbj2koc4aqogbabpcnmh2qd%40abkbnhls66bu.

Reply via email to