##// END OF EJS Templates
i18n: get datapath directly from resourceutil...
Martin von Zweigbergk -
r44069:f0bee3b1 default
parent child Browse files
Show More
@@ -26,11 +26,7 b' sys.path.insert(0, "..")'
26 from mercurial import demandimport
26 from mercurial import demandimport
27
27
28 demandimport.enable()
28 demandimport.enable()
29 # Load util so that the locale path is set by i18n.setdatapath() before
30 # calling _().
31 from mercurial import util
32
29
33 util.datapath
34 from mercurial import (
30 from mercurial import (
35 commands,
31 commands,
36 encoding,
32 encoding,
@@ -13,6 +13,7 b' import os'
13 import sys
13 import sys
14
14
15 from .pycompat import getattr
15 from .pycompat import getattr
16 from .utils import resourceutil
16 from . import (
17 from . import (
17 encoding,
18 encoding,
18 pycompat,
19 pycompat,
@@ -45,14 +46,10 b' if ('
45 # ctypes not found or unknown langid
46 # ctypes not found or unknown langid
46 pass
47 pass
47
48
48 _ugettext = None
49
49
50
50 datapath = pycompat.fsdecode(resourceutil.datapath)
51 def setdatapath(datapath):
52 datapath = pycompat.fsdecode(datapath)
53 localedir = os.path.join(datapath, 'locale')
51 localedir = os.path.join(datapath, 'locale')
54 t = gettextmod.translation('hg', localedir, _languages, fallback=True)
52 t = gettextmod.translation('hg', localedir, _languages, fallback=True)
55 global _ugettext
56 try:
53 try:
57 _ugettext = t.ugettext
54 _ugettext = t.ugettext
58 except AttributeError:
55 except AttributeError:
@@ -1824,7 +1824,6 b' def pathto(root, n1, n2):'
1824
1824
1825
1825
1826 datapath = resourceutil.datapath
1826 datapath = resourceutil.datapath
1827 i18n.setdatapath(datapath)
1828
1827
1829
1828
1830 def checksignature(func):
1829 def checksignature(func):
General Comments 0
You need to be logged in to leave comments. Login now