From 894fab9c682508a6fd2854c7e0ccd181bb9954cd Mon Sep 17 00:00:00 2001 From: nojhan Date: Sun, 5 May 2013 00:30:43 +0200 Subject: [PATCH] bugfix #27: use default msg marker if no localization found --- colout/colout_g++.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/colout/colout_g++.py b/colout/colout_g++.py index b37e504..d10e320 100644 --- a/colout/colout_g++.py +++ b/colout/colout_g++.py @@ -1,5 +1,8 @@ #encoding: utf-8 +def default_gettext( msg ): + return msg + def theme(): import os import gettext @@ -9,8 +12,12 @@ def theme(): gv = os.popen("g++ -dumpversion").read().strip() # get the current translations of gcc - t = gettext.translation("gcc-"+gv) - _ = t.gettext + try: + t = gettext.translation("gcc-"+gv) + except IOError: + _ = default_gettext + else: + _ = t.gettext # _("msg") will return the given message, translated # if the locale is unicode