Merge pull request #3744 from JohniFi/fix-format-string-for-i18n

fix format strings for i18n
This commit is contained in:
Griatch 2025-03-21 22:25:17 +01:00 committed by GitHub
commit 595cd56ec2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -475,7 +475,7 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
return
if not obj.access(self, "puppet"):
# no access
self.msg(_("You don't have permission to puppet '{key}'.".format(key=obj.key)))
self.msg(_("You don't have permission to puppet '{key}'.").format(key=obj.key))
return
if obj.account:
# object already puppeted
@ -484,27 +484,21 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
# we may take over another of our sessions
# output messages to the affected sessions
if _MULTISESSION_MODE in (1, 3):
txt1 = _(
"Sharing |c{name}|n with another of your sessions.".format(
name=obj.name
)
)
txt2 = "|c{name}|n|G is now shared from another of your sessions.|n".format(
txt1 = _("Sharing |c{name}|n with another of your sessions.").format(
name=obj.name
)
txt2 = _(
"|c{name}|n|G is now shared from another of your sessions.|n"
).format(name=obj.name)
self.msg(txt1, session=session)
self.msg(txt2, session=obj.sessions.all())
else:
txt1 = _(
"Taking over |c{name}|n from another of your sessions.".format(
name=obj.name
)
txt1 = _("Taking over |c{name}|n from another of your sessions.").format(
name=obj.name
)
txt2 = _(
"|c{name}|n|R is now acted from another of your sessions.|n".format(
name=obj.name
)
)
"|c{name}|n|R is now acted from another of your sessions.|n"
).format(name=obj.name)
self.msg(txt1, session=session)
self.msg(txt2, session=obj.sessions.all())
self.unpuppet_object(obj.sessions.get())
@ -530,10 +524,8 @@ class DefaultAccount(AccountDB, metaclass=TypeclassBase):
and len(self.get_all_puppets()) >= _MAX_NR_SIMULTANEOUS_PUPPETS
):
self.msg(
_(
"You cannot control any more puppets (max {max_puppets})".format(
max_puppets=_MAX_NR_SIMULTANEOUS_PUPPETS
)
_("You cannot control any more puppets (max {max_puppets})").format(
max_puppets=_MAX_NR_SIMULTANEOUS_PUPPETS
)
)
return