fix wrong resolved translation strings

This commit is contained in:
un-pogaz 2024-12-16 19:12:57 +01:00
parent e4c469a1e2
commit 4e08972a15
8 changed files with 12 additions and 16 deletions

View File

@ -43,8 +43,7 @@ def option_parser(get_parser, args): # {{{
# Entry point # Entry point
parser = get_parser( parser = get_parser(
_( _('''\
'''\
%prog catalog /path/to/destination.(csv|epub|mobi|xml...) [options] %prog catalog /path/to/destination.(csv|epub|mobi|xml...) [options]
Export a catalog in format specified by path/to/destination extension. Export a catalog in format specified by path/to/destination extension.
@ -52,8 +51,7 @@ Options control how entries are displayed in the generated catalog output.
Note that different catalog formats support different sets of options. To Note that different catalog formats support different sets of options. To
see the different options, specify the name of the output file and then the see the different options, specify the name of the output file and then the
{} option. {} option.
'''.format('--help') ''').format('--help')
)
) )
# Add options common to all catalog plugins # Add options common to all catalog plugins

View File

@ -160,7 +160,7 @@ def main(opts, args, dbctx):
if field == 'sort': if field == 'sort':
field = 'title_sort' field = 'title_sort'
if field not in fields: if field not in fields:
raise SystemExit(_('%s is not a known field' % field)) raise SystemExit(_('{} is not a known field'))
if field == 'cover': if field == 'cover':
val = dbctx.path(os.path.abspath(os.path.expanduser(val))) val = dbctx.path(os.path.abspath(os.path.expanduser(val)))
else: else:

View File

@ -240,7 +240,7 @@ class Adder(QObject):
else: else:
a = self.report.append a = self.report.append
for f in unreadable_files: for f in unreadable_files:
a(_('Could not add %s as you do not have permission to read the file' % f)) a(_('Could not add {} as you do not have permission to read the file').format(f))
a('') a('')
except Exception: except Exception:
self.scan_error = traceback.format_exc() self.scan_error = traceback.format_exc()

View File

@ -435,7 +435,7 @@ class BasicRecipe(QWidget): # {{{
compile_recipe(self.recipe_source) compile_recipe(self.recipe_source)
except Exception as err: except Exception as err:
error_dialog(self, _('Invalid recipe'), _( error_dialog(self, _('Invalid recipe'), _(
'Failed to compile the recipe, with syntax error: %s' % err), show=True) 'Failed to compile the recipe, with syntax error: {}').format(err), show=True)
return False return False
return True return True
@ -488,7 +488,7 @@ class AdvancedRecipe(QWidget): # {{{
compile_recipe(src) compile_recipe(src)
except Exception as err: except Exception as err:
error_dialog(self, _('Invalid recipe'), _( error_dialog(self, _('Invalid recipe'), _(
'Failed to compile the recipe, with syntax error: %s' % err), show=True) 'Failed to compile the recipe, with syntax error: {}' ).format(err), show=True)
return False return False
return True return True

View File

@ -272,7 +272,7 @@ class TextBrowser(PlainTextEdit): # {{{
break break
else: else:
info_dialog(self, _('No matches found'), _( info_dialog(self, _('No matches found'), _(
'No matches found for query: %s' % query), show=True) 'No matches found for query: {}').format(query), show=True)
def clear(self): def clear(self):
PlainTextEdit.clear(self) PlainTextEdit.clear(self)

View File

@ -204,7 +204,7 @@ class LossyCompression(QWidget):
image_type = image_type.upper() image_type = image_type.upper()
self.enable_lossy = el = QCheckBox(_('Enable &lossy compression of {} images').format(image_type)) self.enable_lossy = el = QCheckBox(_('Enable &lossy compression of {} images').format(image_type))
el.setToolTip(_('This allows you to change the quality factor used for {} images.\nBy lowering' el.setToolTip(_('This allows you to change the quality factor used for {} images.\nBy lowering'
' the quality you can greatly reduce file size, at the expense of the image looking blurred.'.format(image_type))) ' the quality you can greatly reduce file size, at the expense of the image looking blurred.').format(image_type))
l.addWidget(el) l.addWidget(el)
self.h2 = h = QHBoxLayout() self.h2 = h = QHBoxLayout()
l.addLayout(h) l.addLayout(h)

View File

@ -200,8 +200,8 @@ class EPUB_MOBI(CatalogPlugin):
available_presets = JSONConfig("catalog_presets") available_presets = JSONConfig("catalog_presets")
if opts.preset not in available_presets: if opts.preset not in available_presets:
if available_presets: if available_presets:
print(_('Error: Preset "%s" not found.' % opts.preset)) print(_('Error: Preset "{}" not found.').format(opts.preset))
print(_('Stored presets: %s' % ', '.join([p for p in sorted(available_presets.keys())]))) print(_('Stored presets: {}').format(', '.join([p for p in sorted(available_presets.keys())])))
else: else:
print(_('Error: No stored presets.')) print(_('Error: No stored presets.'))
return 1 return 1

View File

@ -2533,8 +2533,7 @@ on a device has its own device name. The ``storage_location_key`` names are
try: try:
if storage_location not in {'main', 'carda', 'cardb'}: if storage_location not in {'main', 'carda', 'cardb'}:
raise ValueError( raise ValueError(
_('connected_device_name: invalid storage location "{}"' _('connected_device_name: invalid storage location "{}"').format(storage_location))
.format(storage_location)))
info = info['info'][4] info = info['info'][4]
if storage_location not in info: if storage_location not in info:
return '' return ''
@ -2571,8 +2570,7 @@ only in the GUI.
try: try:
if storage_location not in {'main', 'carda', 'cardb'}: if storage_location not in {'main', 'carda', 'cardb'}:
raise ValueError( raise ValueError(
_('connected_device_name: invalid storage location "{}"' _('connected_device_name: invalid storage location "{}"').format(storage_location))
.format(storage_location)))
info = info['info'][4] info = info['info'][4]
if storage_location not in info: if storage_location not in info:
return '' return ''