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 |
|
|
51 | localedir = os.path.join(datapath, 'locale') | |
54 |
|
|
52 | t = gettextmod.translation('hg', localedir, _languages, fallback=True) | |
55 | global _ugettext |
|
|||
56 |
|
|
53 | try: | |
57 |
|
|
54 | _ugettext = t.ugettext | |
58 |
|
|
55 | except AttributeError: |
General Comments 0
You need to be logged in to leave comments.
Login now