<div dir="ltr">On Wed, Mar 22, 2017 at 11:44 AM, Sean McGinnis <span dir="ltr"><<a href="mailto:sean.mcginnis@gmx.com" target="_blank">sean.mcginnis@gmx.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Mar 22, 2017 at 08:42:42AM -0500, Kevin L. Mitchell wrote:<br>
> On Tue, 2017-03-21 at 22:10 +0000, Taryma, Joanna wrote:<br>
> > However, pep8 does not accept passing variable to translation<br>
> > functions,  so this results in ‘H701 Empty localization string’ error.<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>
<br>
</span>I think the appropriate thing here is to do something like:<br>
<br>
msg = _('<error message>') % {<key>: <val>}<br>
LOG.error(msg)<br>
raise Exception(msg)<br>
<br>
This results in a translated string going to the log, but I think that's<br>
OK.<br></blockquote><div><br></div><div>+1, let's not overcomplicate this. If folks report it as a problem, we<br></div><div>can always go back to option 1 later.<br></div><div><br></div><div>// jim</div><br></div><br></div></div>