Roundup Tracker - Issues

Message7297

Author rouilj
Recipients rouilj
Date 2021-07-03.16:51:12
Message-id <1625331072.69.0.0741506275451.issue2551146@roundup.psfhosted.org>
In-reply-to
When running step 1 of Release.txt, we get abunch of warnings like:

../roundup/cgi/client.py:1430: warning: 'msgid' format string with 
unnamed arguments cannot be properly localized:
                      The translator cannot reorder the arguments.
                      Please consider using a format string with named 
arguments,
                      and a mapping instead of a tuple for the 
arguments.
 
which points to:

  logger.error(
     self._("Csrf mismatch user: current session %s != stored session 
%s, current user/stored user is: %s for key %s."),
        current_session, nonce_session, current_user, key)

It makes it easier for translators if written as:

     self._("Csrf mismatch user: current session %(current_session)s != 
stored session %(nonce_session)s, current user/stored user is: %
(current_user)s for key %(key)s."),
        {"current_session": current_session,
         "nonce_session": nonce_session,
         "current_user": current_user, "key": key})

or, if the arguments are simple variables in local scope
(as opposed to function calls etc.)

     self._("Csrf mismatch user: current session %(current_session)s != 
stored session %(nonce_session)s, current user/stored user is: %
(current_user)s for key %(key)s."), locals())

Most important for translation are user facing strings. Second most 
important are admin facing (which includes logging at warning or 
higher.) Third are tracing statements at info or lower.
History
Date User Action Args
2021-07-03 16:51:12rouiljsetrecipients: + rouilj
2021-07-03 16:51:12rouiljsetmessageid: <1625331072.69.0.0741506275451.issue2551146@roundup.psfhosted.org>
2021-07-03 16:51:12rouiljlinkissue2551146 messages
2021-07-03 16:51:12rouiljcreate