You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Ilya Okomin <il...@gmail.com> on 2006/08/02 10:45:08 UTC

Re: [classlib]strings externalization

On 7/27/06, Tim Ellison <t....@gmail.com> wrote:

> Ilya Okomin wrote:
> > I share your point of view about Exceptions without description, it
> > isn't user friendly. But I think it will be another sort of 'manual'
> > scan :) There is a need to waste time to analyze surrounding code to
> > provide appropriate message, a bit another sort of work, isn't it? I
> > think the best way would be if all these Exceptions without info are
> > being identified before externalization process is to be ran. For
> > today I'd better postpone the task of initialization 'empty'
> > exceptions until the externalization is finished.
>
> Sure, I agree that it is a different problem, so have no problem dealing
> with it separately.
>
> > I've implemented a small tool that generates Message source and
> > MsgHelp source into a desired module. Tool gets a list of modules
> > names from property file (you can specify modules class sources to
> > generate for), then we run over the list and special word '<module>'
> > in Message and MsgHelp source templates files replaced with the
> > specified module name.
>
> Cool.  You may find it easy to do this using Ant's replace task [1].
>
> [1] http://ant.apache.org/manual/CoreTasks/replace.html
>
> > Resulting sources are copied to the o/a/h/<module>/internal/
> > directory. At first I planned to use MsgHelp class from luni but
> > after a while I've decided to avoid dependency on luni module and
> > included generation source file of this class to every module.
>
> I agree, if you are going to do the template then you might as well
> duplicate the MsgHelp behavior across the modules.  In fact, don't feel
> obliged to maintain the separation of Message and MsgHelp, you may find
> that it makes sense to combine them now.  Your choice.
>
> > Thus Message or MsgHelp source files can be easy regenerated for a
> > desired set of modules, if anything is changed there. I plan to add
> > creation of a new empty messages.properties files with copyright
> > heading if it is absent for the module.
>
> Extra credit for that ;-)
>
> > Also I think that it make sense to changle location to
> > o/a/h/<module>/internal/nls.
>
> Agreed.
>
> > Will provide patch with this tool when these changes are to be
> > implemented and checked.
>
> I'll look forward to seeing it.  Thanks Ilya!


Several times I was trying to make a post with attached zip-file with the
tool, but unfortunately this letter was rejected as it is spam!!:( I wonder
why?!

Nevertheless, I've created a jira issue [1] with suggested implementation of
the tool for generation classes to support internationalization.

 I'd like to notice that all template files are stored in the
msgstool.jarfile that is the result of ant build. For this reason this
tool will work
only if msgstool.jar file is in the user dir. I have to extract resources
from the jar file (open jar file) and don't know how to do this if jar file
is mentioned in the classpath and isn't located in the user dir. It would be
great if someone knew how to deal with this issue...

Tim, could you look into this tool, is it what we need?
If it's ok, I would start with messages externalization task for modules.

[1]https://issues.apache.org/jira/browse/HARMONY-1041

BR,
Ilya.



>
> Regards,
> Tim
>
>
> ---------------------------------------------------------------------
> 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

Re: [classlib]strings externalization

Posted by Ilya Okomin <il...@gmail.com>.
On 8/31/06, Jimmy, Jing Lv <fi...@gmail.com> wrote:
>
> 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 <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 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.


You are lucky, some modules have more then 50 different messages to
internationalize:)
I've already uploaded patches for several modules (e.g. auch, archive) you
can take a look for examples there.
If you've finished with instrument you can update HARMONY-1333 issue.
 You are right about console output string, it is also "a message".
One note, if there is not so many messages in your module - it would be
great to have comments with message key and it's value before
Messages.getString() call. It will be usefull to have this info right in the
source code not to spend time looking for it in the messages.propertiesfile. (
e.g. it is done in sql module)

Regards,
Ilya.

<snip>
>
>
> --
>
> 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

Re: [classlib]strings externalization

Posted by "Jimmy, Jing Lv" <fi...@gmail.com>.
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 <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 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.


<snip>


-- 

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


Re: [classlib]strings externalization

Posted by Ilya Okomin <il...@gmail.com>.
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 <fi...@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....@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

Re: [classlib]strings externalization

Posted by "Jimmy, Jing Lv" <fi...@gmail.com>.
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....@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


Re: [classlib]strings externalization

Posted by Ilya Okomin <il...@gmail.com>.
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 :)


