update gettext and strings.

This commit is contained in:
Martijn Voncken 2008-10-31 17:04:30 +00:00
parent cb45b5c41f
commit 41c121b729
4 changed files with 76 additions and 47 deletions

View File

@ -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")

View File

@ -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]

View File

@ -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')

View File

@ -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;