← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1592300] [NEW] Any message with more than one variable should use named interpolation instead of positional

 

Public bug reported:

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://docs.openstack.org/developer/oslo.i18n/guidelines.html

** Affects: horizon
     Importance: Undecided
     Assignee: zhang.xiuhua (zhang-xiuhua)
         Status: In Progress

** Changed in: horizon
     Assignee: (unassigned) => zhang.xiuhua (zhang-xiuhua)

** Changed in: horizon
       Status: New => In Progress

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1592300

Title:
  Any message with more than one variable should use named interpolation
  instead of positional

Status in OpenStack Dashboard (Horizon):
  In Progress

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://docs.openstack.org/developer/oslo.i18n/guidelines.html

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1592300/+subscriptions


Follow ups