[Openstack-i18n] use dict-based substitution instead of index-based?

Akihiro Motoki amotoki at gmail.com
Fri Dec 13 01:22:40 UTC 2013


There is OpenStack Style Guidelines.
http://docs.openstack.org/developer/hacking/#internationalization-i18n-strings

If we have a variable a substitution %s should be used.
If multiple variables, keyword substitution should be used.

If a string you found does not follow the guideline, it is a bug and
please report it.

Thanks,
Akihiro

On Fri, Dec 13, 2013 at 9:11 AM, Chris K <nobodycam at gmail.com> wrote:
> Hello i18n team,
>
> I came across a question today I was unable to find the answer for. The
> question arose from a review I was looking over.
>
> Should I18n translated strings should use dict-based substitution instead of
> index-based?
>
> LOG.debug(_('stdout is: "%s"') % blah)
> vs.
> LOG.debug(_('stdout is: "%(blah)s"') % {'blah': blah})
>
> Thank you,
> Chris Krelle
>
>
>
> _______________________________________________
> Openstack-i18n mailing list
> Openstack-i18n at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-i18n
>



More information about the Openstack-i18n mailing list