#28755: django.utils.translation.check_for_language doesn't check in the app
folders
------------------------------------------------+------------------------
               Reporter:  Dorian Amouroux       |          Owner:  nobody
                   Type:  Bug                   |         Status:  new
              Component:  Internationalization  |        Version:  1.11
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  1
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  1
                  UI/UX:  0                     |
------------------------------------------------+------------------------
 When using the `set_language` view to set the language for the user, it
 doesn't work if the language file is not in `settings.LOCALE_PATHS` nor in
 `django/conf/locale/`.

 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.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/057.fcf1c09f54fbf51cc259c7e3aff5ddc0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to