From webmaster@pferdemarkt.ws Thu Mar 6 14:04:44 2003 From: webmaster@pferdemarkt.ws (webmaster@pferdemarkt.ws) Date: Thu, 6 Mar 2003 06:04:44 -0800 Subject: [I18n-sig] Pferdemarkt.ws informiert! Newsletter 03/2003 http://www.pferdemarkt.ws Message-ID: <200303061404.GAA22727@eagle.he.net> http://www.pferdemarkt.ws Wir sind in 2003 erfolgreich in des neue \"Pferdejahr 2003 gestartet. Für den schnellen Erfolg unseres Marktes möchten wir uns bei Ihnen bedanken. Heute am 06.03.2003 sind wir gut 2 Monate Online! Täglich wächst unsere Datenbank um 30 Neue Angebote. Stellen auch Sie als Privatperson Ihre zu verkaufenden Pferde direkt und vollkommen kostenlos ins Internet. Zur besseren Sichtbarmachung Ihrer Angebote können Sie bis zu ein Bild zu Ihrer Pferdeanzeige kostenlos einstellen! Wollen Sie direkt auf die erste Seite, dann können wir Ihnen unser Bonussystem empfehlen. klicken Sie hier: http://www.pferdemarkt.ws/bestellung.html Ihr http://Pferdemarkt.ws Team Klicken Sie hier um sich direkt einzuloggen http://www.Pferdemarkt.ws Kostenlos Anbieten, Kostenlos Suchen! Direkt von Privat zu Privat! Haben Sie noch Fragen mailto: webmaster@pferdemarkt.ws From j-david@noos.fr Mon Mar 10 14:12:58 2003 From: j-david@noos.fr (=?ISO-8859-1?Q?Juan_David_Ib=E1=F1ez_Palomar?=) Date: Mon, 10 Mar 2003 15:12:58 +0100 Subject: [I18n-sig] Re: bugs in gettext.py plural handling In-Reply-To: <15962.7870.534282.204499@honolulu.ilog.fr> References: <15962.7870.534282.204499@honolulu.ilog.fr> Message-ID: <3E6C9D6A.6070607@noos.fr> Hi, I have posted a patch to the tracker [1] which contains all your fixes. For the number 2, I have just catched the tokenize.TokenError exception. Best regards, david [1] https://sourceforge.net/tracker/index.php?func=detail&aid=700839&group_id=5470&atid=305470 Bruno Haible wrote: >Hi, > >Testing GNU gettext's integration test with Python 2.3a2, I see that >there are several bugs relating to plural forms and the ngettext function. > > >1) > >$ python >import gettext >germanic = gettext.c2py('!(n == 1)') >Traceback (most recent call last): > File "", line 1, in ? > File "/packages/gnu-inst-python/2.3a2/lib/python2.3/gettext.py", line 110, in c2py > stack[-1] += '(%s)' % s >IndexError: list index out of range > >The ! operator is treated incorrectly if not followed by a space. > >Here is a fix. > >*** gettext.py.bak 2003-02-22 02:28:17.000000000 +0100 >--- gettext.py 2003-02-22 21:37:33.000000000 +0100 >*************** >*** 88,95 **** > plural = plural.replace('&&', ' and ') > plural = plural.replace('||', ' or ') > >! expr = re.compile(r'\![^=]') >! plural = expr.sub(' not ', plural) > > # Regular expression and replacement function used to transform > # "a?b:c" to "test(a,b,c)". >--- 88,95 ---- > plural = plural.replace('&&', ' and ') > plural = plural.replace('||', ' or ') > >! expr = re.compile(r'\!([^=])') >! plural = expr.sub(' not \\1', plural) > > # Regular expression and replacement function used to transform > # "a?b:c" to "test(a,b,c)". > > >2) Unbalanced parentheses in a plural expression don't give an error >'unbalanced parenthesis in plural form'. > >Example: >$ python >import gettext >germanic = gettext.c2py('n =)= 1') > >Instead we get an weird error message > >tokenize.TokenError: ('EOF in multi-line statement', (2, 0)) > >Furthermore even if this error were avoided, we would get > >IndexError: list index out of range > >Here is a fix for the second half of this bug. I don't know Python >enough to fix the first half as well. > >*** gettext.py.bak 2003-02-22 02:28:17.000000000 +0100 >--- gettext.py 2003-02-22 21:37:33.000000000 +0100 >*************** >*** 104,110 **** > if c == '(': > stack.append('') > elif c == ')': >! if len(stack) == 0: > raise ValueError, 'unbalanced parenthesis in plural form' > s = expr.sub(repl, stack.pop()) > stack[-1] += '(%s)' % s >--- 104,110 ---- > if c == '(': > stack.append('') > elif c == ')': >! if len(stack) == 1: > raise ValueError, 'unbalanced parenthesis in plural form' > s = expr.sub(repl, stack.pop()) > stack[-1] += '(%s)' % s > > >3) Here's my test code (in ISO-8859-1): > >===================== prog.py ============================ >import sys >import gettext > >n = int(sys.argv[1]) > >gettext.textdomain('prog') >gettext.bindtextdomain('prog', '.') > >print gettext.gettext("'Your command, please?', asked the waiter.") >print gettext.ngettext("a piece of cake","%(count)d pieces of cake",n) \ > % { 'count': n } >print gettext.gettext("%(oldCurrency)s is replaced by %(newCurrency)s.") \ > % { 'oldCurrency': "FF", 'newCurrency' : "EUR" } >======================= fr.po ============================ >msgid "" >msgstr "" >"Content-Type: text/plain; charset=ISO-8859-1\n" >"Plural-Forms: nplurals=2; plural=(n > 1);\n" > >msgid "'Your command, please?', asked the waiter." >msgstr "«Votre commande, s'il vous plait», dit le garçon." > ># Les gateaux allemands sont les meilleurs du monde. >#, python-format >msgid "a piece of cake" >msgid_plural "%(count)d pieces of cake" >msgstr[0] "un morceau de gateau" >msgstr[1] "%(count)d morceaux de gateau" > ># Reverse the arguments. >#, python-format >msgid "%(oldCurrency)s is replaced by %(newCurrency)s." >msgstr "%(newCurrency)s remplace %(oldCurrency)s." >========================================================== > >$ mkdir -p fr/LC_MESSAGES >$ msgfmt -o fr/LC_MESSAGES/prog.mo fr.po >$ LANGUAGE= LC_ALL=fr_FR python prog.py 2 >«Votre commande, s'il vous plait», dit le garçon. >Traceback (most recent call last): > File "prog.py", line 10, in ? > print gettext.ngettext("a piece of cake","%(count)d pieces of cake",n) \ > File "/packages/gnu-inst-python/2.3a2/lib/python2.3/gettext.py", line 445, in ngettext > return dngettext(_current_domain, msgid1, msgid2, n) > File "/packages/gnu-inst-python/2.3a2/lib/python2.3/gettext.py", line 437, in dngettext > return t.ngettext(msgid1, msgid2, n) > File "/packages/gnu-inst-python/2.3a2/lib/python2.3/gettext.py", line 294, in ngettext > return self._catalog[(msgid1, self.plural(n))] >AttributeError: GNUTranslations instance has no attribute 'plural' > >Why does it have no 'plural' attribute? > >* Testing that the header entry starts with 'Project-Id-Version:' is >not appropriate because it excludes valid header entries. The gettext >tools may remove or move this line in future versions. > >* libintl and msgfmt assume a fallback of "n != 1" if no Plural-Forms: >entry is provided. In the same way, self.plural should use "n != 1" as a >fallback. > >Here is the fix for both. > >*** gettext.py.bak 2003-02-22 02:28:17.000000000 +0100 >--- gettext.py 2003-02-22 21:37:33.000000000 +0100 >*************** >*** 114,119 **** >--- 114,121 ---- > > return eval('lambda n: int(%s)' % plural) > >+ _germanic_plural = lambda n: int(n != 1) >+ > > > def _expand_lang(locale): >*************** >*** 225,230 **** >--- 227,233 ---- > # Parse the .mo file header, which consists of 5 little endian 32 > # bit words. > self._catalog = catalog = {} >+ self.plural = _germanic_plural > buf = fp.read() > buflen = len(buf) > # Are we big endian or little endian? >*************** >*** 258,264 **** > else: > raise IOError(0, 'File is corrupt', filename) > # See if we're looking at GNU .mo conventions for metadata >! if mlen == 0 and tmsg.lower().startswith('project-id-version:'): > # Catalog description > for item in tmsg.split('\n'): > item = item.strip() >--- 261,267 ---- > else: > raise IOError(0, 'File is corrupt', filename) > # See if we're looking at GNU .mo conventions for metadata >! if mlen == 0: > # Catalog description > for item in tmsg.split('\n'): > item = item.strip() > > >4) Btw, I have to correct a misimpression. It was claimed in >http://mail.python.org/pipermail/i18n-sig/2002-November/001514.html >that GNU xgettext 0.11.5 doesn't support ngettext in Python. But it does >if you add the command line options "-kgettext -kngettext:1,2". The reason >is that when xgettext 0.11.5 was released, Python didn't have the ngettext >function, and noone told me that it would. > >So for example, > > $ xgettext -kgettext -kngettext:1,2 -o - prog.py > >produces the .pot file for prog.py above. > > >Bruno > > > -- J. David Ibáñez, http://www.j-david.net Software Engineer / Ingénieur Logiciel / Ingeniero de Software From bruno@clisp.org Thu Mar 13 10:42:24 2003 From: bruno@clisp.org (Bruno Haible) Date: Thu, 13 Mar 2003 11:42:24 +0100 (CET) Subject: [I18n-sig] Re: bugs in gettext.py plural handling In-Reply-To: <3E6C9D6A.6070607@noos.fr> References: <15962.7870.534282.204499@honolulu.ilog.fr> <3E6C9D6A.6070607@noos.fr> Message-ID: <15984.24720.235742.910952@honolulu.ilog.fr> Juan: > I have posted a patch to the tracker [1] which contains > all your fixes. For the number 2, I have just catched the > tokenize.TokenError exception. Martin: > Committed as gettext.py 1.17. Thanks to both of you! Bruno From Tex Texin Fri Mar 14 21:53:26 2003 From: Tex Texin (Tex Texin) Date: Fri, 14 Mar 2003 16:53:26 -0500 Subject: [I18n-sig] Register now! 1 week to go! Prague I18n and Unicode Conference Message-ID: <3E724F56.78102423@i18nguy.com> ************************************************************************* Register now! > Just 1 week to go! > Register now! > Just 1 week to go! ************************************************************************* NEWSFLASH: Bring your books to the Conference! (see below) Twenty-third Internationalization and Unicode Conference (IUC23) Unicode, Internationalization, the Web: The Global Connection http://www.unicode.org/iuc/iuc23 March 24-26, 2003 Prague, Czech Republic ************************************************************************* NEWS > Meet industry leaders in Prague and discuss the hot topics for internationalization and Unicode in 2003! Check out the updated Conference program ( http://www.unicode.org/iuc/iuc23/program.html ) which includes abstracts of talks and speakers' biographies. Register while there's still time via the Conference Web site at http://www.unicode.org/iuc/iuc23/registration.html . > Sign up for the Workshop on Managing Localization Projects, organized by XenCraft, and taking place in the same venue on 27 March -- See: http://www.unicode.org/iuc/iuc23 > Bring your books to the Prague Internationalization and Unicode Conference! Internationalization industry pundits Don DePalma, Bill Hall, and Michael Kaplan will be available for book signings at noon in the SHOWCASE Exhibition area on Tuesday March 25. Bring your copy of their books or articles to the conference to have them autographed, or pick up their latest works right at the SHOWCASE. This is your chance to meet and greet these authors. > Attend the new Showcase to find out more about products supporting the Unicode Standard, and products and services that can help you globalize/localize your software, documentation and Internet content. > Be an Exhibitor! Show off your product at the premier technical conference worldwide for both software and Web internationalization. See: http://www.unicode.org/iuc/iuc23/showcase.html CONFERENCE PROGRAM The conference features tutorials, lectures, and panel discussions that provide coverage of standards, best practices, and recent advances in the globalization of software and the Internet. See the program: http://www.unicode.org/iuc/iuc23/program.html GLOBAL COMPUTING SHOWCASE For the first time, we will have an Exhibitors' track as part of the Conference, in addition to the updated Showcase Exhibition. For more information, please visit the Web site at: http://www.unicode.org/iuc/iuc23/showcase.html Showcase participants include: Agfa Monotype Corporation Alchemy Software Development Ltd. Basis Technology Corporation Moravia IT Multilingual Computing, Inc. CONFERENCE VENUE & ACCOMMODATION The Conference will take place in lovely, historic Prague: Marriott Prague Hotel V Celnici 8 Prague, 110 00 Czech Republic Tel: (+420 2) 2288 8888 Fax: (+420 2) 2288 8889 For a selection of hotels in the area see: http://www.unicode.org/iuc/iuc23/accommodation.html For travel information see: http://www.unicode.org/iuc/iuc23/travel.html CONFERENCE SPONSORS Agfa Monotype Corporation Basis Technology Corporation Microsoft Corporation Moravia IT Sun Microsystems, Inc. World Wide Web Consortium (W3C) CONFERENCE MANAGEMENT Global Meeting Services Inc. 8949 Lombard Place, #416 San Diego, CA 92122, USA Tel: +1 858 638 0206 (voice) +1 858 638 0504 (fax) Email: info@global-conference.com or: conference@unicode.org THE UNICODE CONSORTIUM The Unicode Consortium was founded as a non-profit organization in 1991. It is dedicated to the development, maintenance and promotion of The Unicode Standard, a worldwide character encoding. The Unicode Standard encodes the characters of the world's principal scripts and languages, and is code-for-code identical to the international standard ISO/IEC 10646. In addition to cooperating with ISO on the future development of ISO/IEC 10646, the Consortium is responsible for providing character properties and algorithms for use in implementations. Today the membership base of the Unicode Consortium includes major computer corporations, software producers, database vendors, research institutions, international agencies and various user groups. For further information on the Unicode Standard, visit the Unicode Web site at http://www.unicode.org or e-mail * * * * * Unicode(r) and the Unicode logo are registered trademarks of Unicode, Inc. Used with permission. From anmar@canada.com Wed Mar 26 05:20:42 2003 From: anmar@canada.com (Anmar Oueja) Date: Tue, 25 Mar 2003 21:20:42 -0800 Subject: [I18n-sig] gettext tutorial Message-ID: <3E8138AA.2020307@canada.com> Hello All: I am working on a web application (written in python of course) that will display a po file and allow people to translate these po files using this web app. I am looking for two things: - tuturial on how to use gettext module in python - how to translate one item using command line tools (no editing of the file) if it does exists. Thanks alot and thank you for making python appeal to non english spealers. Thank you kindly. Anmar From martin@v.loewis.de Wed Mar 26 06:54:18 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 26 Mar 2003 07:54:18 +0100 Subject: [I18n-sig] gettext tutorial In-Reply-To: <3E8138AA.2020307@canada.com> References: <3E8138AA.2020307@canada.com> Message-ID: Anmar Oueja writes: > - tuturial on how to use gettext module in python I recommend to read the GNU gettext manual. > - how to translate one item using command line tools (no editing of > the file) if it does exists. I'm not sure what kind of tool you are asking for (how exactly would you expect to invoke it), but I think no such tool exists. Regards, Martin From jiri@baum.com.au Wed Mar 26 08:48:50 2003 From: jiri@baum.com.au (Jiri Baum) Date: Wed, 26 Mar 2003 19:48:50 +1100 Subject: [I18n-sig] gettext tutorial In-Reply-To: References: <3E8138AA.2020307@canada.com> Message-ID: <20030326084850.GE4995@baum.com.au> Anmar: > > - tuturial on how to use gettext module in python Martin: > I recommend to read the GNU gettext manual. Obviously, that manual will make no mention of python-specific issues, for instance the manner in which the i18n should be packaged using setup.py Any suggestions on that issue, please? Jiri -- Jiri Baum http://www.csse.monash.edu.au/~jirib MAT LinuxPLC project --- http://mat.sf.net --- Machine Automation Tools From barry@python.org Wed Mar 26 17:16:30 2003 From: barry@python.org (Barry Warsaw) Date: 26 Mar 2003 12:16:30 -0500 Subject: [I18n-sig] [Fwd: Re: [Zope3-dev] i18n breaks Schema] Message-ID: <1048698990.10559.10.camel@geddy> --=-JCatIGaIzXwyPZLxpmlr Content-Type: text/plain Content-Transfer-Encoding: 7bit I thought people on this list might be interested in this. Stephan and I are going to try to address some of bugs with the gettext.py module on irc on Monday. I propose 10:30am EST, irc.freenode.net #zope3. If we want to move to a different channel once we get there, we can. -Barry --=-JCatIGaIzXwyPZLxpmlr Content-Disposition: inline Content-Description: Forwarded message - Re: [Zope3-dev] i18n breaks Schema Content-Type: message/rfc822 Return-Path: Delivered-To: barry@mail.wooz.org Received: from mail.python.org (mail.python.org [12.155.117.29]) by mail.wooz.org (Postfix) with ESMTP id 1AA411BF315 for ; Wed, 26 Mar 2003 11:00:17 -0500 (EST) Received: from localhost.localdomain ([127.0.0.1] helo=mail.python.org) by mail.python.org with esmtp (Exim 4.05) id 18yDJx-0000b8-00; Wed, 26 Mar 2003 11:00:09 -0500 Received: from andesite.usg.tufts.edu ([130.64.1.202]) by mail.python.org with esmtp (Exim 4.05) id 18yDIp-0000Tf-00; Wed, 26 Mar 2003 10:58:59 -0500 Received: from mr3.tufts.edu ([130.64.1.40]) by andesite.usg.tufts.edu with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.12) id 18yDIo-0006Yw-00; Wed, 26 Mar 2003 10:58:58 -0500 Received: from bohr.tufts.edu ([161.253.44.182]) (authenticated bits=0) by mr3.tufts.edu (8.12.1/8.12.1/USG-Auth) with ESMTP id h2QFwvUF010782 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT); Wed, 26 Mar 2003 10:58:57 -0500 (EST) From: Stephan Richter Reply-To: stephan.richter@tufts.edu Organization: Web2k To: Guido van Rossum Subject: Re: [Zope3-dev] i18n breaks Schema User-Agent: KMail/1.5.9 Cc: Gregoire Weber , zope3-dev@zope.org References: <5.1.0.14.2.20030326115453.01e08318@pop.gmx.net> <200303260642.37953.stephan.richter@tufts.edu> <200303261240.h2QCeV713137@pcp02138704pcs.reston01.va.comcast.net> In-Reply-To: <200303261240.h2QCeV713137@pcp02138704pcs.reston01.va.comcast.net> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Message-Id: <200303261055.43096.stephan.richter@tufts.edu> X-Scanner: exiscan for exim4 (http://duncanthrax.net/exiscan/) *18yDIo-0006Yw-00*FzE1FNlZc1s* X-Spam-Status: No, hits=-10.2 required=5.0 tests=BODY_PYTHON_ZOPE,IN_REP_TO,NOSPAM_INC,QUOTED_EMAIL_TEXT,REFERENCES,SIGNATURE_SHORT_DENSE,SPAM_PHRASE_00_01,SUBJ_PYTHON_ZOPE,USER_AGENT,USER_AGENT_KMAIL X-Spam-Level: Sender: zope3-dev-admin@zope.org Errors-To: zope3-dev-admin@zope.org X-BeenThere: zope3-dev@zope.org X-Mailman-Version: 2.0.13 (101270) Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Discuss development of and for Zope3 List-Unsubscribe: , List-Archive: Date: Wed, 26 Mar 2003 10:55:42 -0500 Content-Transfer-Encoding: 7bit On Wednesday 26 March 2003 07:40, Guido van Rossum wrote: > [Stephan] > > > Do you all get this error? Which version of Python are you using? It > > definitely worked for Jim yesterday. > > I don't get the error, but it sounds like Gregoire meant he has code > of his own that was broken. :-) Jim and I just spent an hour fixing it. It is definitely a gettext lib problem. Barry and I (and whoever wants to join us) are going to discuss this on Monday on IRC. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training _______________________________________________ Zope3-dev mailing list Zope3-dev@zope.org http://mail.zope.org/mailman/listinfo/zope3-dev --=-JCatIGaIzXwyPZLxpmlr-- From martin@v.loewis.de Wed Mar 26 19:08:07 2003 From: martin@v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) Date: 26 Mar 2003 20:08:07 +0100 Subject: [I18n-sig] gettext tutorial In-Reply-To: <20030326084850.GE4995@baum.com.au> References: <3E8138AA.2020307@canada.com> <20030326084850.GE4995@baum.com.au> Message-ID: Jiri Baum writes: > Obviously, that manual will make no mention of python-specific issues, > for instance the manner in which the i18n should be packaged using > setup.py > > Any suggestions on that issue, please? Sorry, no. This is neither documented, nor does it really work without significant efforts. Somebody should really make it work, and then document it. Regards, Martin From jim@ZOPE.COM Thu Mar 27 14:06:55 2003 From: jim@ZOPE.COM (Jim Fulton) Date: Thu, 27 Mar 2003 09:06:55 -0500 Subject: [I18n-sig] gettext tutorial In-Reply-To: <3E8138AA.2020307@canada.com> References: <3E8138AA.2020307@canada.com> Message-ID: <3E83057F.9020004@zope.com> FWIW, I think Stephan Richter has already written such an app for Zope. Jim Anmar Oueja wrote: > Hello All: > > I am working on a web application (written in python of course) that > will display a po file and allow people to translate these po files > using this web app. > > I am looking for two things: > > - tuturial on how to use gettext module in python > - how to translate one item using command line tools (no editing of the > file) if it does exists. > > Thanks alot and thank you for making python appeal to non english spealers. > > Thank you kindly. > > > Anmar > > > _______________________________________________ > I18n-sig mailing list > I18n-sig@python.org > http://mail.python.org/mailman/listinfo/i18n-sig -- Jim Fulton mailto:jim@zope.com Python Powered! CTO (703) 361-1714 http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org