Description / Beschreibung
Some unexpected behaviour of a failing test in the local development setup lead to finding a bug in the Translationmixin.trans method, it fails to use the exact regional languages.
Expected behaviour / Erwartetes Verhalten
When 'en' is defined in the 'settings.LANGUAGES' and 'en-us' is set as the current locale language then the 'en' field on the Model instance should be used for the translation.
Steps to reproduce / Schritte zum Reproduzieren
I though it would be easy to add a simple test for this but I think that the TranslationMixin is broken somehow and we need to add a fix for that as well.
(Pdb) django.utils.translation.get_language()
'en-us'
(Pdb) rdmo.core.utils.get_languages()
[('en', 'English', 'lang1'), ('de', 'German', 'lang2')]
and we try to compare 'en' == 'en-us'....
|
if lang_code == current_language: |
(Pdb) section.short_title_lang1
'SectionShorty'
(Pdb) section.short_title
''
🤯 ❓
Originally posted by @MyPyDavid in #1586 (comment)
Context / Kontext
2.4.4
References / Verweise
|
if lang_code == current_language: |
Description / Beschreibung
Some unexpected behaviour of a failing test in the local development setup lead to finding a bug in the
Translationmixin.transmethod, it fails to use the exact regional languages.Expected behaviour / Erwartetes Verhalten
When 'en' is defined in the 'settings.LANGUAGES' and 'en-us' is set as the current locale language then the 'en' field on the Model instance should be used for the translation.
Steps to reproduce / Schritte zum Reproduzieren
Originally posted by @MyPyDavid in #1586 (comment)
Context / Kontext
2.4.4
References / Verweise
rdmo/rdmo/core/models.py
Line 38 in e77e2ca