From 6e525893bd879e14e425cecc890ed6eb2059d1a9 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Thu, 14 Mar 2013 23:07:59 +0000 Subject: [PATCH] [r21645]Plugins: Limit addon translators Only get an addon translator if the plugin has a locale directory Prevents pointless warnings, esp. when the translations are in the main Gramps message file. svn: r21649 --- gramps/gen/plug/_pluginreg.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gramps/gen/plug/_pluginreg.py b/gramps/gen/plug/_pluginreg.py index db3f55f6a..08aa49883 100644 --- a/gramps/gen/plug/_pluginreg.py +++ b/gramps/gen/plug/_pluginreg.py @@ -1088,7 +1088,11 @@ class PluginRegister(object): fd = io.open(full_filename, 'r', encoding = 'utf-8') stream = fd.read() fd.close() - local_gettext = glocale.get_addon_translator(full_filename).gettext + if os.path.exists(os.path.join(os.path.dirname(full_filename), + 'locale')): + local_gettext = glocale.get_addon_translator(full_filename).gettext + else: + local_gettext = glocale.get_translation().gettext try: #execfile(full_filename, exec (compile(stream, full_filename, 'exec'),