Show More
@@ -26,11 +26,7 b' sys.path.insert(0, "..")' | |||
|
26 | 26 | from mercurial import demandimport |
|
27 | 27 | |
|
28 | 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 | 30 | from mercurial import ( |
|
35 | 31 | commands, |
|
36 | 32 | encoding, |
@@ -13,6 +13,7 b' import os' | |||
|
13 | 13 | import sys |
|
14 | 14 | |
|
15 | 15 | from .pycompat import getattr |
|
16 | from .utils import resourceutil | |
|
16 | 17 | from . import ( |
|
17 | 18 | encoding, |
|
18 | 19 | pycompat, |
@@ -45,18 +46,14 b' if (' | |||
|
45 | 46 | # ctypes not found or unknown langid |
|
46 | 47 | pass |
|
47 | 48 | |
|
48 | _ugettext = None | |
|
49 | 49 | |
|
50 | ||
|
51 | def setdatapath(datapath): | |
|
52 | datapath = pycompat.fsdecode(datapath) | |
|
53 | localedir = os.path.join(datapath, 'locale') | |
|
54 | t = gettextmod.translation('hg', localedir, _languages, fallback=True) | |
|
55 | global _ugettext | |
|
56 | try: | |
|
57 | _ugettext = t.ugettext | |
|
58 | except AttributeError: | |
|
59 | _ugettext = t.gettext | |
|
50 | datapath = pycompat.fsdecode(resourceutil.datapath) | |
|
51 | localedir = os.path.join(datapath, 'locale') | |
|
52 | t = gettextmod.translation('hg', localedir, _languages, fallback=True) | |
|
53 | try: | |
|
54 | _ugettext = t.ugettext | |
|
55 | except AttributeError: | |
|
56 | _ugettext = t.gettext | |
|
60 | 57 | |
|
61 | 58 | |
|
62 | 59 | _msgcache = {} # encoding: {message: translation} |
General Comments 0
You need to be logged in to leave comments.
Login now