Thanks,
Ilya.

On 8/29/06, Tim Ellison <t....@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
>
>


-- 
--
Ilya Okomin
Intel Middleware Products Division

Re: [classlib]strings externalization

Posted by Tim Ellison <t....@gmail.com>.
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....@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


Re: [classlib]strings externalization

Posted by Ilya Okomin <il...@gmail.com>.
On 8/11/06, Tim Ellison <t....@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
>
>


-- 
--
Ilya Okomin
Intel Middleware Products Division

Re: [classlib]strings externalization

Posted by Tim Ellison <t....@gmail.com>.
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.

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


Re: [classlib]strings externalization

Posted by Ilya Okomin <il...@gmail.com>.
On 8/10/06, Tim Ellison <t....@gmail.com> wrote:
>
> Ilya Okomin wrote:
> > Hi to all!
> >
> > Today I've started the next step of internationalization - to
> externalize
> > messages using Eclipse externalization tool. Right away I was confronted
> > with some questions to discuss:
> >
> > First of all, what should we do with strings that are not supposed to
> > be internationalized (constants, initiated variables..)? Should we
> > mark them " //$NON-NLS-%id%$" comment (Eclipse tool skip such strings
> > during externalization process)? IMHO there is a sence to do this,
> > marked strings will not be taken into account next time
> > externalization revision is required. Objections?
>
> No objection -- good idea.  Reduces ECJ compiler warnings.
>
> > Next point, there is a lot of manual work during messages processing
> > (unite messages that are on the several lines of the source code,
> > change messages with params to the proper formatted messages). When
> > doing this work there are changes in source code and
> > messages.properties files are made.
>
> Yep, but we can work through them a module at a time or parallel-ise the
> work depending on how much help we get.  It is a good opportunity for
> people to contribute to Harmony.


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.

> As it is manual work - some mistakes could be done, non-critical:
> > usually wrong message if getString() takes wrong key as a parameter.
> > Is there supposed a verification that everything is done well? May be
> > any test cases (at the moment I have no idea how these test cases may
> >  look) or another revision? Probably the better strategy is to wait
> > if someone who face with wrong message will inform about that:)
> > Thoughts?
>
> We don't have any tests that would catch this at the moment.  So unless
> there are any ideas we have to rely on steady working and peer reviews
> of the patches and commits.  As you point out we would expect it to be
> noticeable at the point the message is displayed if it were incorrect.


The easiest way;-) I'm sure, there will be not so many such exceptional
cases.

> And the last one point. I think the process of internationalization
> support
> > must be up-to-date, for this reason after adding new contributions all
> > messages there are to be internationalized. Probably there is a sence to
> > make rule to do this routinely after contribution is applied (or even
> > before, people who are going to make contribution should be acquainted
> with
> > internationalization in Harmony to use it in their development process).
>
> Yes, once you have figured out the APIs and a couple of examples it
> would be good to add it as a document to the coding practices.  I'm not
> sure I would reject a patch for non-compliance, but the compiler
> warnings will remind us to go in and fix it.


I'll prepare useful exapmles to support chosen way to internationalize
messages.

Tim, thank you for comments, no it is clear what to do next.

Regards,
Ilya.

