diff --git a/deluge/ui/gtkui/mainwindow.py b/deluge/ui/gtkui/mainwindow.py index aef39219b..1d3668979 100644 --- a/deluge/ui/gtkui/mainwindow.py +++ b/deluge/ui/gtkui/mainwindow.py @@ -313,7 +313,9 @@ class MainWindow(component.Component): status['payload_upload_rate'], precision=0, shortform=True ) self.window.set_title( - _('D: %s U: %s - Deluge' % (download_rate, upload_rate)) + _('D: {download_rate} U: {upload_rate} - Deluge').format( + download_rate=download_rate, upload_rate=upload_rate + ) ) if self.config['show_rate_in_title']: diff --git a/deluge/ui/gtkui/tab_data_funcs.py b/deluge/ui/gtkui/tab_data_funcs.py index 020651dcb..6fa0ba59c 100644 --- a/deluge/ui/gtkui/tab_data_funcs.py +++ b/deluge/ui/gtkui/tab_data_funcs.py @@ -22,12 +22,14 @@ def fratio(value): def fpcnt(value, state, message): - textstr = _(state) + state_i18n = _(state) if state not in ('Error', 'Seeding') and value < 100: - textstr = ('%s %.2f' % (textstr, value)).rstrip('0').rstrip('.') + '%' + percent = '{:.2f}'.format(value).rstrip('0').rstrip('.') + return _('{state} {percent}%').format(state=state_i18n, percent=percent) elif state == 'Error': - textstr = _('%s: %s') % (textstr, message) - return textstr + return _('{state}: {err_msg}').format(state=state_i18n, err_msg=message) + else: + return state_i18n def fspeed_max(value, max_value=-1): diff --git a/generate_pot.py b/generate_pot.py index 257327af7..f5cad5b62 100755 --- a/generate_pot.py +++ b/generate_pot.py @@ -18,7 +18,6 @@ import re from datetime import datetime from subprocess import call -from gen_web_gettext import create_gettext_js from version import get_version # Paths to exclude @@ -108,7 +107,4 @@ for filepath in to_translate: if filepath.endswith('.h'): os.remove(filepath) -# Update web js gettext -create_gettext_js(WEBUI_JS_DIR) - -print('Created %s and updated gettext.js' % POT_FILEPATH) +print('Created %s' % POT_FILEPATH)