|
@@ -28,8 +28,15 @@ ETCSYMBOLDIR = os.path.join(ETCDIR, "gui", "images", "symbols")
|
|
|
from core.debug import Debug
|
|
|
|
|
|
# cannot import from the core.utils module to avoid cross dependencies
|
|
|
-import gettext
|
|
|
-_ = gettext.translation('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale')).ugettext
|
|
|
+try:
|
|
|
+ # intended to be used also outside this module
|
|
|
+ import gettext
|
|
|
+ _ = gettext.translation('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale')).ugettext
|
|
|
+except IOError:
|
|
|
+ # using no translation silently
|
|
|
+ def null_gettext(string):
|
|
|
+ return string
|
|
|
+ _ = null_gettext
|
|
|
|
|
|
if os.path.join(ETCDIR, "python") not in sys.path:
|
|
|
sys.path.append(os.path.join(ETCDIR, "python"))
|