The behaviour is the same on Android. iOS makes it more straight-forward
because you HAVE TO have all translations in all languages you support.
LP,
Jure
On 15. 06. 23 16:15, Tobias Kunze wrote:
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
--
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/273f1b3f-f953-e204-a0e9-95a7b3cd51e7%40gmail.com.