<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Title" content="">
<meta name="Keywords" content="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:Calibri;
color:windowtext;}
span.msoIns
{mso-style-type:export-only;
mso-style-name:"";
text-decoration:underline;
color:teal;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Hi, <o:p>
</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Thanks for pointing out that 2 and 3 won’t actually work, I apologize for the confusion it could’ve created.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">I don’t like the option 6, because making user-messages friendlier was the whole purpose of translation. Mixing languages in exception would be even worse than doing it in logs, IMHO. What
is more – if there’s a custom message passed to exception (e.g. MyException(“My message” % {k: v}), it overwrites the default one, so it would end up with English-only message.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Option 5 looks nice (and easy), but I don’t think that it will be very good if all other components will allow showing translated messages and Ironic won’t.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Seems like *<b>if</b>* we want to translate entire exception messages, we’re left with option 1 only, right?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Joanna<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-family:Calibri;color:black">From: </span>
</b><span style="font-family:Calibri;color:black">Pavlo Shchelokovskyy <pshchelokovskyy@mirantis.com><br>
<b>Reply-To: </b>"OpenStack Development Mailing List (not for usage questions)" <openstack-dev@lists.openstack.org><br>
<b>Date: </b>Wednesday, March 22, 2017 at 7:54 AM<br>
<b>To: </b>"OpenStack Development Mailing List (not for usage questions)" <openstack-dev@lists.openstack.org><br>
<b>Subject: </b>Re: [openstack-dev] [ironic] Translations removal<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">HI all, <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">my 5 cents:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">- option 1) is ugly due to code/string duplication;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">- options 2) and 3) are not going to work for translators as others already pointed;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">- option 4) has a caveat that we should do it consistently - either translate all or translate none, so there won't be a mess of log messages written in different languages at seemingly random;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">- option 5) from Lucas looks nice and easy, but I'm afraid we still have to i18n the errors returned to end user in API responses.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">So how about half-solution 6) - reorg our exception messages (at least those returned from API) to always include some string that is i18n'ed in the exception class declaration itself, but may have part of strings passed in at instantiation,
so nowhere the whole exception message is completely passed in when instantiating the exception. Downside is that final exception message may be returned in two languages (half i18n'ed, half English).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Cheers,<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><br clear="all">
<o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">Dr. Pavlo Shchelokovskyy <o:p></o:p></p>
<div>
<p class="MsoNormal">Senior Software Engineer<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Mirantis Inc<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="http://www.mirantis.com" target="_blank">www.mirantis.com</a><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Wed, Mar 22, 2017 at 4:13 PM, Lucas Alvares Gomes <<a href="mailto:lucasagomes@gmail.com" target="_blank">lucasagomes@gmail.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">Hi,<br>
<br>
>> Possible options to handle that:<br>
>><br>
>> 1) Duplicate messages:<br>
>><br>
>> LOG.error(“<error message>”, {<key>: <val>})<br>
>><br>
>> raise Exception(_(“<error message>”) % {<key>: <val>})<br>
>><br>
>> 2) Ignore this error<br>
>><br>
>> 3) Talk to hacking people about possible upgrade of this check<br>
>><br>
>> 4) Pass translated text to LOG in such cases<br>
>><br>
>><br>
>><br>
>> I’d personally vote for 2. What are your thoughts?<br>
><br>
> When the translators go to translate, they generally only get to see<br>
> what's inside _(), so #2 is a no-go for translations, and #3 also is a<br>
> no-go.<br>
<br>
+1<br>
<br>
Just throwing and idea here: Is not translating anything an option ?<br>
<br>
Personally I don't see much benefits in translating a software like<br>
Ironic, there are many "user facing" parts that will remain in<br>
english, e.g: The resource attributes name, node's states (powered<br>
off, powered on, deploying, deploy wait...), etc... So why bother ? I<br>
think it's fair to assume that people using Ironic directly (not via<br>
horizon for example) understands english. It's a lot of overhead to<br>
get it translated and there are very few people working on it for<br>
Ironic (right now, Ironic is 2.74% translated [0]). IMHO just the<br>
costs of having duplicated strings all over in the code overweight the<br>
benefits.<br>
<br>
I did some translation of Ironic to Brazilian Portuguese in the past<br>
myself and it's really tough to keep up the pace, strings are added or<br>
changed very rapidly.<br>
<br>
So again, is: "5) Not translate anything" an option here ?<br>
<br>
[0] <a href="https://translate.openstack.org/iteration/view/ironic/master?dswid=9016" target="_blank">
https://translate.openstack.org/iteration/view/ironic/master?dswid=9016</a><br>
<br>
Cheers,<br>
Lucas<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">
OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>