Indeed `set_language`
(https://github.com/django/django/blob/stable/1.11.x/django/views/i18n.py#L50)
calls the function `check_for_language`. `check_for_language` will check
if the language in parameter exists in the `gettext` catalog. However,
`check_for_language` calls the function `all_locale_paths`
(https://github.com/django/django/blob/stable/1.11.x/django/utils/translation/trans_real.py#L411)
which doesn't contains the path of the apps.
I create a language that doesn't exist in the Django default language, I
can't switch to this language because it cannot be found, it only exists
in the `locale` directory inside my apps.
--
Ticket URL: <https://code.djangoproject.com/ticket/28755>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* has_patch: 1 => 0
* easy: 1 => 0
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/28755#comment:1>
* status: new => assigned
* owner: nobody => ChillarAnand
--
Ticket URL: <https://code.djangoproject.com/ticket/28755#comment:2>
* cc: ChillarAnand (added)
* has_patch: 0 => 1
Comment:
PR -> https://github.com/django/django/pull/9351
--
Ticket URL: <https://code.djangoproject.com/ticket/28755#comment:3>
* needs_tests: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/28755#comment:4>
* needs_tests: 1 => 0
Comment:
Thanks Claude Paroz. Added a test case.
--
Ticket URL: <https://code.djangoproject.com/ticket/28755#comment:5>
* needs_better_patch: 0 => 1
Comment:
The build seems to be failing on Windows. The build has expired now so I
can't see the logs to see whether this might be a random failure or not.
--
Ticket URL: <https://code.djangoproject.com/ticket/28755#comment:6>
* needs_better_patch: 1 => 0
Comment:
Build was failing because of windows path issue. Fixed it now.
--
Ticket URL: <https://code.djangoproject.com/ticket/28755#comment:7>
* needs_better_patch: 0 => 1
Comment:
Left a comment for improvement about putting the test in a better
location.
--
Ticket URL: <https://code.djangoproject.com/ticket/28755#comment:8>
* needs_better_patch: 1 => 0
Comment:
Added test case for `check_for_language`.
--
Ticket URL: <https://code.djangoproject.com/ticket/28755#comment:9>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/28755#comment:10>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"e8e0cfa9e550a3309a795ef133e59b90302813c8" e8e0cfa]:
{{{
#!CommitTicketReference repository=""
revision="e8e0cfa9e550a3309a795ef133e59b90302813c8"
Fixed #28755 -- Made check_for_language() include apps' locale
directories.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28755#comment:11>