On Mon, Jan 10, 2011 at 7:12 PM, Klaas van Schelven
<[email protected]> wrote:
>
> Input (discussion) on this is much appreciated. I'll gladly put in a
> new patch once a decision is reached. If this is a separate issue, I'm
> also fine on opening a separate ticket. (it could be argued that we
> can move forward on the original bug report as a separate issue more
> easily, since it's "obviously broken")
>
Ok, had some time to look at this. These are the notes resulting from that:
a) The doc fix attached to #14910 to describe the current situation
and that got committed isn't correct. At no point of the catalog building
process a '``locale`` directory in the directory containing your settings
file.' is involved at all. And it doesn't mention the LOCALE_PATHS part.
The translation built is constructed by:
1. Adding the Django translations.
2. Updating it with the translations found in the paths listed in
settings.LOCALE_PATHS with the latter ones having greater
precedence.
3. Updating it with the translations found in the apps listed in
settings.INSTALLED_APPS with the latter ones having greater
precedence.
4. Updating it with the translation found in the locale/ dir under
the project dir. (this was before 3 before r12447)
this could be described in that way or by saying that the precedence
of the literals found while building the final unified translation is
(from higher to lesser):
* The translation found in the project locale/ dir
* the translations found in the apps listed in settings.INSTALLED_APPS
with the latter ones having higher precedence.
* The translations found in the paths listed in settings.LOCALE_PATHS
with the latter ones having higher precedence.
* The translations shipped with Django.
See also item d below.
b) I'm not sure I understand what converting the merge to a no
destructive update has to do with all this, I think the behavior of a
dictionary update() on the catalog being built is basic for the
translations overriding functionality.
c) Regarding reversing the priority of the translations in apps listed
in INSTALLED_APPS. Comparing it with the order followed when loading
templates isn't IMHO totally correct because template lookup has a
short circuit logic while translation loading has incremental
updating semantics.
I'm not saying I'm against the change (and against the change of the
precedence of the translation is LOCALE_PATHS) the but I think we
need to discuss further to decide if they really correct and if they
are worth the potential change in translated literals in existing
projects they might introduce.
d) I think the documentation text can be changed to make it clear that
no translation searching with short circuit is done but rather a
build of a unique translation by merging in/overriding the different
parts in the order documented. Also, the note about the
LocaleMiddleware can be dropped. Will take care of this soon.
Regards,
--
Ramiro Morales
--
You received this message because you are subscribed to the Google Groups
"Django developers" 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-developers?hl=en.