##// END OF EJS Templates
py3: handle ugettext + unicode in i18n
timeless -
r28674:03d1ecbb default
parent child Browse files
Show More
@@ -20,6 +20,10 b" if getattr(sys, 'frozen', None) is not N"
20 else:
20 else:
21 module = __file__
21 module = __file__
22
22
23 try:
24 unicode
25 except NameError:
26 unicode = str
23
27
24 _languages = None
28 _languages = None
25 if (os.name == 'nt'
29 if (os.name == 'nt'
@@ -45,7 +49,10 b' def setdatapath(datapath):'
45 localedir = os.path.join(datapath, 'locale')
49 localedir = os.path.join(datapath, 'locale')
46 t = gettextmod.translation('hg', localedir, _languages, fallback=True)
50 t = gettextmod.translation('hg', localedir, _languages, fallback=True)
47 global _ugettext
51 global _ugettext
52 try:
48 _ugettext = t.ugettext
53 _ugettext = t.ugettext
54 except AttributeError:
55 _ugettext = t.gettext
49
56
50 _msgcache = {}
57 _msgcache = {}
51
58
General Comments 0
You need to be logged in to leave comments. Login now