Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

i18n: add locale path detection

Changeset b8ca22ed14cc

Parent e4a543f6009c

by Steve Borho

Changes to 2 files · Browse files at b8ca22ed14cc Showing diff from parent e4a543f6009c Diff from another changeset...

Change 1 of 1 Show Entire File thgutil/​i18n.py Stacked
 
8
9
10
 
11
12
13
 
14
 
8
9
10
11
12
 
 
13
14
@@ -8,7 +8,7 @@
   import gettext  from gettext import gettext as _ +import paths   -# TODO: get proper path from somewheres -gettext.bindtextdomain("thg", "c:/path/to/locale") +gettext.bindtextdomain("thg", paths.get_locale_path())  gettext.textdomain("thg")
Change 1 of 2 Show Entire File thgutil/​paths.py Stacked
 
7
8
9
10
 
11
12
 
13
14
15
 
39
40
41
 
 
 
 
42
43
44
 
7
8
9
 
10
11
 
12
13
14
15
 
39
40
41
42
43
44
45
46
47
48
@@ -7,9 +7,9 @@
 """    try: - from __paths__ import icon_path, bin_path, license_path + from __paths__ import icon_path, bin_path, license_path, locale_path  except ImportError: - icon_path, bin_path, license_path = None, None, None + icon_path, bin_path, license_path, locale_path = None, None, None, None    import os   @@ -39,6 +39,10 @@
  global license_path   return license_path or os.path.join(get_prog_root(), 'COPYING.txt')   +def get_locale_path(): + global locale_path + return locale_path or os.path.join(get_prog_root(), 'locale') +  if os.name == 'nt':   import _winreg   import win32net