> Waiting for comments and suggestions!
>
> Sorry they were so late!
>
> Regards,
> Tim
>
>
> > On 8/2/06, Ilya Okomin <il...@gmail.com> wrote:
> >>
> >>
> >>
> >> On 7/27/06, Tim Ellison <t....@gmail.com> wrote:
> >>
> >> > Ilya Okomin wrote:
> >> > > I share your point of view about Exceptions without description, it
> >> > > isn't user friendly. But I think it will be another sort of
> 'manual'
> >> > > scan :) There is a need to waste time to analyze surrounding code
> to
> >> > > provide appropriate message, a bit another sort of work, isn't it?
> I
> >> > > think the best way would be if all these Exceptions without info
> are
> >> > > being identified before externalization process is to be ran. For
> >> > > today I'd better postpone the task of initialization 'empty'
> >> > > exceptions until the externalization is finished.
> >> >
> >> > Sure, I agree that it is a different problem, so have no problem
> >> dealing
> >> >
> >> > with it separately.
> >> >
> >> > > I've implemented a small tool that generates Message source and
> >> > > MsgHelp source into a desired module. Tool gets a list of modules
> >> > > names from property file (you can specify modules class sources to
> >> > > generate for), then we run over the list and special word
> '<module>'
> >> > > in Message and MsgHelp source templates files replaced with the
> >> > > specified module name.
> >> >
> >> > Cool.  You may find it easy to do this using Ant's replace task [1].
> >> >
> >> > [1] http://ant.apache.org/manual/CoreTasks/replace.html
> >> >
> >> > > Resulting sources are copied to the o/a/h/<module>/internal/
> >> > > directory. At first I planned to use MsgHelp class from luni but
> >> > > after a while I've decided to avoid dependency on luni module and
> >> > > included generation source file of this class to every module.
> >> >
> >> > I agree, if you are going to do the template then you might as well
> >> > duplicate the MsgHelp behavior across the modules.  In fact, don't
> feel
> >> > obliged to maintain the separation of Message and MsgHelp, you may
> find
> >> > that it makes sense to combine them now.  Your choice.
> >> >
> >> > > Thus Message or MsgHelp source files can be easy regenerated for a
> >> > > desired set of modules, if anything is changed there. I plan to add
> >> > > creation of a new empty messages.properties files with copyright
> >> > > heading if it is absent for the module.
> >> >
> >> > Extra credit for that ;-)
> >> >
> >> > > Also I think that it make sense to changle location to
> >> > > o/a/h/<module>/internal/nls.
> >> >
> >> > Agreed.
> >> >
> >> > > Will provide patch with this tool when these changes are to be
> >> > > implemented and checked.
> >> >
> >> > I'll look forward to seeing it.  Thanks Ilya!
> >>
> >>
> >>  Several times I was trying to make a post with attached zip-file with
> >> the
> >> tool, but unfortunately this letter was rejected as it is spam!!:( I
> >> wonder why?!
> >>
> >> Nevertheless, I've created a jira issue [1] with suggested
> implementation
> >> of the tool for generation classes to support internationalization.
> >>
> >>  I'd like to notice that all template files are stored in the
> >> msgstool.jarfile that is the result of ant build. For this reason this
> >> tool will work
> >> only if msgstool.jar file is in the user dir. I have to extract
> resources
> >> from the jar file (open jar file) and don't know how to do this if jar
> >> file
> >> is mentioned in the classpath and isn't located in the user dir. It
> >> would be
> >> great if someone knew how to deal with this issue...
> >>
> >> Tim, could you look into this tool, is it what we need?
> >> If it's ok, I would start with messages externalization task for
> modules.
> >>
> >>  [1]https://issues.apache.org/jira/browse/HARMONY-1041
> >>
> >> BR,
> >>  Ilya.
> >>
> >>
> >>
> >> >
> >> > Regards,
> >> > Tim
> >> >
> >> >
> >> > ---------------------------------------------------------------------
> >> > 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
> >>
> >
> >
> >
>
> --
>
> 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
>
>


-- 
--
Ilya Okomin
Intel Middleware Products Division

Re: [classlib]strings externalization

Posted by Tim Ellison <t....@gmail.com>.
Ilya Okomin wrote:
> Hi to all!
> 
> Today I've started the next step of internationalization - to externalize
> messages using Eclipse externalization tool. Right away I was confronted
> with some questions to discuss:
> 
> First of all, what should we do with strings that are not supposed to
> be internationalized (constants, initiated variables..)? Should we
> mark them " //$NON-NLS-%id%$" comment (Eclipse tool skip such strings
> during externalization process)? IMHO there is a sence to do this,
> marked strings will not be taken into account next time
> externalization revision is required. Objections?

No objection -- good idea.  Reduces ECJ compiler warnings.

> Next point, there is a lot of manual work during messages processing 
> (unite messages that are on the several lines of the source code,
> change messages with params to the proper formatted messages). When
> doing this work there are changes in source code and
> messages.properties files are made.

Yep, but we can work through them a module at a time or parallel-ise the
work depending on how much help we get.  It is a good opportunity for
people to contribute to Harmony.

> As it is manual work - some mistakes could be done, non-critical:
> usually wrong message if getString() takes wrong key as a parameter.
> Is there supposed a verification that everything is done well? May be
> any test cases (at the moment I have no idea how these test cases may
>  look) or another revision? Probably the better strategy is to wait
> if someone who face with wrong message will inform about that:)
> Thoughts?

We don't have any tests that would catch this at the moment.  So unless
there are any ideas we have to rely on steady working and peer reviews
of the patches and commits.  As you point out we would expect it to be
noticeable at the point the message is displayed if it were incorrect.

