Skip to content
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

Only one gettext domain is loadad, others get ignored #85

Open
GoogleCodeExporter opened this issue Apr 29, 2015 · 0 comments
Open

Only one gettext domain is loadad, others get ignored #85

GoogleCodeExporter opened this issue Apr 29, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1.

import i18n

# add multiple domain catalogs for gettext
i18n.default_config['domains'] = ['messages1', 'messages2']

What is the expected output? What do you see instead?
It only loads messages from the last domain in the 'domains' list instead of 
merging them.

What version of the product are you using? On what operating system?
Webapp2 2.5.2 on Google App Engine

Please provide any additional information below.
In the 'I18nStore.load_translations' method there is an if _trans is an 
instance of NullTranslations, but python gettext documentation 
(http://docs.python.org/2/library/gettext.html#the-nulltranslations-class) 
states that all translations objects inherit from NullTranslations, so this 
always returns True and sets 'trans_null' instead of merging all provided 
domains translations into 'trans'.

A possible fix is to replace:
    if isinstance(_trans, NullTranslations):
with this:
    if isinstance(_trans, i18n.NullTranslations) and \
            not isinstance(_trans, babel.support.Translations):

Original issue reported on code.google.com by mytix.m...@gmail.com on 3 Oct 2013 at 4:53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant