Steve Holden writes:

 > In which case, wouldn't "_" make a better literal prefix than "i"?

There's no reason to suppose that "i" would be drop-in compatible for
GNU gettext (for example, gettext purely deals with the message
catalog lookup, while i-strings might be able to deal with currency
formatting and date formatting automatically, as POSIX locales (try
to) do), and "_" is already used in a plethora of software as an
abbreviation for gettext.

Those additional functions may not be easy to get right, though, and
that's what bothers me about this feature.  Do we know enough about
localization to freeze its functionality?  If not, how do we provide
for backward compatibility?  Eg, today we might decide that when
localizing to en_GB, we should deal with "l10n is a truckload of
labor" -> "l10n is a truckload of labour", and tomorrow the upgraded
version does "l10n is a lorry-full of labour" (with apologies for not
respecting the correct orthography as the base ;-).

 > A better comparison might be between _"..." and f"...".

It's orthogonal.  i-strings vs. gettext deals with the repetition of
the gettext call and assembling the string:

    "".join(_("Today is"), " ", _(dayofweek), ".")    # gettext
    i"Today is {dayofweek}."                          # i-string

while i-string vs. format deals with the DRY ugliness.

Steve
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/VI3RYB73X4SNICTEGSHSEFQIISJ6XUIE/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to