<html><body>
<p><tt><font size="2">Peng Wu <peng.e.wu@gmail.com> wrote on 2014/02/11 14:03:21:<br>
<br>
> Peng Wu <peng.e.wu@gmail.com> </font></tt><br>
<tt><font size="2">> 2014/02/11 14:03</font></tt><br>
<tt><font size="2">> <br>
> To</font></tt><br>
<tt><font size="2">> <br>
> openstack-i18n@lists.openstack.org, </font></tt><br>
<tt><font size="2">> <br>
> cc</font></tt><br>
<tt><font size="2">> <br>
> Subject</font></tt><br>
<tt><font size="2">> <br>
> [Openstack-i18n] [RFC] another message id generation proposal</font></tt><br>
<tt><font size="2">> <br>
> Hi,<br>
> Recently I read about the idea of REST API message and log message<br>
> i18n proposals.<br>
> <br>
> I think maybe we could generate the message id by file name, method<br>
> name and line no, like "test2.py#Main#15".<br>
> I think this new message id is shorter and more readable than md5sum.</font></tt><br>
<br>
<tt><font size="2">How to handle if the line no is changed?</font></tt><br>
<tt><font size="2">I think one advantage to use message id is that the message id is easy to track,</font></tt><br>
<tt><font size="2">in different languages and in different versions (maybe).</font></tt><br>
<tt><font size="2">So I would prefer to keep </font></tt><tt><font size="2">consistency among different versions.</font></tt><br>
<br>
<tt><font size="2">Also, if the number has a project name as the prefix, it is useful too.</font></tt><br>
<tt><font size="2"><br>
> <br>
> And with this kind of information, the developer can locate the<br>
> message as follows:<br>
> 1. find all files with the same file name;<br>
> 2. jump to the line no;<br>
> 3. verify the function name and the gettext call;<br>
> Then the developer can find the corresponding message.<br>
> <br>
> In the attachment, it is a small python program to print the<br>
> information.<br>
> <br>
> Feel free to comment this new proposal.<br>
> <br>
> Thanks,<br>
> Peng Wu<br>
> <br>
> Refer URL:<br>
> <a href="https://blueprints.launchpad.net/oslo/+spec/log-messages-id">https://blueprints.launchpad.net/oslo/+spec/log-messages-id</a><br>
> <a href="https://blueprints.launchpad.net/oslo/+spec/log-messages-translation-domain">https://blueprints.launchpad.net/oslo/+spec/log-messages-translation-domain</a><br>
> <br>
> <br>
> PS: I just noticed that some developers are considering to log both<br>
> English and translated log messages, dunno whether they plan to return<br>
> both English and translated REST API messages.</font></tt><br>
<br>
<tt><font size="2">As I know, Oslo provides a way to configure the locale language used in </font></tt><br>
<tt><font size="2">log files, and both (English and locale language).</font></tt><br>
<tt><font size="2">I don't hear that they are going to return REST API messages in both languages.</font></tt><br>
<br>
<tt><font size="2">Regards<br>
Daisy</font></tt><br>
<tt><font size="2"><br>
</font></tt><br>
<tt><font size="2">> <br>
> [attachment "test2.py" deleted by Ying Chun Guo/China/IBM] <br>
> _______________________________________________<br>
> Openstack-i18n mailing list<br>
> Openstack-i18n@lists.openstack.org<br>
> <a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-i18n">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-i18n</a><br>
</font></tt></body></html>