diff --git a/deluge/ui/webui/scripts/extract_ajax_strings.py b/deluge/ui/webui/scripts/extract_ajax_strings.py new file mode 100644 index 000000000..2219d4291 --- /dev/null +++ b/deluge/ui/webui/scripts/extract_ajax_strings.py @@ -0,0 +1,31 @@ +import os +import re +template_dirs = ['../templates/ajax/static/js'] + +template_dirs = [os.path.expanduser(template_dir ) for template_dir in template_dirs] + + +files = [] +for template_dir in template_dirs: + files += [os.path.join(template_dir,fname) + for fname in os.listdir(template_dir) + if fname.endswith('.js')] + + +all_strings = [] +for filename in files: + f = open(filename,'r') + content = f.read() + all_strings += re.findall("_\(\"(.*?)\"\)",content) + all_strings += re.findall("_\(\'(.*?)\'\)",content) + all_strings += re.findall("Deluge\.Strings\.get\(\'(.*?)\'\)",content) + all_strings += re.findall("Deluge\.Strings\.get\(\'(.*?)\'\)",content) + + +all_strings = sorted(set(all_strings)) + +f = open ('./ajax_strings.js','w') +f.write("/*generated code:*/\n") +for value in all_strings: + f.write('GetText.add("%s","$_("%s")");\n' % (value, value) ) +f.write("/*end generated code.*/\n") diff --git a/deluge/ui/webui/scripts/extract_template_strings.py b/deluge/ui/webui/scripts/extract_template_strings.py index afaa40426..a4a0309df 100644 --- a/deluge/ui/webui/scripts/extract_template_strings.py +++ b/deluge/ui/webui/scripts/extract_template_strings.py @@ -1,6 +1,6 @@ import os import re -template_dirs = ['~/prj/webui06/templates/classic','~/prj/webui06/templates/white'] +template_dirs = ['../templates/classic','../templates/white'] template_dirs = [os.path.expanduser(template_dir ) for template_dir in template_dirs] diff --git a/deluge/ui/webui/scripts/template_strings.py b/deluge/ui/webui/scripts/template_strings.py index 106de76b1..64d80a7bf 100644 --- a/deluge/ui/webui/scripts/template_strings.py +++ b/deluge/ui/webui/scripts/template_strings.py @@ -1,6 +1,4 @@ _('# Of Files') -_('+') -_('++') _('About') _('Active time') _('Add Torrent') @@ -24,6 +22,8 @@ _('Delete downloaded files.') _('Deluge : Torrent List') _('Deluge Login') _('Disable') +_('Disk Space') +_('Do not download') _('Down Speed') _('Download') _('Downloaded') @@ -35,6 +35,8 @@ _('False') _('File') _('Filter on a keyword') _('General') +_('High priority') +_('Highest priority') _('Keyword') _('Label') _('Label torrent') @@ -42,9 +44,12 @@ _('Login') _('Logout') _('Move') _('Move torrent') -_('N') _('Name') _('Next Announce') +_('No Incoming Connections') +_('No Label') +_('None') +_('Normal priority') _('Not Connected to a daemon') _('Off') _('Options') @@ -65,12 +70,13 @@ _('Remove torrent') _('Restart') _('Resume all') _('Save') +_('Search') _('Seed rank') _('Seeders') _('Seeding time') +_('Select All') _('Set') _('Set Timeout') -_('Settings') _('Share Ratio') _('Size') _('Speed') @@ -86,5 +92,4 @@ _('Up Speed') _('Update') _('Upload') _('Uploaded') -_('X') _('seconds') diff --git a/deluge/ui/webui/templates/classic/gettext.js b/deluge/ui/webui/templates/classic/gettext.js index 604b71746..7c6922cf1 100644 --- a/deluge/ui/webui/templates/classic/gettext.js +++ b/deluge/ui/webui/templates/classic/gettext.js @@ -22,47 +22,40 @@ GetText = { } // Torrent Menu Strings // -GetText.add('Pause', '$_('Pause')'); -GetText.add('Resume', '$_('Resume')'); -GetText.add('Options', '$_('Options')'); -GetText.add('D/L Speed Limit', '$_('D/L Speed Limit')'); -GetText.add('U/L Speed Limit', '$_('U/L Speed Limit')'); -GetText.add('Unlimited', '$_('Unlimited')'); -GetText.add('Connection Limit', '$_('Connection Limit')'); -GetText.add('Upload Slot Limit', '$_('Upload Slot Limit')'); -GetText.add('Auto Managed', '$_('Auto Managed')'); -GetText.add('Queue', '$_('Queue')'); -GetText.add('Top', '$_('Top')'); -GetText.add('Up', '$_('Up')'); -GetText.add('Down', '$_('Down')'); -GetText.add('Bottom', '$_('Bottom')'); -GetText.add('Update Tracker', '$_('Update Tracker')'); -GetText.add('Edit Trackers', '$_('Edit Trackers')'); -GetText.add('Remove Torrent', '$_('Remove Torrent')'); -GetText.add('From Session', '$_('From Session')'); -GetText.add('... and delete Torrent file', - '$_('... and delete Torrent file')'); -GetText.add('... and delete Downloaded files', - '$_('... and delete Downloaded files')'); -GetText.add('... and delete All files', - '$_('... and delete All files')'); -GetText.add('Force Recheck', '$_('Force Recheck')'); -GetText.add('Move Storage', '$_('Move Storage')'); -// Add Torrents Window // -GetText.add('Add Torrents', '$_('Add Torrents')'); -GetText.add('Create Torrent', '$_('Create Torrent')'); -GetText.add('Torrents Window', '$_('Torrents Window')'); -GetText.add('From Url', '$_('From Url')'); -GetText.add('Ok', '$_('Ok')'); -GetText.add('Cancel', '$_('Cancel')'); - - -// Details // -GetText.add('Statistics', '$_('Statistics')'); -GetText.add('Details', '$_('Details')'); -GetText.add('Files', '$_('Files')'); -GetText.add('Peers', '$_('Peers')'); -GetText.add('Options', '$_('Options')'); +/*generated code:*/ +GetText.add("... and delete All files","$_("... and delete All files")"); +GetText.add("... and delete Downloaded files","$_("... and delete Downloaded files")"); +GetText.add("... and delete Torrent file","$_("... and delete Torrent file")"); +GetText.add("Add Torrents","$_("Add Torrents")"); +GetText.add("Auto Managed","$_("Auto Managed")"); +GetText.add("Bottom","$_("Bottom")"); +GetText.add("Cancel","$_("Cancel")"); +GetText.add("Connection Limit","$_("Connection Limit")"); +GetText.add("Create Torrent","$_("Create Torrent")"); +GetText.add("D/L Speed Limit","$_("D/L Speed Limit")"); +GetText.add("Details","$_("Details")"); +GetText.add("Down","$_("Down")"); +GetText.add("Edit Trackers","$_("Edit Trackers")"); +GetText.add("Files","$_("Files")"); +GetText.add("Force Recheck","$_("Force Recheck")"); +GetText.add("From Session","$_("From Session")"); +GetText.add("From Url","$_("From Url")"); +GetText.add("Move Storage","$_("Move Storage")"); +GetText.add("Ok","$_("Ok")"); +GetText.add("Options","$_("Options")"); +GetText.add("Pause","$_("Pause")"); +GetText.add("Peers","$_("Peers")"); +GetText.add("Queue","$_("Queue")"); +GetText.add("Remove Torrent","$_("Remove Torrent")"); +GetText.add("Resume","$_("Resume")"); +GetText.add("Statistics","$_("Statistics")"); +GetText.add("Top","$_("Top")"); +GetText.add("U/L Speed Limit","$_("U/L Speed Limit")"); +GetText.add("Unlimited","$_("Unlimited")"); +GetText.add("Up","$_("Up")"); +GetText.add("Update Tracker","$_("Update Tracker")"); +GetText.add("Upload Slot Limit","$_("Upload Slot Limit")"); +/*end generated code.*/ _ = GetText.get;