From 8b1f6d7def315bb9365a993295f414f789381e82 Mon Sep 17 00:00:00 2001 From: Vassilii Khachaturov Date: Mon, 22 Jul 2013 12:04:22 +0000 Subject: [PATCH] 6932: Check for broken GTK install on linux only Fix as proposed by jralls. Also, move the 'gtk30' translation domain name to gramps consts. svn: r22717 --- gramps/gen/const.py | 1 + gramps/gui/grampsgui.py | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gramps/gen/const.py b/gramps/gen/const.py index 485be18b2..9c817d132 100644 --- a/gramps/gen/const.py +++ b/gramps/gen/const.py @@ -194,6 +194,7 @@ LICENSE_FILE = os.path.join(_resources.doc_dir, 'COPYING') from gramps.gen.utils.grampslocale import GrampsLocale GRAMPS_LOCALE = GrampsLocale(localedir=_resources.locale_dir) _ = GRAMPS_LOCALE.translation.sgettext +GTK_GETTEXT_DOMAIN = 'gtk30' #------------------------------------------------------------------------- # diff --git a/gramps/gui/grampsgui.py b/gramps/gui/grampsgui.py index a0ea5fe8d..a0b634ef7 100644 --- a/gramps/gui/grampsgui.py +++ b/gramps/gui/grampsgui.py @@ -39,8 +39,8 @@ LOG = logging.getLogger(".grampsgui") # #------------------------------------------------------------------------- from gramps.gen.config import config -from gramps.gen.const import DATA_DIR, IMAGE_DIR -from gramps.gen.constfunc import has_display, win +from gramps.gen.const import DATA_DIR, IMAGE_DIR, GTK_GETTEXT_DOMAIN +from gramps.gen.constfunc import has_display, win, lin from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.gettext @@ -258,8 +258,10 @@ class Gramps(object): register_stock_icons() - if glocale.lang != 'C' and not gettext.find('gtk30'): + if lin() and glocale.lang != 'C' and not gettext.find(GTK_GETTEXT_DOMAIN): LOG.warn("GTK translations missing, GUI will be broken, especially for RTL languages!") + # Note: the warning dialog below will likely have wrong stock icons! + # Translators: the current language will be the one you translate into. WarningDialog( _("Gramps detected an incomplete GTK installation"), _("""GTK translations for the current language (%s) are missing.