diff options
| author | Martin Trigaux <mat@odoo.com> | 2020-06-15 15:16:16 +0200 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2020-06-18 13:03:34 +0200 |
| commit | 80e97e98ce76067db1079af8feeef667cfadf837 (patch) | |
| tree | e261d34e3f8458bd99011f60f508bcce2c723baf /addons/gamification/models/challenge.py | |
| parent | 4a92a183e8631512a8b018eedaf9bf4956ca85e9 (diff) | |
[IMP] *: use named placeholders in translated message
When more than one parameter is present in a message, it helps the
translation to use named placeholder. This way, the order can be
changed. It also helps the comprehension of the message.
Diffstat (limited to 'addons/gamification/models/challenge.py')
| -rw-r--r-- | addons/gamification/models/challenge.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/addons/gamification/models/challenge.py b/addons/gamification/models/challenge.py index 72fcf48ebad..93efdef0d9b 100644 --- a/addons/gamification/models/challenge.py +++ b/addons/gamification/models/challenge.py @@ -656,7 +656,11 @@ class Challenge(models.Model): if rewarded_users: user_names = rewarded_users.name_get() - message_body += _("<br/>Reward (badge %s) for every succeeding user was sent to %s.") % (challenge.reward_id.name, ", ".join(name for (user_id, name) in user_names)) + message_body += _( + "<br/>Reward (badge %(badge_name)s) for every succeeding user was sent to %(users)s.", + badge_name=challenge.reward_id.name, + users=", ".join(name for (user_id, name) in user_names) + ) else: message_body += _("<br/>Nobody has succeeded to reach every goal, no badge is rewarded for this challenge.") |