> And the last one point. I think the process of internationalization support
> must be up-to-date, for this reason after adding new contributions all
> messages there are to be internationalized. Probably there is a sence to
> make rule to do this routinely after contribution is applied (or even
> before, people who are going to make contribution should be acquainted with
> internationalization in Harmony to use it in their development process).

Yes, once you have figured out the APIs and a couple of examples it
would be good to add it as a document to the coding practices.  I'm not
sure I would reject a patch for non-compliance, but the compiler
warnings will remind us to go in and fix it.

> Waiting for comments and suggestions!

Sorry they were so late!

Regards,
Tim


> On 8/2/06, Ilya Okomin <il...@gmail.com> wrote:
>>
>>
>>
>> On 7/27/06, Tim Ellison <t....@gmail.com> wrote:
>>
>> > Ilya Okomin wrote:
>> > > I share your point of view about Exceptions without description, it
>> > > isn't user friendly. But I think it will be another sort of 'manual'
>> > > scan :) There is a need to waste time to analyze surrounding code to
>> > > provide appropriate message, a bit another sort of work, isn't it? I
>> > > think the best way would be if all these Exceptions without info are
>> > > being identified before externalization process is to be ran. For
>> > > today I'd better postpone the task of initialization 'empty'
>> > > exceptions until the externalization is finished.
>> >
>> > Sure, I agree that it is a different problem, so have no problem
>> dealing
>> >
>> > with it separately.
>> >
>> > > I've implemented a small tool that generates Message source and
>> > > MsgHelp source into a desired module. Tool gets a list of modules
>> > > names from property file (you can specify modules class sources to
>> > > generate for), then we run over the list and special word '<module>'
>> > > in Message and MsgHelp source templates files replaced with the
>> > > specified module name.
>> >
>> > Cool.  You may find it easy to do this using Ant's replace task [1].
>> >
>> > [1] http://ant.apache.org/manual/CoreTasks/replace.html
>> >
>> > > Resulting sources are copied to the o/a/h/<module>/internal/
>> > > directory. At first I planned to use MsgHelp class from luni but
>> > > after a while I've decided to avoid dependency on luni module and
>> > > included generation source file of this class to every module.
>> >
>> > I agree, if you are going to do the template then you might as well
>> > duplicate the MsgHelp behavior across the modules.  In fact, don't feel
>> > obliged to maintain the separation of Message and MsgHelp, you may find
>> > that it makes sense to combine them now.  Your choice.
>> >
>> > > Thus Message or MsgHelp source files can be easy regenerated for a
>> > > desired set of modules, if anything is changed there. I plan to add
>> > > creation of a new empty messages.properties files with copyright
>> > > heading if it is absent for the module.
>> >
>> > Extra credit for that ;-)
>> >
>> > > Also I think that it make sense to changle location to
>> > > o/a/h/<module>/internal/nls.
>> >
>> > Agreed.
>> >
>> > > Will provide patch with this tool when these changes are to be
>> > > implemented and checked.
>> >
>> > I'll look forward to seeing it.  Thanks Ilya!
>>
>>
>>  Several times I was trying to make a post with attached zip-file with
>> the
>> tool, but unfortunately this letter was rejected as it is spam!!:( I
>> wonder why?!
>>
>> Nevertheless, I've created a jira issue [1] with suggested implementation
>> of the tool for generation classes to support internationalization.
>>
>>  I'd like to notice that all template files are stored in the
>> msgstool.jarfile that is the result of ant build. For this reason this
>> tool will work
>> only if msgstool.jar file is in the user dir. I have to extract resources
>> from the jar file (open jar file) and don't know how to do this if jar
>> file
>> is mentioned in the classpath and isn't located in the user dir. It
>> would be
>> great if someone knew how to deal with this issue...
>>
>> Tim, could you look into this tool, is it what we need?
>> If it's ok, I would start with messages externalization task for modules.
>>
>>  [1]https://issues.apache.org/jira/browse/HARMONY-1041
>>
>> BR,
>>  Ilya.
>>
>>
>>
>> >
>> > Regards,
>> > Tim
>> >
>> >
>> > ---------------------------------------------------------------------
>> > 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
>>
> 
> 
> 

-- 

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


Re: [classlib]strings externalization

Posted by Ilya Okomin <il...@gmail.com>.
Hi to all!

Today I've started the next step of internationalization - to externalize
messages using Eclipse externalization tool. Right away I was confronted
with some questions to discuss:

First of all, what should we do with strings that are not supposed to be
internationalized (constants, initiated variables..)? Should we mark them
" //$NON-NLS-%id%$" comment (Eclipse tool skip such strings during
externalization process)? IMHO there is a sence to do this, marked
strings will not be taken into account next time externalization revision is
required. Objections?

Next point, there is a lot of manual work during messages processing  (unite
messages that are on the several lines of the source code, change messages
with params to the proper formatted messages). When doing this work there
are changes in source code and messages.properties files are made.
As it is manual work - some mistakes could be done, non-critical: usually
wrong message if getString() takes wrong key as a parameter. Is there
supposed a verification that everything is done well?
May be any test cases (at the moment I have no idea how these test cases may
look) or another revision?
Probably the better strategy is to wait if someone who face with wrong
message will inform about that:) Thoughts?

