Mercurial > p > roundup > code
changeset 2810:ca541343c3ae
straighten "if not ... else" logic;
fix: main message catalog was also used as fallback
| author | Alexander Smishlajev <a1s@users.sourceforge.net> |
|---|---|
| date | Sat, 23 Oct 2004 14:20:57 +0000 |
| parents | 353dc16a49b2 |
| children | 1de24e6178cf |
| files | roundup/i18n.py |
| diffstat | 1 files changed, 7 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/roundup/i18n.py Sat Oct 23 14:13:24 2004 +0000 +++ b/roundup/i18n.py Sat Oct 23 14:20:57 2004 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: i18n.py,v 1.11 2004-10-23 14:03:34 a1s Exp $ +# $Id: i18n.py,v 1.12 2004-10-23 14:20:57 a1s Exp $ """ RoundUp Internationalization (I18N) @@ -164,10 +164,10 @@ mofiles = [] # locale directory paths system_locale = gettext_module._default_localedir - if tracker_home is not None: + if tracker_home is None: + tracker_locale = None + else: tracker_locale = os.path.join(tracker_home, "locale") - else: - tracker_locale = None # get the list of locales locales = find_locales(language) # add mofiles found in the tracker, then in the system locale directory @@ -185,7 +185,9 @@ mofiles = filter(None, mofiles) if mofiles: translator = translation_class(open(mofiles[0], "rb")) - for mofile in mofiles: + for mofile in mofiles[1:]: + # note: current implementation of gettext_module + # always adds fallback to the end of the fallback chain. translator.add_fallback(translation_class(open(mofile, "rb"))) else: translator = null_translation_class()
