Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #48954
| References | (1 earlier) <51C4D2FF.8000709@digipen.edu> <mailman.3692.1371908252.3114.python-list@python.org> <51870913-c348-4807-bc25-aa7c8fbf0001@googlegroups.com> <CAPTjJmotX6GWyA_VV3FKvxTMBp2OZT6nOk=1PSvyR6veg1Ek_w@mail.gmail.com> <51C63334.2080805@davea.name> |
|---|---|
| Date | 2013-06-23 09:37 +1000 |
| Subject | Re: n00b question on spacing |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3714.1371944261.3114.python-list@python.org> (permalink) |
On Sun, Jun 23, 2013 at 9:28 AM, Dave Angel <davea@davea.name> wrote:
> On 06/22/2013 07:12 PM, Chris Angelico wrote:
>>
>> On Sun, Jun 23, 2013 at 1:24 AM, Rick Johnson
>> <rantingrickjohnson@gmail.com> wrote:
>>>
>>> _fmtstr = "Item wrote to MongoDB database {0}, {1}"
>>> msg = _fmtstr.format(_arg1, _arg2)
>>
>>
>> As a general rule, I don't like separating format strings and their
>> arguments. That's one of the more annoying costs of i18n. Keep them in
>> a single expression if you possibly can.
>>
>
> On the contrary, i18n should be done with config files. The format string
> is the key to the actual string which is located in the file/dict.
> Otherwise you're shipping separate source files for each language -- blecch.
The simplest way to translate is to localize the format string; that's
the point of .format()'s named argument system (since it lets you
localize in a way that reorders the placeholders). What that does is
it puts the format string away in a config file, while the replaceable
parts are here in the source. That's why I say that's a cost of i18n -
it's a penalty that has to be paid in order to move text strings away.
> The program that's intended to be internationalized is written using
> "programmereze" strings. That's a strange inhuman language that's only
> approximately comprehensible by the developer and close associates. Then
> that gets translated into a bunch of language-specific config files, with
> English probably being one of them.
Heh. That's one way of looking at it... I don't really know what
language we speak; at what point is it deemed a separate dialect, and
at what point a unique language? Hmmm.
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: n00b question on spacing Joshua Landau <joshua.landau.ws@gmail.com> - 2013-06-22 14:36 +0100
Re: n00b question on spacing Rick Johnson <rantingrickjohnson@gmail.com> - 2013-06-22 08:24 -0700
Re: n00b question on spacing Joshua Landau <joshua.landau.ws@gmail.com> - 2013-06-22 16:40 +0100
Re: n00b question on spacing Rick Johnson <rantingrickjohnson@gmail.com> - 2013-06-22 08:55 -0700
Re: n00b question on spacing Joshua Landau <joshua.landau.ws@gmail.com> - 2013-06-22 17:11 +0100
Re: n00b question on spacing Chris Angelico <rosuav@gmail.com> - 2013-06-23 09:12 +1000
Re: n00b question on spacing Rick Johnson <rantingrickjohnson@gmail.com> - 2013-06-22 17:48 -0700
Re: n00b question on spacing Chris Angelico <rosuav@gmail.com> - 2013-06-23 12:26 +1000
Re: n00b question on spacing Dave Angel <davea@davea.name> - 2013-06-22 19:28 -0400
Re: n00b question on spacing Chris Angelico <rosuav@gmail.com> - 2013-06-23 09:37 +1000
Re: n00b question on spacing Dave Angel <davea@davea.name> - 2013-06-22 19:56 -0400
Re: n00b question on spacing Chris Angelico <rosuav@gmail.com> - 2013-06-23 10:27 +1000
Re: n00b question on spacing Dave Angel <davea@davea.name> - 2013-06-22 20:46 -0400
Re: n00b question on spacing MRAB <python@mrabarnett.plus.com> - 2013-06-23 02:20 +0100
Re: n00b question on spacing Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-23 02:58 +0000
Re: n00b question on spacing Roy Smith <roy@panix.com> - 2013-06-22 23:12 -0400
Re: n00b question on spacing Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-06-23 03:22 +0000
Re: n00b question on spacing Chris Angelico <rosuav@gmail.com> - 2013-06-23 13:36 +1000
Re: n00b question on spacing Roy Smith <roy@panix.com> - 2013-06-23 09:43 -0400
Re: n00b question on spacing Chris Angelico <rosuav@gmail.com> - 2013-06-23 14:09 +1000
Re: n00b question on spacing Dave Angel <davea@davea.name> - 2013-06-22 21:35 -0400
Re: n00b question on spacing Terry Reedy <tjreedy@udel.edu> - 2013-06-23 11:40 -0400
csiph-web