-
-
Notifications
You must be signed in to change notification settings - Fork 56
[Django 4.1+] Make i18n works for LANGUAGE_CODE with a country code #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Django 4.1+] Make i18n works for LANGUAGE_CODE with a country code #206
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rsebille,
Thank you for your contribution. It's much appreciated. Your patch looks pretty perfect. I'd just with to have a separate test, with a little docstring to avoid future regression. We try to keep the test suite more atomic going forward, and I'd appreciate if you could contribute to that trend as well :)
Best! Joe
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #206 +/- ##
==========================================
- Coverage 99.27% 97.03% -2.24%
==========================================
Files 7 7
Lines 276 270 -6
==========================================
- Hits 274 262 -12
- Misses 2 8 +6
☔ View full report in Codecov by Sentry. |
5be9482
to
389de3c
Compare
Hi, While moving the new test cases into their own functions I saw I looked to the last failed CI jobs but didn't succeed to reproduce in local nor found an obvious link between those and the proposed changes so hopefully it was some temporary hiccups on github side ;). |
Hello 👋,
When using a
LANGUAGE_CODE
with a country code and a supported language (ie:fr-FR
) the current implementation ofSelect2Mixin.i18n_name
will returnNone
which means default select2 language, so English.Not sure if testing against
django.VERSION
is the way to go but since the property already rely on Django code and that no one reported the current behavior, it seems a good enough way to target the versions with the fix than copying it.