And the last one point. I think the process of internationalization support
must be up-to-date, for this reason after adding new contributions all
messages there are to be internationalized. Probably there is a sence to
make rule to do this routinely after contribution is applied (or even
before, people who are going to make contribution should be acquainted with
internationalization in Harmony to use it in their development process).

Waiting for comments and suggestions!

Thanks,
Ilya.

On 8/2/06, Ilya Okomin <il...@gmail.com> wrote:
>
>
>
> On 7/27/06, Tim Ellison <t....@gmail.com> wrote:
>
> > Ilya Okomin wrote:
> > > I share your point of view about Exceptions without description, it
> > > isn't user friendly. But I think it will be another sort of 'manual'
> > > scan :) There is a need to waste time to analyze surrounding code to
> > > provide appropriate message, a bit another sort of work, isn't it? I
> > > think the best way would be if all these Exceptions without info are
> > > being identified before externalization process is to be ran. For
> > > today I'd better postpone the task of initialization 'empty'
> > > exceptions until the externalization is finished.
> >
> > Sure, I agree that it is a different problem, so have no problem dealing
> >
> > with it separately.
> >
> > > I've implemented a small tool that generates Message source and
> > > MsgHelp source into a desired module. Tool gets a list of modules
> > > names from property file (you can specify modules class sources to
> > > generate for), then we run over the list and special word '<module>'
> > > in Message and MsgHelp source templates files replaced with the
> > > specified module name.
> >
> > Cool.  You may find it easy to do this using Ant's replace task [1].
> >
> > [1] http://ant.apache.org/manual/CoreTasks/replace.html
> >
> > > Resulting sources are copied to the o/a/h/<module>/internal/
> > > directory. At first I planned to use MsgHelp class from luni but
> > > after a while I've decided to avoid dependency on luni module and
> > > included generation source file of this class to every module.
> >
> > I agree, if you are going to do the template then you might as well
> > duplicate the MsgHelp behavior across the modules.  In fact, don't feel
> > obliged to maintain the separation of Message and MsgHelp, you may find
> > that it makes sense to combine them now.  Your choice.
> >
> > > Thus Message or MsgHelp source files can be easy regenerated for a
> > > desired set of modules, if anything is changed there. I plan to add
> > > creation of a new empty messages.properties files with copyright
> > > heading if it is absent for the module.
> >
> > Extra credit for that ;-)
> >
> > > Also I think that it make sense to changle location to
> > > o/a/h/<module>/internal/nls.
> >
> > Agreed.
> >
> > > Will provide patch with this tool when these changes are to be
> > > implemented and checked.
> >
> > I'll look forward to seeing it.  Thanks Ilya!
>
>
>  Several times I was trying to make a post with attached zip-file with the
> tool, but unfortunately this letter was rejected as it is spam!!:( I
> wonder why?!
>
> Nevertheless, I've created a jira issue [1] with suggested implementation
> of the tool for generation classes to support internationalization.
>
>  I'd like to notice that all template files are stored in the msgstool.jarfile that is the result of ant build. For this reason this tool will work
> only if msgstool.jar file is in the user dir. I have to extract resources
> from the jar file (open jar file) and don't know how to do this if jar file
> is mentioned in the classpath and isn't located in the user dir. It would be
> great if someone knew how to deal with this issue...
>
> Tim, could you look into this tool, is it what we need?
> If it's ok, I would start with messages externalization task for modules.
>
>  [1]https://issues.apache.org/jira/browse/HARMONY-1041
>
> BR,
>  Ilya.
>
>
>
> >
> > Regards,
> > Tim
> >
> >
> > ---------------------------------------------------------------------
> > 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
>



-- 
--
Ilya Okomin
Intel Middleware Products Division

Re: [classlib]strings externalization

Posted by Ilya Okomin <il...@gmail.com>.
On 8/2/06, Alexei Zakharov <al...@gmail.com> wrote:
>
> Hi Ilya,
>
> >  I'd like to notice that all template files are stored in the
> > msgstool.jarfile that is the result of ant build. For this reason this
> > tool will work
> > only if msgstool.jar file is in the user dir. I have to extract
> resources
> > from the jar file (open jar file) and don't know how to do this if jar
> file
> > is mentioned in the classpath and isn't located in the user dir. It
> would be
> > great if someone knew how to deal with this issue...
>
> I've looked into your code. You may probably benefit from using
> MsgClassGenerator.class.getClassLoader().getResourceAsStream(...).
> Have you tried this?


Suggested sample works, thanks for advice Alexei!! One more issue is
resolved :)

