Skip to content

Commit 6de1f4c

Browse files
committed
i18n for OSX prepared.. Need to include the mo files in the package now
1 parent f84697c commit 6de1f4c

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

bin/meld

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ try:
114114
libintl.bindtextdomain(locale_domain, locale_dir)
115115
libintl.bind_textdomain_codeset(locale_domain, 'UTF-8')
116116
del libintl
117+
elif sys.platform == 'darwin':
118+
gettext.install(locale_domain, locale_dir, names=["ngettext"])
119+
gettext.textdomain(locale_domain)
120+
gettext.bindtextdomain(locale_domain, locale_dir)
117121
else:
118122
locale.bindtextdomain(locale_domain, locale_dir)
119123
locale.bind_textdomain_codeset(locale_domain, 'UTF-8')

osx/Meld

100644100755
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import sys
44
import os
55
import subprocess
6+
import locale
67

78
def getScriptPath():
89
return os.path.dirname(os.path.realpath(sys.argv[0]))
@@ -27,12 +28,20 @@ for arg in sys.argv[1:]:
2728
MELDPATH = os.path.join(getScriptPath(), "Meld-bin")
2829
APPPATH = fix_abspath(os.path.join(getScriptPath(), '..'))
2930

31+
LANG="C"
32+
try:
33+
LANG= ".".join(locale.getdefaultlocale()[0], "UTF-8")
34+
except:
35+
pass
36+
3037
environment = dict(os.environ, **{
3138
"DYLD_LIBRARY_PATH": ":".join([
3239
os.path.join(APPPATH, "Resources", "lib"),
3340
os.path.join(APPPATH, "Frameworks")
3441
]),
35-
"LANG": "C"
42+
"LANG": LANG,
43+
"LC_ALL": LANG,
44+
"LC_CTYPE": LANG
3645
})
3746

3847
status = subprocess.call([MELDPATH] + arglist, env=environment)

0 commit comments

Comments
 (0)