diff --git a/.gitignore b/.gitignore index 2a7eb4d80..03b6fe47a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ dist _trial_temp deluge/i18n/*/ *.desktop +.build_data diff --git a/deluge/ui/web/gen_gettext.py b/deluge/ui/web/gen_gettext.py old mode 100644 new mode 100755 index 05025aec5..b2518d74b --- a/deluge/ui/web/gen_gettext.py +++ b/deluge/ui/web/gen_gettext.py @@ -2,15 +2,14 @@ """ Script to go through the javascript files and dynamically generate gettext.js """ - import os import re -import glob -import cStringIO as StringIO +output_file = "gettext.js" string_re = re.compile('_\\(\'(.*?)\'\\)') strings = {} + gettext_tpl = """## -*- coding: utf-8 -*- /* * Script: gettext.js @@ -59,10 +58,10 @@ for root, dnames, files in os.walk('js/deluge-all'): keys = strings.keys() keys.sort() -fp = StringIO.StringIO() +fp = open(output_file, 'w') fp.write(gettext_tpl) for key in keys: fp.write('// %s\n' % ', '.join(map(lambda x: '%s:%s' % x, strings[key]))) fp.write("GetText.add('%(key)s', '${escape(_(\"%(key)s\"))}')\n\n" % locals()) -fp.seek(0) -print fp.read() +fp.close() + diff --git a/deluge/ui/web/gettext.js b/deluge/ui/web/gettext.js index 15864dac6..5d75507d8 100644 --- a/deluge/ui/web/gettext.js +++ b/deluge/ui/web/gettext.js @@ -293,7 +293,7 @@ GetText.add('Encrypt entire stream', '${escape(_("Encrypt entire stream"))}') // EncryptionPage.js:41 GetText.add('Encryption', '${escape(_("Encryption"))}') -// ConnectionManager.js:308, ConnectionManager.js:364, AddConnectionWindow.js:103, AddWindow.js:208 +// ConnectionManager.js:308, ConnectionManager.js:364, AddConnectionWindow.js:103, AddWindow.js:209 GetText.add('Error', '${escape(_("Error"))}') // Menus.js:247 @@ -506,7 +506,7 @@ GetText.add('Normal Priority', '${escape(_("Normal Priority"))}') // Statusbar.js:39 GetText.add('Not Connected', '${escape(_("Not Connected"))}') -// AddWindow.js:209 +// AddWindow.js:210 GetText.add('Not a valid torrent', '${escape(_("Not a valid torrent"))}') // ConnectionManager.js:180, ConnectionManager.js:188 @@ -611,7 +611,7 @@ GetText.add('Rate limit IP overhead', '${escape(_("Rate limit IP overhead"))}') // TorrentGrid.js:162 GetText.add('Ratio', '${escape(_("Ratio"))}') -// EditTrackersWindow.js:122, ConnectionManager.js:107, Toolbar.js:64, AddWindow.js:111 +// EditTrackersWindow.js:122, ConnectionManager.js:107, Toolbar.js:64, AddWindow.js:112 GetText.add('Remove', '${escape(_("Remove"))}') // Menus.js:224, RemoveWindow.js:39, RemoveWindow.js:57 @@ -827,4 +827,3 @@ GetText.add('Your password was successfully changed!', '${escape(_("Your passwor // InterfacePage.js:200 GetText.add('Your passwords don\'t match!', '${escape(_("Your passwords don\'t match!"))}') -