Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 88378 invoked from network); 31 Aug 2006 10:48:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 31 Aug 2006 10:48:32 -0000 Received: (qmail 26279 invoked by uid 500); 31 Aug 2006 10:48:28 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 26239 invoked by uid 500); 31 Aug 2006 10:48:28 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 26228 invoked by uid 99); 31 Aug 2006 10:48:28 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Aug 2006 03:48:28 -0700 X-ASF-Spam-Status: No, hits=1.9 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 202.81.18.154 is neither permitted nor denied by domain of firepure@gmail.com) Received: from [202.81.18.154] (HELO ausmtp05.au.ibm.com) (202.81.18.154) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Aug 2006 03:48:27 -0700 Received: from sd0112e0.au.ibm.com (d23rh903.au.ibm.com [202.81.18.201]) by ausmtp05.au.ibm.com (8.13.6/8.13.6) with ESMTP id k7VAoY3U8917114 for ; Thu, 31 Aug 2006 20:50:34 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.250.237]) by sd0112e0.au.ibm.com (8.13.6/8.13.6/NCO v8.1.1) with ESMTP id k7VApOdn223374 for ; Thu, 31 Aug 2006 20:51:26 +1000 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id k7VAkbb3024282 for ; Thu, 31 Aug 2006 20:46:37 +1000 Received: from d23m0011.cn.ibm.com (d23m0011.cn.ibm.com [9.181.32.74]) by d23av04.au.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k7VAkaHM024166 for ; Thu, 31 Aug 2006 20:46:37 +1000 Received: from [9.181.107.166] ([9.181.107.166]) by d23m0011.cn.ibm.com (Lotus Domino Release 6.5.5HF262) with ESMTP id 2006083118341718-5819 ; Thu, 31 Aug 2006 18:34:17 +0800 Message-ID: <44F6BB2F.9090606@gmail.com> Date: Thu, 31 Aug 2006 18:34:23 +0800 From: "Jimmy, Jing Lv" User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: harmony-dev@incubator.apache.org Subject: Re: [classlib]strings externalization References: <44DB2AB1.3060601@gmail.com> <44DC50DF.7080505@gmail.com> <44F3A5BD.6030109@gmail.com> <44F4ED2E.7090403@gmail.com> In-Reply-To: X-MIMETrack: Itemize by SMTP Server on D23M0011/23/M/IBM(Release 6.5.5HF262 | April 5, 2006) at 31/08/2006 18:34:17, Serialize by Router on D23M0011/23/M/IBM(Release 6.5.5HF262 | April 5, 2006) at 31/08/2006 18:46:36, Serialize complete at 31/08/2006 18:46:36 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Ilya Okomin wrote: > Hi, Jimmy! > > It's great that you are interested in it! > Unfortunately there is no automatic externalization generation tool that > fits our needs. However, you can combine Eclipse externalization tool with > some manual work to get what is need. You can take a look into the > [classlib]strings externalization thread [1] for details. Main points > briefly: > 1. Using Eclipse externalization tool you can extract all strings from the > sources. When you process certain source file strings that used for > messages > should be externalized, others should be ignored (as a result, Eclipse mark > them with non-nls tag). > 2. Eclipse tool by default suggests you to use keep messages from each > class > in the separate messages.properties file, and keys in the properties file > will looks like .. We've decided to have one messages list > for each module with keys . (in your case == > instrument > :)). Thus at first you should change common prefix to ".". Next > step > is to configure "Accessor class" field: choose the proper package for > Messages class and messages.properties file("org.apache.harmony > ..msgstool"). > > What is to take care of: > 1. Continuation of the numeration of messages. For every new source file > you > process Eclipse tool will reset enumeration, and you should manually set > the > appropriate number for messages. Also it would be better if you avoid > messages duplication in the list. (Pretty annoying if you have many > messages > in the module and some of them are duplicated) > 2. Messages formatting. If you have message located on the several source > code lines - you should concatenate them into one message string and use > one > Messages.getString(..) call. Also messages with arguments are supposed > to be > converted to strings with places for substitution by parameters being > arguments in Messages.getString() method. E.g. code: > > int param; > ... > NullPointerException("foo " + param + " bar"); > > supposed to be formatted as > > NullPointerException(Messages.getString(".1", param)); > > where ".1=foo {0} bar" in the resource bundle. > > I hope now the process is clear. > You can find examples of internationalized messages in the [sql] module. > > As for messages in native code, actually I dealt only with java code. > You may find something interesting for you from the "[drlvm] proposals for > VM c" thread [2]. > > Regards, > Ilya. > > [1] > http://mail-archives.apache.org/mod_mbox/incubator-harmony-dev/200607.mbox/%3cc79906b30607270353y4dfdb16bw92bc48fed76cb1c0@mail.gmail.com%3e > > [2] > http://mail-archives.apache.org/mod_mbox/incubator-harmony-dev/200607.mbox/%3c23951bd90607122308i721c9c6xfcfe786f9d1e26de@mail.gmail.com%3e > > Thanks Ilya, I'll apply patch soon. I deal with Java code only this time, it is simple that I only find 3 strings :) I'll put them in messages.properties under instrument with name "instrument.1(2,3)" and update codes. Instrument also have an console output string, I suggest also put it to property file so it can be internationalization as well. Then there are 4 total. And strings in native code may be refactored if we have conclusion of native internationalization. -- Best Regards! Jimmy, Jing Lv China Software Development Lab, IBM --------------------------------------------------------------------- Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org For additional commands, e-mail: harmony-dev-help@incubator.apache.org