#28636: Translation module: Check `LANG_INFO` against user's language preference as optional feature -------------------------------------+------------------------------------- Reporter: Denis Anuschewski | Owner: nobody Type: New feature | Status: new Component: | Version: 1.11 Internationalization | Severity: Normal | Resolution: Keywords: translation, | Triage Stage: internationalization, request | Unreviewed Has patch: 0 | Needs documentation: 1 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Description changed by Denis Anuschewski:
Old description: > **Problem**: In the current state, the user's discovered language > preference is only returned when found in `settings.LANGUAGES`. That's > more than sufficient for the normal translation routine, but there seems > to be no way (at least no DRY way) to find out a user's preference > REGARDLESS of `settings.LANGUAGES`. > > **Suggestion**: It would be nice to have an easy way for finding out a > languange preference from request, even if it's not listed in your > supported languages. You could think of an optional flag, so that the > preference from `get_language_from_request` is checked against > `LANG_INFO` in the translation module rather than against > `settings.LANGUAGES`. This would give you one of all available languages > in the translation module. You could use that e.g. for comparing with > `settings.LANGUAGE_CODE` and add a fallback for specific cases. New description: **Problem**: The user's discovered language preference is only returned when found in `settings.LANGUAGES`. That's more than sufficient for the normal translation routine, but there seems to be no way (at least no DRY way) to find out a user's preference REGARDLESS of `settings.LANGUAGES`. **Suggestion**: It would be nice to have an easy way for finding out a languange preference from request, even if it's not listed in your supported languages. You could think of an optional flag, so that the preference from `get_language_from_request` is checked against `LANG_INFO` in the translation module rather than against `settings.LANGUAGES`. This would give you one of all available languages in the translation module. You could use that e.g. for comparing with `settings.LANGUAGE_CODE` and add a fallback for specific cases. -- -- Ticket URL: <https://code.djangoproject.com/ticket/28636#comment:4> 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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.277a1654b5dc4c606073dca8a493048e%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.