Opened 7 years ago

Last modified 7 years ago

#28636 new New feature

Translation module: Check `LANG_INFO` against user's language preference as optional feature — at Initial Version

Reported by: Denis Anuschewski Owned by: nobody
Component: Internationalization Version: dev
Severity: Normal Keywords: translation, internationalization, request
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no
Pull Requests:9248 unmerged, 9177 unmerged

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 locale 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 only against settings.LANGUAGES. This would give you a locale from all languages that are available in the translation module. You could use that e.g. for comparing with settings.LANGUAGE_CODE and add a fallback for specific cases.

According to the ticket's flags, the next step(s) to move this issue forward are:

  • To add tests to the patch, then uncheck the "Needs tests" flag on the ticket.
  • To write documentation for the patch, then uncheck "Needs documentation" on the ticket.
  • If creating a new pull request, include a link to the pull request in the ticket comment when making that update. The usual format is: [https://github.com/django/django/pull/#### PR].

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top