summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorNicolas Dufour <nicoduf@yahoo.fr>2012-07-12 18:04:41 +0000
committerJazzyNico <nicoduf@yahoo.fr>2012-07-12 18:04:41 +0000
commit98b79d5d99f334780027d4e3206e29a4e3f2370f (patch)
tree97dcc76bf39f157a12200830e7932b45284c079e /share
parentFix for 378413 : Show/Hide all layers (diff)
downloadinkscape-98b79d5d99f334780027d4e3206e29a4e3f2370f.tar.gz
inkscape-98b79d5d99f334780027d4e3206e29a4e3f2370f.zip
Translations. Fix for Bug #425202 (Script messages not translated).
(bzr r11546)
Diffstat (limited to 'share')
-rwxr-xr-xshare/extensions/inkex.py25
1 files changed, 18 insertions, 7 deletions
diff --git a/share/extensions/inkex.py b/share/extensions/inkex.py
index 52b048dc8..e55c78530 100755
--- a/share/extensions/inkex.py
+++ b/share/extensions/inkex.py
@@ -26,14 +26,25 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
-import sys, copy, optparse, random, re
+import copy
import gettext
+import optparse
+import os
+import random
+import re
+import sys
+
from math import *
-gettext.install('inkscape')
-# _ = gettext.gettext
-# gettext.bindtextdomain('inkscape', '/usr/share/locale')
-# gettext.textdomain('inkscape')
+if sys.platform.startswith('win'):
+ import locale
+ current_locale, encoding = locale.getdefaultlocale()
+ os.environ['LANG'] = current_locale
+ gettext= gettext.translation('inkscape', "C:\Program Files\Inkscape\locale", [current_locale])
+else:
+ gettext= gettext.translation('inkscape')
+
+_ = gettext.gettext
#a dictionary of all of the xmlns prefixes in a standard inkscape doc
NSS = {
@@ -97,9 +108,9 @@ def errormsg(msg):
inkex.errormsg(_("This extension requires two selected paths."))
"""
if isinstance(msg, unicode):
- sys.stderr.write((msg + "\n").encode("UTF-8"))
+ sys.stderr.write(_(msg).encode("UTF-8") + "\n")
else:
- sys.stderr.write((unicode(msg, "utf-8", errors='replace') + "\n").encode("UTF-8"))
+ sys.stderr.write((unicode(_(msg), "utf-8", errors='replace') + "\n").encode("UTF-8"))
def check_inkbool(option, opt, value):
if str(value).capitalize() == 'True':