From f270f08be86af5adb3b998ff51421ffd4968dbae Mon Sep 17 00:00:00 2001 From: John Ralls Date: Tue, 12 Mar 2013 22:22:58 +0000 Subject: [PATCH] GrampsLocale: Better handle invalid/missing locale svn: r21636 --- gramps/gen/utils/grampslocale.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gramps/gen/utils/grampslocale.py b/gramps/gen/utils/grampslocale.py index 82a47b403..a8a519ee4 100644 --- a/gramps/gen/utils/grampslocale.py +++ b/gramps/gen/utils/grampslocale.py @@ -333,6 +333,14 @@ class GrampsLocale(object): translator._language = "en" return translator + if not languages or len(languages) == 0: + LOG.warning("No language provided, using US English") + else: + LOG.warning("No usable languages found in list, using US English") + translator = GrampsNullTranslations() + translator._language = "en" + return translator + def _set_dictionaries(self): """ Create a dictionary of language names localized to the