#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: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Denis Anuschewski):
At first thanks a lot for the time and effort you put into my problem, it
is very much appreciated. I did not get what you meant by language of
original strings, sorry. You mean the de facto language of the strings
that are marked as translations I guess. It is German, just like the value
of `LANGUAG_CODE` (our project's working language).
So here is the table as requested:
|| **language of original strings** || **client language** ||
**LANGUAGE_CODE** || **LANGUAGES** || **resulting language** ||
**fallback**
|| de || pl || de || en, de, es || de || None
|| de || pl || de || en, de, es || pl || en
First row is current Django, second is my wanted behaviour.
> Returning to your example, why would you like to get a language code
which is not in your site `LANGUAGES`?
Because I want to detect a user with Polish language (or any other foreign
language) regardless of `LANGUAGES`. I dont't want to place ''pl'' in
`LANGUAGES` because I don't have and I don't want a Polish translation,
but I want to KNOW that I am dealing with a user with Polish language.
With current Django (1st row) I just don't have the chance because I get
the value of `LANGUAGE_CODE` as resulting language, so a Polish user gets
treated just like a German one.
> Why would the fallback language be different depending on the requested
language?
Because I don't want a fallback for German users. They shall only get
German texts no matter what because that's the de facto standard language
in the project. For any other case English shall be the desired fallback
so that we get the following order for strings marked as translated:
1) Try to get a translation for the client language (if it is in
`LANGUAGES`, so either for ''en'', ''de'' or ''es'')
2) If the client language differs from the one in `LANGUAGE_CODE`
(''de''=German), fall back to English
3) If there is no English fallback translation, just use the language of
original strings (German)
So to be clear: I dont want to alter the existing translation routine. I
just want to be able to get the right client language and afterwards add a
fallback language depending on the client languages' value.
--
Ticket URL: <https://code.djangoproject.com/ticket/28636#comment:11>
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/066.3c22d4ee979cc39b1a8898dd42b64786%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.