[Python-ideas] PEP 501 - i18n with marked strings

Ned Batchelder ned at nedbatchelder.com
Tue Aug 11 13:14:31 CEST 2015


On 8/11/15 6:50 AM, Petr Viktorin wrote:
> On Tue, Aug 11, 2015 at 12:43 PM, Ned Batchelder <ned at nedbatchelder.com> wrote:
>> On 8/10/15 4:31 PM, Mike Miller wrote:
>>> Hi,
>>>
>>> I haven't done i18n recently, so bare with me.  I'm not sure about bolting
>>> this on to "format strings", in that it feels like an orthogonal concept.
>>>
>>> However, what if we had i18n strings as well, not instead of:
>>>
>>>      i'Hello there, $name {age}.'
>>>
>> You haven't said what this would *mean*, precisely.  I18n tends to get very
>> involved, and is often specific to the larger framework that you are using.
>> Most people have adopted conventions that mean the syntax is already quite
>> simple for strings to be localized:
>>
>>      _("Hello there, {name}").format(name=name)
>>
>> What would i"" bring to the table?
> Not having to repeat the variable name three times.
That's what f"" does.  I don't understand what i"" adds to it.

--Ned.


More information about the Python-ideas mailing list