Skip to content

Commit cf7e17d

Browse files
committed
refactor: translator hint that 'user%s' should not be 'user %s'
When I looked at this in the .po file, I thought it was a typo expecting: user rouilj not user1 add userid as a named replacement field to hint to the translator that "user%s" becomes user1 and the token shouldn't be split.
1 parent 97c8928 commit cf7e17d

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

roundup/cgi/client.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,8 +1677,8 @@ def handle_csrf(self, api=False):
16771677
if 'HTTP_X_REQUESTED_WITH' not in self.env:
16781678
logger.error(self._(
16791679
''"csrf X-REQUESTED-WITH xmlrpc required header "
1680-
''"check failed for user%s."),
1681-
current_user)
1680+
''"check failed for user%(userid)s."),
1681+
{"userid": current_user})
16821682
raise UsageError(self._("Required Header Missing"))
16831683

16841684
# Expire old csrf tokens now so we don't use them. These will
@@ -1717,14 +1717,16 @@ def handle_csrf(self, api=False):
17171717
if key is None: # we do not have an @csrf token
17181718
if enforce == 'required':
17191719
logger.error(self._(
1720-
"Required csrf field missing for user%s"), current_user)
1720+
"Required csrf field missing for user%(userid)s"),
1721+
{"userid": current_user})
17211722
raise UsageError(self._(
17221723
''"We can't validate your session (csrf failure). "
17231724
''"Re-enter any unsaved data and try again."))
17241725
if enforce == 'logfailure':
17251726
# FIXME include url
1726-
logger.warning(self._("csrf field not supplied by user%s"),
1727-
current_user)
1727+
logger.warning(self._(
1728+
"csrf field not supplied by user%(userid)s"),
1729+
{"userid": current_user})
17281730
else:
17291731
# enforce is either yes or no. Both permit change if token is
17301732
# missing

0 commit comments

Comments
 (0)