[openstack-dev] does exception need localize or not?

Jay S Bryant jsbryant at us.ibm.com
Mon Mar 17 17:32:52 UTC 2014


Doug,

I am glad that this has come up as Mike Perez and I were talking about 
this on Friday and even the documentation that you point to here:  
https://wiki.openstack.org/wiki/LoggingStandards#Log_Translation is not 
clear.  At least, not to me.

Should I interpret that to mean that debug messages should be created 
using LOG.debug and not use _() on the message being sent?  If that is the 
case, there are many places where LOG.debug is using _() on the message 
being passed.  Should we be planning to remove those?  I just want to 
understand what the plan going forward is there, especially given that the 
documentation currently says:  "Debug messages are not translated, for 
now. "

With regards to _LI(), etc.  It appears that this should be used in place 
of LOG.info _("Message").  Should we be enforcing a move from LOG.* to _L* 
in new code that is coming in?

Appreciate your thoughts on the subject!


Jay S. Bryant
       IBM Cinder Subject Matter Expert  &  Cinder Core Member
Department 7YLA, Building 015-2, Office E125, Rochester, MN
Telephone: (507) 253-4270, FAX (507) 253-6410
TIE Line: 553-4270
E-Mail:  jsbryant at us.ibm.com
--------------------------------------------------------------------
 All the world's a stage and most of us are desperately unrehearsed.
                   -- Sean O'Casey
--------------------------------------------------------------------



From:   Doug Hellmann <doug.hellmann at dreamhost.com>
To:     Joshua Harlow <harlowja at yahoo-inc.com>, 
Cc:     "OpenStack Development Mailing List \(not for usage questions\)" 
<openstack-dev at lists.openstack.org>
Date:   03/14/2014 03:54 PM
Subject:        Re: [openstack-dev] does exception need localize or not?






On Thu, Mar 13, 2014 at 6:44 PM, Joshua Harlow <harlowja at yahoo-inc.com> 
wrote:
From: Doug Hellmann <doug.hellmann at dreamhost.com>
Reply-To: "OpenStack Development Mailing List (not for usage questions)" <
openstack-dev at lists.openstack.org>
Date: Thursday, March 13, 2014 at 12:44 PM
To: "OpenStack Development Mailing List (not for usage questions)" <
openstack-dev at lists.openstack.org>
Subject: Re: [openstack-dev] does exception need localize or not?




On Thu, Feb 27, 2014 at 3:45 AM, yongli he <yongli.he at intel.com> wrote:
refer to :
https://wiki.openstack.org/wiki/Translations

now some exception use _ and some not.  the wiki suggest do not to do 
that. but i'm not sure.

what's the correct way?


F.Y.I 

What To Translate
At present the convention is to translate all user-facing strings. This 
means API messages, CLI responses, documentation, help text, etc.
There has been a lack of consensus about the translation of log messages; 
the current ruling is that while it is not against policy to mark log 
messages for translation if your project feels strongly about it, 
translating log messages is not actively encouraged.

I've updated the wiki to replace that paragraph with a pointer to 
https://wiki.openstack.org/wiki/LoggingStandards#Log_Translation which 
explains the log translation rules. We will be adding the job needed to 
have different log translations during Juno.

 
Exception text should not be marked for translation, becuase if an 
exception occurs there is no guarantee that the translation machinery will 
be functional.

This makes no sense to me. Exceptions should be translated. By far the 
largest number of errors will be presented to users through the API or 
through Horizon (which gets them from the API). We will ensure that the 
translation code does its best to fall back to the original string if the 
translation fails.

Doug

 


Regards
Yongli He


_______________________________________________
OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



I think this question comes up every 3 months, haha ;)

As we continue to expand all the libraries in 
https://github.com/openstack/requirements/blob/master/global-requirements.txt
 and knowing that those libraries likely don't translate there exceptions 
(probably in the majority of cases, especially in non-openstack/oslo 3rd 
party libraries) are we chasing a ideal that can not be caught?

Food for thought,

We can't control what the other projects do, but that doesn't prevent us 
from doing more. 

Doug

 

-Josh
_______________________________________________
OpenStack-dev mailing list
OpenStack-dev at lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140317/cc7aebe4/attachment.html>


More information about the OpenStack-dev mailing list