diff --git a/plugins/WebUi/scripts/extract_template_strings.py b/plugins/WebUi/scripts/extract_template_strings.py index c653ac095..b1a894b31 100644 --- a/plugins/WebUi/scripts/extract_template_strings.py +++ b/plugins/WebUi/scripts/extract_template_strings.py @@ -1,13 +1,18 @@ from __future__ import with_statement import os import re -template_dir = '~/prj/WebUi/templates/deluge' -template_dir = os.path.expanduser(template_dir ) +template_dirs = ['~/prj/WebUi/templates/deluge', + '~/prj/WebUi/templates/advanced'] + +template_dirs = [os.path.expanduser(template_dir ) for template_dir in template_dirs] -files = [os.path.join(template_dir,fname) - for fname in os.listdir(template_dir) - if fname.endswith('.html')] +files = [] +for template_dir in template_dirs: + files += [os.path.join(template_dir,fname) + for fname in os.listdir(template_dir) + if fname.endswith('.html')] + all_strings = [] for filename in files: diff --git a/plugins/WebUi/scripts/template_strings.py b/plugins/WebUi/scripts/template_strings.py index 0c057c757..925db255d 100644 --- a/plugins/WebUi/scripts/template_strings.py +++ b/plugins/WebUi/scripts/template_strings.py @@ -1,5 +1,6 @@ _('# Of Files') _('About') +_('Add') _('Add Torrent') _('Add torrent') _('Apply') @@ -13,6 +14,7 @@ _('Delete .torrent file') _('Delete downloaded files.') _('Details') _('Disable') +_('Down') _('Down Speed') _('Download') _('Downloaded') @@ -27,19 +29,20 @@ _('Next Announce') _('Off') _('Password') _('Password is invalid,try again') +_('Pause') _('Pause all') _('Peers') _('Pieces') _('Progress') _('Queue Down') +_('Queue Position') _('Queue Up') -_('Queue pos:') _('Ratio') _('Reannounce') _('Refresh page every:') _('Remove') -_('Remove %s ') -_('Remove %s?') +_('Remove torrent') +_('Resume') _('Resume all') _('Seeders') _('Set') @@ -47,11 +50,13 @@ _('Set Timeout') _('Share Ratio') _('Size') _('Speed') +_('Start') _('Submit') _('Torrent list') _('Total Size') _('Tracker') _('Tracker Status') +_('Up') _('Up Speed') _('Upload') _('Upload torrent') diff --git a/plugins/WebUi/webserver_framework.py b/plugins/WebUi/webserver_framework.py index 595ae2047..ab1755458 100644 --- a/plugins/WebUi/webserver_framework.py +++ b/plugins/WebUi/webserver_framework.py @@ -221,7 +221,7 @@ def get_torrent_status(torrent_id): url = urlparse(status.tracker) if hasattr(url,'hostname'): - status.category = url.hostname + status.category = url.hostname or 'unknown' else: status.category = 'No-tracker' @@ -265,7 +265,7 @@ def get_torrent_status(torrent_id): return status def get_categories(torrent_list): - trackers = [torrent['category'] for torrent in torrent_list] + trackers = [(torrent['category'] or 'unknown') for torrent in torrent_list] categories = {} for tracker in trackers: categories[tracker] = categories.get(tracker,0) + 1