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

Kevin L. Mitchell kevin.mitchell at rackspace.com
Wed Nov 7 17:56:33 UTC 2012


On Wed, 2012-11-07 at 12:26 -0500, Eric Windisch wrote:
> In fact, now that I think abut it, is there a reason we use _() from
> callers instead of just having the log formatter wrap this for us? 

Technical reasons.  The ones I can think of off the top of my head:

     1. The tools which extract strings to be translated expect those
        strings to be wrapped in _().
     2. The LOG.<level>() methods are often passed pre-formatted
        strings, i.e.:

                LOG.error(_("message here with %s") % variable)
-- 
Kevin L. Mitchell <kevin.mitchell at rackspace.com>




More information about the OpenStack-dev mailing list