#4030: internationalization - auto translation of LANGUAGES
-------------------------------------+--------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: nobody
Status: new | Component:
Internationalization
Version: SVN | Resolution:
Keywords: LANGUAGES settings.py | Stage: Accepted
Has_patch: 1 | Needs_docs: 1
Needs_tests: 0 | Needs_better_patch: 1
-------------------------------------+--------------------------------------
Changes (by mtredinnick):
* needs_better_patch: 0 => 1
* stage: Ready for checkin => Accepted
* needs_docs: 0 => 1
Comment:
Replying to [comment:6 akaihola]:
> * is a separate template tag a good idea?
Yes.
> * should we worry about performance if we assume this tag could be used
on every page of a site in the base template -- is activating each
language in a loop a heavy operation?
We should worry. See below; I don't like the current solution.
> * is the list of dicts return value a sensible choice, or should we
return a list of tuples like in {% get_available_languages %} and only
include the language name in the language itself?
I like the dictionary idea. Let's go with that.
Okay, now to the bigger problem ... I don't like the approach here. It's
relatively heavyweight to load up every MO file just to access one string
from each. What I would rather do is have an offline process (something
like make-messages.py and compile-messages.py) that extracts out the
strings and the Unicode string that is the translation and just writes it
into a file we can import. Write out a Python dictionary to file, for
example. Let's create a little tool for django/bin/
We can regenerate that file from time to time and check it into the
source.
Let's also have a Python function (in django.utils.translation, I guess)
that returns a Python dictionary of these languages -- mapping locale to
(English name, translated name), say -- so that we can use it for choice
lists in forms and models and other stuff like that.
Really sorry to ask for big changes like this after your work so far,
akaihola.
--
Ticket URL: <http://code.djangoproject.com/ticket/4030#comment:10>
Django Code <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---