New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add_translation_dirs documentation is incorrect in regards to priorities #1473
Comments
I have created a minimal reproducer that illustrates this problem. Somewhat quoting from the helloworld.py: config.add_translation_dirs('locale', 'locale_override')
# override wins
config.add_translation_dirs('locale_override', 'locale')
# override loses
config.add_translation_dirs('locale_override')
config.add_translation_dirs('locale')
# override wins |
This is effect of Line 299 in c59784b
|
The issues described here seem legitimate, however I'm personally have a big difficulty understanding how things are supposed to actually work with regards to 1) extra locale directories 2) more specific dialects 3) combinations of 1 and 2. Can anyone provide a few examples for me? From how |
So the docstring is just 100% wrong right? Or can I not read?
Can someone confirm that what I said currently happens is actually what currently happens, and that it is counter to the docstring? |
Yes, you are right in that the docstring is 100% wrong. That the docstring is 100% wrong comes from the fact that its author must have been convinced that "search path" in case of gettext and Translations class works the same as searching in "normal" search path (PATH env var for instance).
That it happens was already confirmed by @rbu's tests in #1473 (comment) |
From pyramid/config/i18n.py:
This description is not in sync with the behaviour of Pyramid and gettext. In the list of locale directories, if two translations provide the same translation, the last in the list overrides the earlier ones.
That means this documentation is wrong in two aspects:
This issue is about fixing the documentation, I will add another issue about changing the implementation to be more sane.
The text was updated successfully, but these errors were encountered: