Fix some strings for a better translation

This commit is contained in:
Yann Leboulanger 2017-09-19 12:45:02 +02:00
parent b93098a379
commit 152be4473b
13 changed files with 41 additions and 32 deletions

View File

@ -298,7 +298,8 @@ class StandardGroupChatCommands(CommandContainer):
@doc(_("Invite a user to a room for a reason")) @doc(_("Invite a user to a room for a reason"))
def invite(self, jid, reason): def invite(self, jid, reason):
self.connection.send_invite(self.room_jid, jid, reason) self.connection.send_invite(self.room_jid, jid, reason)
return _("Invited %s to %s") % (jid, self.room_jid) return _("Invited %(jid)s to %(room_jid)s") % {'jid': jid,
'room_jid': self.room_jid}
@command(raw=True, empty=True) @command(raw=True, empty=True)
@doc(_("Join a group chat given by a jid, optionally using given nickname")) @doc(_("Join a group chat given by a jid, optionally using given nickname"))

View File

@ -250,7 +250,7 @@ def check_and_possibly_move_config():
continue continue
if not os.path.exists(src): if not os.path.exists(src):
continue continue
print(_('moving %s to %s') % (src, dst)) print(_('moving %(src)s to %(dst)s') % {'src': src, 'dst': dst})
shutil.move(src, dst) shutil.move(src, dst)
app.logger.init_vars() app.logger.init_vars()
app.logger.attach_cache_database() app.logger.attach_cache_database()

View File

@ -194,7 +194,7 @@ class Config:
'key_up_lines': [opt_int, 25, _('How many lines to store for Ctrl+KeyUP.')], 'key_up_lines': [opt_int, 25, _('How many lines to store for Ctrl+KeyUP.')],
'version': [ opt_str, defs.version ], # which version created the config 'version': [ opt_str, defs.version ], # which version created the config
'search_engine': [opt_str, 'https://www.google.com/search?&q=%s&sourceid=gajim'], 'search_engine': [opt_str, 'https://www.google.com/search?&q=%s&sourceid=gajim'],
'dictionary_url': [opt_str, 'WIKTIONARY', _("Either custom url with %s in it where %s is the word/phrase or 'WIKTIONARY' which means use wiktionary.")], 'dictionary_url': [opt_str, 'WIKTIONARY', _("Either custom url with %%s in it where %%s is the word/phrase or 'WIKTIONARY' which means use wiktionary.")],
'always_english_wikipedia': [opt_bool, False], 'always_english_wikipedia': [opt_bool, False],
'always_english_wiktionary': [opt_bool, True], 'always_english_wiktionary': [opt_bool, True],
'remote_control': [opt_bool, False, _('If checked, Gajim can be controlled remotely using gajim-remote.'), True], 'remote_control': [opt_bool, False, _('If checked, Gajim can be controlled remotely using gajim-remote.'), True],

View File

@ -2078,8 +2078,9 @@ class Connection(CommonConnection, ConnectionHandlers):
return return
if type_ == 'message': if type_ == 'message':
if len(contacts) == 1: if len(contacts) == 1:
msg = _('Sent contact: "%s" (%s)') % (contacts[0].get_full_jid(), msg = _('Sent contact: "%(jid)s" (%(name)s)') % {
contacts[0].get_shown_name()) 'jid': contacts[0].get_full_jid(),
'name': contacts[0].get_shown_name()}
else: else:
msg = _('Sent contacts:') msg = _('Sent contacts:')
for contact in contacts: for contact in contacts:

View File

@ -121,8 +121,10 @@ class JingleRTPContent(JingleContent):
InformationEvent( InformationEvent(
None, conn=self.session.connection, level='error', None, conn=self.session.connection, level='error',
pri_txt=_('%s configuration error') % text.capitalize(), pri_txt=_('%s configuration error') % text.capitalize(),
sec_txt=_('Couldnt setup %s. Check your configuration.\n\n' sec_txt=_('Couldnt setup %(text)s. Check your '
'Pipeline was:\n%s\n\nError was:\n%s') % (text, pipeline, str(e)))) 'configuration.\n\nPipeline was:\n%(pipeline)s\n\n'
'Error was:\n%(error)s') % {'text': text,
'pipeline': pipeline, 'error': str(e)}))
raise JingleContentSetupException raise JingleContentSetupException
def add_remote_candidates(self, candidates): def add_remote_candidates(self, candidates):
@ -228,9 +230,9 @@ class JingleRTPContent(JingleContent):
InformationEvent( InformationEvent(
None, conn=self.session.connection, level='error', None, conn=self.session.connection, level='error',
pri_txt=_('GStreamer error'), pri_txt=_('GStreamer error'),
sec_txt=_('Error: %s\nDebug: %s' % sec_txt=_('Error: %(error)s\nDebug: %(debug)s' % {
(message.get_structure().get_value('gerror'), 'error': message.get_structure().get_value('gerror'),
message.get_structure().get_value('debug'))))) 'debug': message.get_structure().get_value('debug')})))
sink_pad = self.p2psession.get_property('sink-pad') sink_pad = self.p2psession.get_property('sink-pad')

View File

@ -78,7 +78,7 @@ class LibSecretPasswordStorage(PasswordStorage):
def save_password(self, account_name, password, update=True): def save_password(self, account_name, password, update=True):
server = app.config.get_per('accounts', account_name, 'hostname') server = app.config.get_per('accounts', account_name, 'hostname')
user = app.config.get_per('accounts', account_name, 'name') user = app.config.get_per('accounts', account_name, 'name')
display_name = _('XMPP account %s@%s') % (user, server) display_name = _('XMPP account %s') % user + '@' + server
attributes = {'user': user, 'server': server, 'protocol': 'xmpp'} attributes = {'user': user, 'server': server, 'protocol': 'xmpp'}
return self.Secret.password_store_sync(self.GAJIM_SCHEMA, attributes, return self.Secret.password_store_sync(self.GAJIM_SCHEMA, attributes,
self.Secret.COLLECTION_DEFAULT, display_name, password or '', None) self.Secret.COLLECTION_DEFAULT, display_name, password or '', None)

View File

@ -2693,9 +2693,10 @@ class AccountCreationWizardWindow:
'hostname': hostname, 'error': obj.ssl_msg}) 'hostname': hostname, 'error': obj.ssl_msg})
if obj.errnum in (18, 27): if obj.errnum in (18, 27):
text = _('Add this certificate to the list of trusted ' text = _('Add this certificate to the list of trusted '
'certificates.\nSHA-1 fingerprint of the certificate:\n%s' 'certificates.\nSHA-1 fingerprint of the certificate:\n'
'\nSHA-256 fingerprint of the certificate:\n%s') \ '%(sha1)s\nSHA-256 fingerprint of the certificate:\n'
% (obj.ssl_fingerprint_sha1, obj.ssl_fingerprint_sha256) '%(sha256)s') % {'sha1': obj.ssl_fingerprint_sha1,
'sha256': obj.ssl_fingerprint_sha256}
self.xml.get_object('ssl_checkbutton').set_label(text) self.xml.get_object('ssl_checkbutton').set_label(text)
else: else:
self.xml.get_object('ssl_checkbutton').set_no_show_all(True) self.xml.get_object('ssl_checkbutton').set_no_show_all(True)

View File

@ -61,7 +61,7 @@
</object> </object>
<packing> <packing>
<property name="name">main</property> <property name="name">main</property>
<property name="title" translatable="yes">page0</property> <property name="title">page0</property>
</packing> </packing>
</child> </child>
</object> </object>

View File

@ -894,7 +894,7 @@ class AddNewContactWindow:
'group_comboboxentry', 'auto_authorize_checkbutton'): 'group_comboboxentry', 'auto_authorize_checkbutton'):
self.__dict__[w] = self.xml.get_object(w) self.__dict__[w] = self.xml.get_object(w)
if account and len(app.connections) >= 2: if account and len(app.connections) >= 2:
self.default_desc = _('Please fill in the data of the contact you want\n' self.default_desc = _('Please fill in the data of the contact you want '
'to add to your account <b>%s</b>') % account 'to add to your account <b>%s</b>') % account
else: else:
self.default_desc = _('Please fill in the data of the contact you ' self.default_desc = _('Please fill in the data of the contact you '
@ -1276,7 +1276,8 @@ class AddNewContactWindow:
if obj.stanza.getError(): if obj.stanza.getError():
ErrorDialog(_('Error while adding transport contact'), ErrorDialog(_('Error while adding transport contact'),
_('This error occured while adding a contact for transport ' _('This error occured while adding a contact for transport '
'%s:\n\n%s') % (transport, obj.stanza.getErrorMsg())) '%(transport)s:\n\n%(error)s') % {'transport': transport,
'error': obj.stanza.getErrorMsg()})
return return
if obj.prompt_jid: if obj.prompt_jid:
self._add_jid(obj.prompt_jid, type_) self._add_jid(obj.prompt_jid, type_)
@ -2636,9 +2637,10 @@ class JoinGroupchatWindow:
if app.contacts.get_contact(self.account, room_jid) and \ if app.contacts.get_contact(self.account, room_jid) and \
not app.contacts.get_contact(self.account, room_jid).is_groupchat(): not app.contacts.get_contact(self.account, room_jid).is_groupchat():
ErrorDialog(_('This is not a group chat'), ErrorDialog(_('This is not a group chat'),
_('%s is already in your roster. Please check if %s is a ' _('%(room_jid)s is already in your roster. Please check if '
'correct group chat name. If it is, delete it from your roster ' '%(room_jid)s is a correct group chat name. If it is, delete '
'and try joining the group chat again.') % (room_jid, room_jid)) 'it from your roster and try joining the group chat again.') % \
{'room_jid': room_jid, 'room_jid': room_jid})
return return
full_jid = room_jid + '/' + nickname full_jid = room_jid + '/' + nickname

View File

@ -1360,9 +1360,9 @@ class Interface:
'server?') % {'error': obj.error_text} 'server?') % {'error': obj.error_text}
if obj.error_num in (18, 27): if obj.error_num in (18, 27):
checktext1 = _('Add this certificate to the list of trusted ' checktext1 = _('Add this certificate to the list of trusted '
'certificates.\nSHA-1 fingerprint of the certificate:\n%s' 'certificates.\nSHA-1 fingerprint of the certificate:\n%(sha1)s'
'\nSHA256 fingerprint of the certificate:\n%s') % \ '\nSHA256 fingerprint of the certificate:\n%(sha256)s') % \
(obj.fingerprint_sha1, obj.fingerprint_sha256) {'sha1': obj.fingerprint_sha1, 'sha256': obj.fingerprint_sha256}
else: else:
checktext1 = '' checktext1 = ''
checktext2 = _('Ignore this error for this certificate.') checktext2 = _('Ignore this error for this certificate.')
@ -1967,9 +1967,10 @@ class Interface:
if app.contacts.get_contact(account, room_jid) and \ if app.contacts.get_contact(account, room_jid) and \
not app.contacts.get_contact(account, room_jid).is_groupchat(): not app.contacts.get_contact(account, room_jid).is_groupchat():
dialogs.ErrorDialog(_('This is not a group chat'), dialogs.ErrorDialog(_('This is not a group chat'),
_('%s is already in your roster. Please check if %s is a ' _('%(room_jid)s is already in your roster. Please check '
'correct group chat name. If it is, delete it from your roster ' 'if %(room_jid)s is a correct group chat name. If it is, '
'and try joining the group chat again.') % (room_jid, room_jid)) 'delete it from your roster and try joining the group chat '
'again.') % {'room_jid': room_jid, 'room_jid': room_jid})
return return
if not nick: if not nick:

View File

@ -283,7 +283,8 @@ class DownloadHistoryPage(Gtk.Box):
self.received += 1 self.received += 1
if self.count: if self.count:
self.progress.set_fraction(self.received / self.count) self.progress.set_fraction(self.received / self.count)
self.progress.set_text(_('%s of %s' % (self.received, self.count))) self.progress.set_text(_('%(received)s of %(max)s' % {
'received': self.received, 'max': self.count}))
else: else:
self.progress.pulse() self.progress.pulse()
self.progress.set_text(_('Downloaded %s Messages' % self.received)) self.progress.set_text(_('Downloaded %s Messages' % self.received))

View File

@ -4642,8 +4642,8 @@ class RosterWindow:
# c_dest is None if jid_dest doesn't belong to account # c_dest is None if jid_dest doesn't belong to account
return return
menu = Gtk.Menu() menu = Gtk.Menu()
item = Gtk.MenuItem.new_with_label(_('Send %s to %s') % ( item = Gtk.MenuItem.new_with_label(_('Send %(from)s to %(to)s') % {
c_source.get_shown_name(), c_dest.get_shown_name())) 'from': c_source.get_shown_name(), 'to': c_dest.get_shown_name()})
item.set_use_underline(False) item.set_use_underline(False)
item.connect('activate', self.on_drop_rosterx, account_source, item.connect('activate', self.on_drop_rosterx, account_source,
c_source, account_dest, c_dest, is_big_brother, context, etime) c_source, account_dest, c_dest, is_big_brother, context, etime)
@ -4660,8 +4660,8 @@ class RosterWindow:
item.set_use_underline(False) item.set_use_underline(False)
else: else:
item = Gtk.MenuItem.new_with_label( item = Gtk.MenuItem.new_with_label(
_('Make %s and %s metacontacts') % ( _('Make %(contact1)s and %(contact2)s metacontacts') % {
c_source.get_shown_name(), c_dest.get_shown_name())) 'contact1': c_source.get_shown_name(), 'contact2': c_dest.get_shown_name()})
item.set_use_underline(False) item.set_use_underline(False)
item.connect('activate', self.on_drop_in_contact, account_source, item.connect('activate', self.on_drop_in_contact, account_source,

View File

@ -57,7 +57,7 @@ for mod in modules:
suite = unittest.defaultTestLoader.loadTestsFromName(mod) suite = unittest.defaultTestLoader.loadTestsFromName(mod)
result = unittest.TextTestRunner(verbosity=verbose).run(suite) result = unittest.TextTestRunner(verbosity=verbose).run(suite)
if use_x: if use_x:
# Wait 1s to be sure all timeout_add will be called before we cleanup main loop # Wait 500ms to be sure all timeout_add will be called before we cleanup main loop
import time import time
time.sleep(0.5) time.sleep(0.5)
# Clean main loop # Clean main loop