Any message with more than one variable should use named interpolation instead of positional
Bug #1592300 reported by
zhang.xiuhua
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Dashboard (Horizon) |
Fix Released
|
Low
|
zhang.xiuhua |
Bug Description
Any message with more than one variable should use named interpolation instead of positional, to allow translators to move the variables around in the string to account for differences in grammar and writing direction.
For example, do not do this:
# WRONG
raise ValueError(_('some message: v1=%s v2=%s') % (v1, v2))
Instead, use this style:
# RIGHT
raise ValueError(_('some message: v1=%(v1)s v2=%(v2)s') % {'v1': v1, 'v2': v2})
Refer to this document:
http://
Changed in horizon: | |
assignee: | nobody → zhang.xiuhua (zhang-xiuhua) |
status: | New → In Progress |
Changed in horizon: | |
assignee: | zhang.xiuhua (zhang-xiuhua) → David Lyle (david-lyle) |
Changed in horizon: | |
assignee: | nobody → zhang.xiuhua (zhang-xiuhua) |
Changed in horizon: | |
importance: | Undecided → Low |
milestone: | none → ocata-1 |
Changed in horizon: | |
milestone: | ocata-1 → ocata-2 |
To post a comment you must log in.
Patch here: https:/ /review. openstack. org/#/c/ 328614/