Thanks, Ilya.

Regards,
>
> 2006/8/2, Ilya Okomin <il...@gmail.com>:
> > On 7/27/06, Tim Ellison <t....@gmail.com> wrote:
> >
> > > Ilya Okomin wrote:
> > > > I share your point of view about Exceptions without description, it
> > > > isn't user friendly. But I think it will be another sort of 'manual'
> > > > scan :) There is a need to waste time to analyze surrounding code to
> > > > provide appropriate message, a bit another sort of work, isn't it? I
> > > > think the best way would be if all these Exceptions without info are
> > > > being identified before externalization process is to be ran. For
> > > > today I'd better postpone the task of initialization 'empty'
> > > > exceptions until the externalization is finished.
> > >
> > > Sure, I agree that it is a different problem, so have no problem
> dealing
> > > with it separately.
> > >
> > > > I've implemented a small tool that generates Message source and
> > > > MsgHelp source into a desired module. Tool gets a list of modules
> > > > names from property file (you can specify modules class sources to
> > > > generate for), then we run over the list and special word '<module>'
> > > > in Message and MsgHelp source templates files replaced with the
> > > > specified module name.
> > >
> > > Cool.  You may find it easy to do this using Ant's replace task [1].
> > >
> > > [1] http://ant.apache.org/manual/CoreTasks/replace.html
> > >
> > > > Resulting sources are copied to the o/a/h/<module>/internal/
> > > > directory. At first I planned to use MsgHelp class from luni but
> > > > after a while I've decided to avoid dependency on luni module and
> > > > included generation source file of this class to every module.
> > >
> > > I agree, if you are going to do the template then you might as well
> > > duplicate the MsgHelp behavior across the modules.  In fact, don't
> feel
> > > obliged to maintain the separation of Message and MsgHelp, you may
> find
> > > that it makes sense to combine them now.  Your choice.
> > >
> > > > Thus Message or MsgHelp source files can be easy regenerated for a
> > > > desired set of modules, if anything is changed there. I plan to add
> > > > creation of a new empty messages.properties files with copyright
> > > > heading if it is absent for the module.
> > >
> > > Extra credit for that ;-)
> > >
> > > > Also I think that it make sense to changle location to
> > > > o/a/h/<module>/internal/nls.
> > >
> > > Agreed.
> > >
> > > > Will provide patch with this tool when these changes are to be
> > > > implemented and checked.
> > >
> > > I'll look forward to seeing it.  Thanks Ilya!
> >
> >
> > Several times I was trying to make a post with attached zip-file with
> the
> > tool, but unfortunately this letter was rejected as it is spam!!:( I
> wonder
> > why?!
> >
> > Nevertheless, I've created a jira issue [1] with suggested
> implementation of
> > the tool for generation classes to support internationalization.
> >
> >  I'd like to notice that all template files are stored in the
> > msgstool.jarfile that is the result of ant build. For this reason this
> > tool will work
> > only if msgstool.jar file is in the user dir. I have to extract
> resources
> > from the jar file (open jar file) and don't know how to do this if jar
> file
> > is mentioned in the classpath and isn't located in the user dir. It
> would be
> > great if someone knew how to deal with this issue...
> >
> > Tim, could you look into this tool, is it what we need?
> > If it's ok, I would start with messages externalization task for
> modules.
> >
> > [1]https://issues.apache.org/jira/browse/HARMONY-1041
> >
> > BR,
> > Ilya.
> >
> >
> >
> > >
> > > Regards,
> > > Tim
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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
> >
> >
>
>
> --
> Alexei Zakharov,
> Intel Middleware Product Division
>
> ---------------------------------------------------------------------
> 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

Re: [classlib]strings externalization

Posted by Alexei Zakharov <al...@gmail.com>.
Hi Ilya,

>  I'd like to notice that all template files are stored in the
> msgstool.jarfile that is the result of ant build. For this reason this
> tool will work
> only if msgstool.jar file is in the user dir. I have to extract resources
> from the jar file (open jar file) and don't know how to do this if jar file
> is mentioned in the classpath and isn't located in the user dir. It would be
> great if someone knew how to deal with this issue...

I've looked into your code. You may probably benefit from using
MsgClassGenerator.class.getClassLoader().getResourceAsStream(...).
Have you tried this?


Regards,

2006/8/2, Ilya Okomin <il...@gmail.com>:
> On 7/27/06, Tim Ellison <t....@gmail.com> wrote:
>
> > Ilya Okomin wrote:
> > > I share your point of view about Exceptions without description, it
> > > isn't user friendly. But I think it will be another sort of 'manual'
> > > scan :) There is a need to waste time to analyze surrounding code to
> > > provide appropriate message, a bit another sort of work, isn't it? I
> > > think the best way would be if all these Exceptions without info are
> > > being identified before externalization process is to be ran. For
> > > today I'd better postpone the task of initialization 'empty'
> > > exceptions until the externalization is finished.
> >
> > Sure, I agree that it is a different problem, so have no problem dealing
> > with it separately.
> >
> > > I've implemented a small tool that generates Message source and
> > > MsgHelp source into a desired module. Tool gets a list of modules
> > > names from property file (you can specify modules class sources to
> > > generate for), then we run over the list and special word '<module>'
> > > in Message and MsgHelp source templates files replaced with the
> > > specified module name.
> >
> > Cool.  You may find it easy to do this using Ant's replace task [1].
> >
> > [1] http://ant.apache.org/manual/CoreTasks/replace.html
> >
> > > Resulting sources are copied to the o/a/h/<module>/internal/
> > > directory. At first I planned to use MsgHelp class from luni but
> > > after a while I've decided to avoid dependency on luni module and
> > > included generation source file of this class to every module.
> >
> > I agree, if you are going to do the template then you might as well
> > duplicate the MsgHelp behavior across the modules.  In fact, don't feel
> > obliged to maintain the separation of Message and MsgHelp, you may find
> > that it makes sense to combine them now.  Your choice.
> >
> > > Thus Message or MsgHelp source files can be easy regenerated for a
> > > desired set of modules, if anything is changed there. I plan to add
> > > creation of a new empty messages.properties files with copyright
> > > heading if it is absent for the module.
> >
> > Extra credit for that ;-)
> >
> > > Also I think that it make sense to changle location to
> > > o/a/h/<module>/internal/nls.
> >
> > Agreed.
> >
> > > Will provide patch with this tool when these changes are to be
> > > implemented and checked.
> >
> > I'll look forward to seeing it.  Thanks Ilya!
>
>
> Several times I was trying to make a post with attached zip-file with the
> tool, but unfortunately this letter was rejected as it is spam!!:( I wonder
> why?!
>
> Nevertheless, I've created a jira issue [1] with suggested implementation of
> the tool for generation classes to support internationalization.
>
>  I'd like to notice that all template files are stored in the
> msgstool.jarfile that is the result of ant build. For this reason this
> tool will work
> only if msgstool.jar file is in the user dir. I have to extract resources
> from the jar file (open jar file) and don't know how to do this if jar file
> is mentioned in the classpath and isn't located in the user dir. It would be
> great if someone knew how to deal with this issue...
>
> Tim, could you look into this tool, is it what we need?
> If it's ok, I would start with messages externalization task for modules.
>
> [1]https://issues.apache.org/jira/browse/HARMONY-1041
>
> BR,
> Ilya.
>
>
>
> >
> > Regards,
> > Tim
> >
> >
> > ---------------------------------------------------------------------
> > 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
>
>


-- 
Alexei Zakharov,
Intel Middleware Product Division

---------------------------------------------------------------------
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