Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'languages,': 0.04; 'string.': 0.05; 'string': 0.09; 'executable': 0.09; 'preferable': 0.09; 'runtime': 0.09; 'wrapper': 0.09; 'subject:question': 0.10; 'language.': 0.14; '23,': 0.16; 'crude': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'imo.': 0.16; 'files.': 0.16; 'appropriate': 0.16; 'language': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'trying': 0.19; '>>>': 0.22; 'saying': 0.22; 'separate': 0.22; 'creating': 0.23; 'config': 0.24; 'specifies': 0.24; 'file.': 0.24; 'source': 0.25; 'equivalent': 0.26; 'header :In-Reply-To:1': 0.27; 'point': 0.28; 'chris': 0.29; 'am,': 0.29; 'specified': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'file': 0.32; 'actual': 0.34; 'problem': 0.35; 'agree': 0.35; 'usual': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'located': 0.36; 'c++': 0.36; 'done': 0.36; 'possible': 0.36; 'should': 0.36; 'somebody': 0.38; 'handle': 0.38; 'to:addr:python-list': 0.38; 'files': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'even': 0.60; 'dave': 0.60; 'most': 0.60; 'french': 0.61; "you're": 0.61; 'making': 0.63; 'real': 0.63; 'kept': 0.65; 'close': 0.67; 'physical': 0.72; 'dict,': 0.84; 'angel': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=F6akXAPsEp5dX/ak4I6xf2sRkqeR8FkzoUm+tGO5j68=; b=eDSDyIRmob1l1RB6fzQtAb5oMC9TtbNWc9J+A9kh/OnrqBuT+GXJpUkC1ejschqx6l AfvLASaIAMfcSTVM4LZG8pOX4BKwRCNKYtpW+9n+ymqkt77UuxwrMC5DHQGyNkUteLyd mU5Tj6n8ICptQnAPSzuTP9/63uaw4MpHJwZo8xmrrAWLRi679Qq4xkkEksM3Hbo+cswS hf2Dh4cgAp3rokboEPvn1amGmGET2Y8SFT+juApr7PkS1yIEaU7/U/7fCz0/Q03IGnlX 7IRgWKbONbBGqQJUvdKqCvh+F3XOtmHMnXcm7Wl+z3uSShZkEfWorEUeNUNcHLqAwEGD Defw== MIME-Version: 1.0 X-Received: by 10.221.4.4 with SMTP id oa4mr8413397vcb.70.1371947260689; Sat, 22 Jun 2013 17:27:40 -0700 (PDT) In-Reply-To: <51C639A5.5070600@davea.name> References: <51C4D2FF.8000709@digipen.edu> <51870913-c348-4807-bc25-aa7c8fbf0001@googlegroups.com> <51C63334.2080805@davea.name> <51C639A5.5070600@davea.name> Date: Sun, 23 Jun 2013 10:27:40 +1000 Subject: Re: n00b question on spacing From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371947263 news.xs4all.nl 15895 [2001:888:2000:d::a6]:43352 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48956 On Sun, Jun 23, 2013 at 9:56 AM, Dave Angel wrote: > On 06/22/2013 07:37 PM, Chris Angelico wrote: >>> On the contrary, i18n should be done with config files. The format >>> string > > > **as specified in the physical program** > > >>> 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. > > > What I was trying to say is that the programmereze format string in the code > is replaced at runtime by the French format string in the config file. > > But the language is missing the indirection I described. So you have to use > a (function or whatever) wrapper to look up the actual format string in the > config file. My point is by making that file equivalent to a dict, you get > to have an executable program in "programmereze" before creating any config > files, but still able to handle any real language with one config file per > language. > > This is much preferable to the usual numeric lookup, where somebody > specifies the 17th format string to be used at this place in the code. Even > when you use C++ names, they're still only a crude approximation to the real > purpose of the string. What you're saying is that there are ways to ameliorate the problem with i18n. What that means is that you broadly agree with my main point, which is that the format string should be kept as close as possible to the arguments. When you're NOT translating to multiple languages, the string-literal is the most appropriate way to lay this out, imo. ChrisA