harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ilya Okomin" <ilya.oko...@gmail.com>
Subject Re: [classlib]strings externalization
Date Wed, 30 Aug 2006 07:23:48 GMT
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 <class_name>.<id>. We've decided to have one messages list
for each module with keys <module>.<id> (in your case <module> == instrument
:)). Thus at first you should change common prefix to "<module>.". Next step
is to configure "Accessor class" field: choose the proper package for
Messages class and messages.properties file("org.apache.harmony
.<module>.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("<module>.1", param));

where "<module>.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 internationalization" 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

On 8/30/06, Jimmy, Jing Lv <firepure@gmail.com> wrote:
>
> Ilya Okomin wrote:
> > Tim, great news for me.
> >
> > Everything looks fine with the patch you've applied, now it's time for
> the
> > main part of the task.
> > I've created HARMONY-1308 issue with task description. This issue is
> > devided
> > into a set of  sub-issues for each module. I'm going to process them one
> by
> > one. These issues can be processed in a parallel way, so everyone is
> > welcomed to take part in the internationalization process :)
> >
> >
>
> Hi,
>
>     Ilya, I'd like to process instrument :) Can you tell me something
> about the generation tool, or how can we process these strings? Is there
> anything to take care of?
>     And in fact, in java.lang.instrument, there are some error messages
> in native code(AFAIK, there are also many in luni). Is there any tool to
> find them out automatic ?
>
>
> > Thanks,
> > Ilya.
> >
> > On 8/29/06, Tim Ellison <t.p.ellison@gmail.com> wrote:
> >>
> >> Thanks for waiting Ilya, I've applied the final patch on HARMONY-1201
> >> (I'll check-in the tool when I get back from vacation).  So now we can
> >> get to work on breaking out the messages into each component's message
> >> file.
> >>
> >> Regards,
> >> Tim
> >>
> >> Ilya Okomin wrote:
> >> > On 8/11/06, Tim Ellison <t.p.ellison@gmail.com > wrote:
> >> >>
> >> >> I took a look at the HARMONY-1041 tool.  It is fine, I have only
> minor
> >> >> comments:
> >> >>
> >> >> - do you think we need to separate the Message and MsgUtil types?
> >> >> Given that they are generated from a template I'd be inclined to
> >> combine
> >> >> them into a single type now.  We have no need to look in that file
> in
> >> >> general.  If you do choose to combine them then I would expect the
> >> >> resulting header to be (c) 1998, 2006.
> >> >>
> >> >> - Minor typo "Better make changes in the teamplate file." ->
> template.
> >> >>
> >> >> Ilya Okomin wrote:
> >> >> > I would suggest to split this task into a set of jira sub-issues,
> >> one
> >>
> >> >> > module - one issue. This kind of division would give us an
> >> >> > opportunity this work to be done in a parallel mode.
> >> >>
> >> >> Agreed.  I suggest that we run the msgtool on the existing modules
> and
> >> >> commit the generated code and catalog files, then the incoming
> patches
> >> >> can assume they are there and use them to fix the externalization.
> >> >
> >> >
> >> > Hello, Tim!
> >> >
> >> > I've made changes to the generation tool [1] and also prepared patch
> >> with
> >> > the set of generated files according to the existing modules set I've
> >> > raised
> >> > issue for that [2]. Not all modules were included into the generation
> >> (full
> >> > set can be found in comments to the [2]). E.g. x-net module has
> package
> >> > xnet, also I'm not sure about necessity to make internationalization
> in
> >> > suncompat or rmi2, etc. You can check list of suggested modules and
> if
> >> > something is missed I'll make update.
> >> > Waiting for your comments and proposals!
> >> >
> >> > [1]http://issues.apache.org/jira/browse/HARMONY-1041
> >> > [2]http://issues.apache.org/jira/browse/HARMONY-1201
> >> >
> >> > Regards,
> >> > Ilya.
> >> >
> >> >
> >> > Regards,
> >> >> Tim
> >> >>
> >> >> --
> >> >>
> >> >> Tim Ellison (t.p.ellison@gmail.com )
> >> >> IBM Java technology centre, UK.
> >> >>
> >> >>
> ---------------------------------------------------------------------
> >> >> 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
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >>
> >> Tim Ellison ( t.p.ellison@gmail.com)
> >> IBM Java technology centre, UK.
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >>
> >>
> >
> >
>
>
> --
>
> 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
>
>


-- 
--
Ilya Okomin
Intel Middleware Products Division

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message