<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">2015-08-07 9:33 GMT+02:00 Nick Coghlan <span dir="ltr"><<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If f-strings are always eagerly interpolated<br>
prior to translation, then I can foresee a lot of complaints from<br>
folks asking why this doesn't work right:<br>
<br>
    print(_(f"This is a translated message with {a} and {b} interpolated"))<br></blockquote><div><br></div><div><br></div><div>What if we decide to lazy-interpolate f-strings?</div><div>A creation of such an f-string, creates an f-string object. (Which has a proper __repr__, so that it's transparent for those that don't care.)</div><div>Calling the __str__ method of the f-string triggers the interpolation.</div><div>This should give enough freedom to implement a working ugettext.</div><div><div><br></div><div>(But I still don't see any reason to go beyond supporting more than just is simple variable name between the curly braces...)</div></div><div><br></div><div><br></div><div><br></div><div> </div></div></div></div>
</div><br></div>