[openstack-dev] Less of coding standard for i18n of LOG messages

Johannes Erdfelt johannes at erdfelt.com
Wed Nov 7 18:21:42 UTC 2012


On Wed, Nov 07, 2012, Eric Windisch <eric at cloudscaling.com> wrote:
> > It can't match strings that have already been formatted. It can only do
> > so unformatted.
> > 
> > We have more information in HACKING.rst about why the order matters.
> 
> I was implying that we could have the logging system do the formatting
> and i18n for us, rather than just the formatting.  Clearly, the i18n
> would have to be applied before formatting. Perhaps it is better we do
> this explicitly, but we're also seeing that developers just aren't
> doing it consistently.

Having cleaned up a lot of incorrect uses of i18n in the past, I'm
generally for trying to make i18n easier on developers.

However, I'm worried that only making logging do implicit i18n will
confuse developers even more by making the rules on when to i18n
variable.

For instance, exception messages are internationalized right now as
well. If we make logging implicit and exceptions explicit, I think
that might end up causing more confusion.

It might be feasible to make exceptions also do implicit i18n as well
since NovaException already does formatting...

JE




More information about the OpenStack-dev mailing list