Module: check_mk
Branch: master
Commit: 5177eb0cd6192fe6d365f7b96f9ba75705de8096
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5177eb0cd6192f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Aug 2 14:57:17 2013 +0200
localize: Using .po from regular hierarchy if no file exists in local-hierarchy
---
modules/localize.py | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/modules/localize.py b/modules/localize.py
index f32130f..9ec0691 100644
--- a/modules/localize.py
+++ b/modules/localize.py
@@ -245,6 +245,14 @@ def localize_update(lang):
except:
pass
+ # Maybe initialize the file in the local hierarchy with the file in
+ # the default hierarchy
+ if local_locale_dir and not os.path.exists(po_file) \
+ and os.path.exists(locale_dir + '/%s/LC_MESSAGES/%s.po' % (lang,
domain)):
+ file(po_file, 'w').write(file(locale_dir +
'/%s/LC_MESSAGES/%s.po' % (lang, domain)).read())
+
+ sys.exit(1)
+
localize_sniff()
if not os.path.exists(po_file):
@@ -263,6 +271,12 @@ def localize_compile(lang):
init_files(lang)
+ # Maybe initialize the file in the local hierarchy with the file in
+ # the default hierarchy
+ if local_locale_dir and not os.path.exists(po_file) \
+ and os.path.exists(locale_dir + '/%s/LC_MESSAGES/%s.po' % (lang,
domain)):
+ file(po_file, 'w').write(file(locale_dir +
'/%s/LC_MESSAGES/%s.po' % (lang, domain)).read())
+
if not os.path.exists(po_file):
raise LocalizeException('The .po file %s does not exist.' % po_file)