Show More
@@ -1,13 +1,26 b'' | |||||
1 | """ |
|
1 | """ | |
2 | i18n.py - internationalization support for mercurial |
|
2 | i18n.py - internationalization support for mercurial | |
3 |
|
3 | |||
4 | Copyright 2005, 2006 Matt Mackall <mpm@selenic.com> |
|
4 | Copyright 2005, 2006 Matt Mackall <mpm@selenic.com> | |
5 |
|
5 | |||
6 | This software may be used and distributed according to the terms |
|
6 | This software may be used and distributed according to the terms | |
7 | of the GNU General Public License, incorporated herein by reference. |
|
7 | of the GNU General Public License, incorporated herein by reference. | |
8 | """ |
|
8 | """ | |
9 |
|
9 | |||
10 | import gettext |
|
10 | import gettext, sys, os | |
11 | t = gettext.translation('hg', fallback=1) |
|
11 | ||
|
12 | # modelled after templater.templatepath: | |||
|
13 | if hasattr(sys, 'frozen'): | |||
|
14 | module = sys.executable | |||
|
15 | else: | |||
|
16 | module = __file__ | |||
|
17 | ||||
|
18 | base = os.path.dirname(module) | |||
|
19 | for dir in ('.', '..'): | |||
|
20 | localedir = os.path.normpath(os.path.join(base, dir, 'locale')) | |||
|
21 | if os.path.isdir(localedir): | |||
|
22 | break | |||
|
23 | ||||
|
24 | t = gettext.translation('hg', localedir, fallback=True) | |||
12 | gettext = t.gettext |
|
25 | gettext = t.gettext | |
13 | _ = gettext |
|
26 | _ = gettext |
General Comments 0
You need to be logged in to leave comments.
Login now