[WebUI] Reword doctring and update gettext.js

This commit is contained in:
Calum Lind 2016-04-23 23:13:11 +01:00
parent 1a79d7c255
commit d32796eab0
3 changed files with 6 additions and 5 deletions

View File

@ -19,8 +19,8 @@ def _(text):
def escape(text):
"""
Used by the gettext.js template to escape translated strings
so they don't break the script.
Used by gettext.js template to escape any translated language strings that
might contain newlines or quotes as they would break the script.
"""
text = text.replace("'", "\\'")
text = text.replace('\r\n', '\\n')

View File

@ -11,7 +11,6 @@ GetText.add('Add Connection','${escape(_("Add Connection"))}')
GetText.add('Add In Paused State','${escape(_("Add In Paused State"))}')
GetText.add('Add Torrents','${escape(_("Add Torrents"))}')
GetText.add('Add Tracker','${escape(_("Add Tracker"))}')
GetText.add('Add from File','${escape(_("Add from File"))}')
GetText.add('Add from Url','${escape(_("Add from Url"))}')
GetText.add('Add torrents in Paused state','${escape(_("Add torrents in Paused state"))}')
GetText.add('Added','${escape(_("Added"))}')
@ -109,6 +108,7 @@ GetText.add('HTTP Auth','${escape(_("HTTP Auth"))}')
GetText.add('Handshake','${escape(_("Handshake"))}')
GetText.add('Hash:','${escape(_("Hash:"))}')
GetText.add('Help','${escape(_("Help"))}')
GetText.add('Help us improve Deluge by sending us your Python version, PyGTK version, OS and processor types. Absolutely no other information is sent.','${escape(_("Help us improve Deluge by sending us your Python version, PyGTK version, OS and processor types. Absolutely no other information is sent."))}')
GetText.add('Hide Client Identity','${escape(_("Hide Client Identity"))}')
GetText.add('High Priority','${escape(_("High Priority"))}')
GetText.add('Highest Priority','${escape(_("Highest Priority"))}')
@ -167,8 +167,10 @@ GetText.add('Normal Priority','${escape(_("Normal Priority"))}')
GetText.add('Not Connected','${escape(_("Not Connected"))}')
GetText.add('Not a valid torrent','${escape(_("Not a valid torrent"))}')
GetText.add('OK','${escape(_("OK"))}')
GetText.add('Off','${escape(_("Off"))}')
GetText.add('Offline','${escape(_("Offline"))}')
GetText.add('Old Password:','${escape(_("Old Password:"))}')
GetText.add('On','${escape(_("On"))}')
GetText.add('Online','${escape(_("Online"))}')
GetText.add('Options','${escape(_("Options"))}')
GetText.add('Other','${escape(_("Other"))}')
@ -223,7 +225,6 @@ GetText.add('Seed Time (m):','${escape(_("Seed Time (m):"))}')
GetText.add('Seeding','${escape(_("Seeding"))}')
GetText.add('Seeds','${escape(_("Seeds"))}')
GetText.add('Seeds:Peers','${escape(_("Seeds:Peers"))}')
GetText.add('Select a torrent','${escape(_("Select a torrent"))}')
GetText.add('Select an egg','${escape(_("Select an egg"))}')
GetText.add('Sequential Download','${escape(_("Sequential Download"))}')
GetText.add('Sequential download','${escape(_("Sequential download"))}')

View File

@ -50,4 +50,4 @@ def create_gettext_js(js_dir):
if __name__ == '__main__':
create_gettext_js(WEBUI_JS_DIR)
print('Created %s' % WEBUI_JS_DIR)
print('Created gettext.js for %s' % WEBUI_JS_DIR)