Changeset 8a0b7d
- Timestamp:
- 03/22/2017 12:55:17 PM (8 years ago)
- Branches:
- 2.0.x, develop, master
- Children:
- d485eb
- Parents:
- a76fde
- git-author:
- Calum Lind <calumlind+deluge@gmail.com> (03/22/2017 12:45:46 PM)
- git-committer:
- Calum Lind <calumlind+deluge@gmail.com> (03/22/2017 12:55:17 PM)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
gen_web_gettext.py
ra76fde r8a0b7d 18 18 WEBUI_JS_DIR = 'deluge/ui/web/js/deluge-all' 19 19 # Enabling Debug adds file and line number as comments to the gettext file. 20 DEBUG = False20 DEBUG = True 21 21 22 22 … … 72 72 'get:function(string){if (this.maps[string]){string=this.maps[string]} return string}};' 73 73 'function _(string){return GetText.get(string)}') 74 GETTEXT_SUBST_TPL = ("GetText.add('{key}','${{escape(_(\"{key}\"))}}')\n") 74 75 75 76 … … 95 96 if DEBUG: 96 97 fp.write('\n//: %s' % '//: '.join(['%s:%s\n' % x for x in strings[key]])) 97 fp.write( '''GetText.add('%(key)s','${escape(_("%(key)s"))}')\n''' % locals())98 fp.write(GETTEXT_SUBST_TPL.format(key=key)) 98 99 return gettext_file 99 100 -
setup.py
ra76fde r8a0b7d 134 134 print('Import error: %s' % import_error) 135 135 sys.exit(1) 136 137 # Create the gettext.js file for translations. 138 from gen_web_gettext import create_gettext_js 139 deluge_all_path = os.path.join(js_basedir, self.JS_SRC_DIRS[0]) 140 print('Creating WebUI translation file: %s/gettext.js' % deluge_all_path) 141 create_gettext_js(deluge_all_path) 136 142 137 143
Note:
See TracChangeset
for help on using the changeset viewer.