[openstack-dev] Less of coding standard for i18n of LOG messages
Davanum Srinivas
davanum at gmail.com
Wed Nov 7 15:58:12 UTC 2012
fyi, this thread originates from the following Bug report:
https://bugs.launchpad.net/nova/+bug/1075082
thanks,
dims
On Wed, Nov 7, 2012 at 10:43 AM, Ying Chun Guo <guoyingc at cn.ibm.com> wrote:
> Hi,
>
> From my observation, in the source codes, i18n of LOG messages (or
> strings) are lack of consistency. There is no coding standard for the i18n
> of LOG messages. Some LOG messages are wrapped with _(), some are not.
> Messages wrapped with _() will be extracted into PO template and will be
> translated. There is no rules to tell which kind of LOG messages should be
> translated and which should not. It all happens randomly, depending on the
> programming habits of developers. This is not good. We may need a wide
> discussion within the community, get an agreement, make a coding standard
> for all projects in OpenStack, and then change the codes to make them
> consistent.
>
> First of all, there is an agreement within community that user-facing
> string should be translated. As to LOG messages, there are arguments but no
> consensus yet. One argument says the LOG messages are useful for
> operators/administrators especially in the case of abnormal behavior and is
> certainly accessible to users and therefore just like all user-facing text,
> thus LOG messages should be translated. The opposing argument could say
> that LOG is primarily useful for developers, developers can read English
> LOG, and LOG in different languages will block the communication between
> developers and users, thus LOG should not be translated.
>
> Besides these arguments, there are some other questions we need to think
> about. What if the same message is both logged AND thrown back to the user?
> What about different log levels (EXCEPTION, ERROR, WARNING, AUDIT, INFO,
> DEBUG)? I think DEBUG messages should never be translated as they are only
> for developer consumption. What about the other levels?
>
> Of course, before we make the decision, we also need to consider the
> workload to change the existing codes in order to make them consistent.
> Below statistic data are gotten by scanning the existing codes. You may
> notice that LOG messages with _() are in the majority in the existing
> codes. We may need to compare the workload to add _() to the minority with
> the workload to remove _() from the majority.
>
> ----------STATISTIC DATA-----------------
> Project name | Num of messages without _() | Num of messages with _()
> Nova | 28 | 1988
> Glance | 22 | 233
> Keystone | 53 | 3
> Quantum | 228 | 246
> Cinder | 10 | 1525
> ----------------------------------------
>
> Feel free to express your opinions. I'd love to hear feedback as much as
> possible, especially people from Non-English speaking countries. You can
> also help to do a survey within your customers, and let the community know
> the result.
>
> Thanks and regards
> Daisy
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
--
Davanum Srinivas :: http://davanum.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20121107/09b3efb9/attachment.html>
More information about the OpenStack-dev
mailing list