summaryrefslogtreecommitdiffstats
path: root/gen_web_gettext.py
diff options
context:
space:
mode:
authorbendikro <bro.devel+deluge@gmail.com>2015-12-26 17:25:16 +0100
committerCalum Lind <calumlind+deluge@gmail.com>2016-04-25 13:26:58 +0100
commit74f2f45fc0a04fbb2de0ced286e4b7f2b45895b6 (patch)
tree0776a764a764dc9cf955e61cc944379376e3521e /gen_web_gettext.py
parentb76d20821290b4b52a4be05d5c05c0eda3f65cf7 (diff)
downloaddeluge-74f2f45fc0a04fbb2de0ced286e4b7f2b45895b6.tar.gz
deluge-74f2f45fc0a04fbb2de0ced286e4b7f2b45895b6.tar.bz2
deluge-74f2f45fc0a04fbb2de0ced286e4b7f2b45895b6.zip
[WebUI] Fix to gen_web_gettext
Diffstat (limited to 'gen_web_gettext.py')
-rwxr-xr-xgen_web_gettext.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/gen_web_gettext.py b/gen_web_gettext.py
index d2c84ea52..19d961ebc 100755
--- a/gen_web_gettext.py
+++ b/gen_web_gettext.py
@@ -37,8 +37,8 @@ def create_gettext_js(js_dir):
gettext_tpl = '''GetText={maps:{},\
add:function(string,translation) {this.maps[string]=translation},\
get:function(string) {if (this.maps[string]) {string=this.maps[string]} return string}}
- function _(string) {return GetText.get(string)}\
- '''
+ function _(string) {return GetText.get(string)}
+'''
gettext_file = os.path.join(os.path.dirname(js_dir), 'gettext.js')
with open(gettext_file, 'w') as fp:
@@ -47,7 +47,8 @@ def create_gettext_js(js_dir):
if DEBUG:
fp.write('\n// %s\n' % ', '.join(['%s:%s' % x for x in strings[key]]))
fp.write('''GetText.add('%(key)s','${escape(_("%(key)s"))}')\n''' % locals())
+ return gettext_file
if __name__ == '__main__':
- create_gettext_js(WEBUI_JS_DIR)
- print('Created gettext.js for %s' % WEBUI_JS_DIR)
+ filename = create_gettext_js(WEBUI_JS_DIR)
+ print("Created '%s'" % filename)