You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Piroumian, Konstantin" <KP...@flagship.ru> on 2001/05/11 18:12:58 UTC
I18nTransformer (with param substitution)
Hi!
I've implemented the param substitution in I18nTransformer. Now it is
possible to use it like this:
<i18n:translate>
<i18n:text>This page was hit {0} times.{/i18n:text>
<i18n:param><xsp:expr>count</xsp:expr></i18n:param>
</i18n:translate>
The source and samples are attached. I have also attached an XML Spy project
file for convenience.
I am open for comments and suggestions. Next task will be dictionary
improvement to support include and import capabilities.
Btw, is there a good way of internationalizing dates and currencies (to use
different formatting)?
Example:
<i18n:translate>
<i18n:text>Current date {0, date, 'dd/MM/yyy'}.{/i18n:text> <!-- this is
stored in the dictionary -->
<i18n:param><xsp:expr>new Date()</xsp:expr></i18n:param>
</i18n:translate>
The problem is that MessageFormat class that I use for substitution gets an
array of Objects as argument, but I cannot get objects from XML - only
strings. Any ideas?
Best regards,
Konstantin Piroumian
Software engineer
Protek Flagship LLC
Phone: + 7 095 795 0520 (add. 1288)
Fax: + 7 095 795 0525
E-mail: kpiroumian@flagship.ru
http://www.protek.com
Re: I18nTransformer (with param substitution)
Posted by giacomo <gi...@apache.org>.
On Tue, 15 May 2001, Piroumian, Konstantin wrote:
> > Konstantin,
> > Checked in I18nTransformer2.java. Can you please i18n_proposal.txt and
> readme.txt as an XML file?
> Ok. i18n_proposal.txt must be correct, but I am not sure that my english is
> good enough to be used in docs. Anyway, I'll format them as XML and anybody
> can check the grammar.
>
> > Please take a look at xdocs directory. This will make it easy for people
> to understand/use your
> > I18nTransformer. FYI, You can test your XML->HTML by running "build docs".
>
> Ok.
>
> >
> > Here's the process for submission:
> > 1. Get the latest from CVS.
> > 2. Make your changes.
> > 3. Run "CVS diff -u" from the xml-cocoon2 directory.
> > 4. Zipup the text file generated in step #3 and any new files that you
> have added.
> > 5. Post it to cocoon-dev@ mailing list.
>
> Thank you for instructions.
> >
> > Thanks,
> > dims
> >
>
> Btw, wouldn't it be better to replace completely the old I18nTransformer
> with this new one? All the functionality of the old transformer is possible
> with the new one with some changes in syntax.
+1
Giacomo
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: I18nTransformer (with param substitution)
Posted by Davanum Srinivas <di...@yahoo.com>.
Konstantin,
Yes, once we have all the pieces in place, we can remove the old one.
Also, Please add a section on migration from the old syntax to the new one.
Yes, once the doc is in xml we can work on the content (if required).
Thanks,
dims
--- "Piroumian, Konstantin" <KP...@flagship.ru> wrote:
> > Konstantin,
> > Checked in I18nTransformer2.java. Can you please i18n_proposal.txt and
> readme.txt as an XML file?
> Ok. i18n_proposal.txt must be correct, but I am not sure that my english is
> good enough to be used in docs. Anyway, I'll format them as XML and anybody
> can check the grammar.
>
> > Please take a look at xdocs directory. This will make it easy for people
> to understand/use your
> > I18nTransformer. FYI, You can test your XML->HTML by running "build docs".
>
> Ok.
>
> >
> > Here's the process for submission:
> > 1. Get the latest from CVS.
> > 2. Make your changes.
> > 3. Run "CVS diff -u" from the xml-cocoon2 directory.
> > 4. Zipup the text file generated in step #3 and any new files that you
> have added.
> > 5. Post it to cocoon-dev@ mailing list.
>
> Thank you for instructions.
> >
> > Thanks,
> > dims
> >
>
> Btw, wouldn't it be better to replace completely the old I18nTransformer
> with this new one? All the functionality of the old transformer is possible
> with the new one with some changes in syntax.
>
> Regards,
> Konstantin Piroumian.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
=====
Davanum Srinivas, JNI-FAQ Manager
http://www.jGuru.com/faq/JNI
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: I18nTransformer (with param substitution)
Posted by "Piroumian, Konstantin" <KP...@flagship.ru>.
> Konstantin,
> Checked in I18nTransformer2.java. Can you please i18n_proposal.txt and
readme.txt as an XML file?
Ok. i18n_proposal.txt must be correct, but I am not sure that my english is
good enough to be used in docs. Anyway, I'll format them as XML and anybody
can check the grammar.
> Please take a look at xdocs directory. This will make it easy for people
to understand/use your
> I18nTransformer. FYI, You can test your XML->HTML by running "build docs".
Ok.
>
> Here's the process for submission:
> 1. Get the latest from CVS.
> 2. Make your changes.
> 3. Run "CVS diff -u" from the xml-cocoon2 directory.
> 4. Zipup the text file generated in step #3 and any new files that you
have added.
> 5. Post it to cocoon-dev@ mailing list.
Thank you for instructions.
>
> Thanks,
> dims
>
Btw, wouldn't it be better to replace completely the old I18nTransformer
with this new one? All the functionality of the old transformer is possible
with the new one with some changes in syntax.
Regards,
Konstantin Piroumian.
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: I18nTransformer (with param substitution)
Posted by Davanum Srinivas <di...@yahoo.com>.
Konstantin,
Checked in I18nTransformer2.java. Can you please i18n_proposal.txt and readme.txt as an XML file?
Please take a look at xdocs directory. This will make it easy for people to understand/use your
I18nTransformer. FYI, You can test your XML->HTML by running "build docs".
Here's the process for submission:
1. Get the latest from CVS.
2. Make your changes.
3. Run "CVS diff -u" from the xml-cocoon2 directory.
4. Zipup the text file generated in step #3 and any new files that you have added.
5. Post it to cocoon-dev@ mailing list.
Thanks,
dims
--- "Piroumian, Konstantin" <KP...@flagship.ru> wrote:
> > > > Konstantin
> > > >
> > > > Can anybody work on this patch? I haven't had the time to look into
> it.
> > >
> > > What do you mean by working on it? I am still working on it - it is
> required
> > > for my current project, but it's open source and anybody is allowed to
> work
> > > on it and improve.
> >
> > With "working on it" I meant integrating/applying to the code base etc.
>
> Anybody who is interested in it is eligible to work on it and apply to the
> code base.
> I could work myself, but I am behind a corporate firewall and it is not a
> trivial task for me to work with the Cocoon CVS.
> I never worked on an Open Source project and I don't know what do I need to
> join it and what are the rules and regulations in such projects.
>
> >
> > Giacomo
> >
>
>
> Regards,
> Konstantin Piroumian.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
=====
Davanum Srinivas, JNI-FAQ Manager
http://www.jGuru.com/faq/JNI
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: I18nTransformer (with param substitution)
Posted by "Piroumian, Konstantin" <KP...@flagship.ru>.
> > > Konstantin
> > >
> > > Can anybody work on this patch? I haven't had the time to look into
it.
> >
> > What do you mean by working on it? I am still working on it - it is
required
> > for my current project, but it's open source and anybody is allowed to
work
> > on it and improve.
>
> With "working on it" I meant integrating/applying to the code base etc.
Anybody who is interested in it is eligible to work on it and apply to the
code base.
I could work myself, but I am behind a corporate firewall and it is not a
trivial task for me to work with the Cocoon CVS.
I never worked on an Open Source project and I don't know what do I need to
join it and what are the rules and regulations in such projects.
>
> Giacomo
>
Regards,
Konstantin Piroumian.
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: I18nTransformer (with param substitution)
Posted by Giacomo Pati <gi...@apache.org>.
On Mon, May 14, 2001 at 01:10:25PM +0400, Piroumian, Konstantin wrote:
> >
> > Konstantin
> >
> > Can anybody work on this patch? I haven't had the time to look into it.
>
> What do you mean by working on it? I am still working on it - it is required
> for my current project, but it's open source and anybody is allowed to work
> on it and improve.
With "working on it" I meant integrating/applying to the code base etc.
Giacomo
>
> >
> > Giacomo
> >
> > > Hi!
> > >
> > > I've implemented the param substitution in I18nTransformer. Now it is
> > > possible to use it like this:
> > > <i18n:translate>
> > > <i18n:text>This page was hit {0} times.{/i18n:text>
> > > <i18n:param><xsp:expr>count</xsp:expr></i18n:param>
> > > </i18n:translate>
> > > The source and samples are attached. I have also attached an XML Spy
> project
> > > file for convenience.
> > >
> > > I am open for comments and suggestions. Next task will be dictionary
> > > improvement to support include and import capabilities.
> > >
> > > Btw, is there a good way of internationalizing dates and currencies (to
> use
> > > different formatting)?
> > > Example:
> > > <i18n:translate>
> > > <i18n:text>Current date {0, date, 'dd/MM/yyy'}.{/i18n:text> <!--
> this is
> > > stored in the dictionary -->
> > > <i18n:param><xsp:expr>new Date()</xsp:expr></i18n:param>
> > > </i18n:translate>
> > >
> > > The problem is that MessageFormat class that I use for substitution gets
> an
> > > array of Objects as argument, but I cannot get objects from XML - only
> > > strings. Any ideas?
> > >
> > > Best regards,
> > >
> > > Konstantin Piroumian
> > > Software engineer
> > >
> > > Protek Flagship LLC
> > > Phone: + 7 095 795 0520 (add. 1288)
> > > Fax: + 7 095 795 0525
> > > E-mail: kpiroumian@flagship.ru
> > > http://www.protek.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: I18nTransformer (with param substitution)
Posted by "Piroumian, Konstantin" <KP...@flagship.ru>.
>
> Konstantin
>
> Can anybody work on this patch? I haven't had the time to look into it.
What do you mean by working on it? I am still working on it - it is required
for my current project, but it's open source and anybody is allowed to work
on it and improve.
>
> Giacomo
>
> > Hi!
> >
> > I've implemented the param substitution in I18nTransformer. Now it is
> > possible to use it like this:
> > <i18n:translate>
> > <i18n:text>This page was hit {0} times.{/i18n:text>
> > <i18n:param><xsp:expr>count</xsp:expr></i18n:param>
> > </i18n:translate>
> > The source and samples are attached. I have also attached an XML Spy
project
> > file for convenience.
> >
> > I am open for comments and suggestions. Next task will be dictionary
> > improvement to support include and import capabilities.
> >
> > Btw, is there a good way of internationalizing dates and currencies (to
use
> > different formatting)?
> > Example:
> > <i18n:translate>
> > <i18n:text>Current date {0, date, 'dd/MM/yyy'}.{/i18n:text> <!--
this is
> > stored in the dictionary -->
> > <i18n:param><xsp:expr>new Date()</xsp:expr></i18n:param>
> > </i18n:translate>
> >
> > The problem is that MessageFormat class that I use for substitution gets
an
> > array of Objects as argument, but I cannot get objects from XML - only
> > strings. Any ideas?
> >
> > Best regards,
> >
> > Konstantin Piroumian
> > Software engineer
> >
> > Protek Flagship LLC
> > Phone: + 7 095 795 0520 (add. 1288)
> > Fax: + 7 095 795 0525
> > E-mail: kpiroumian@flagship.ru
> > http://www.protek.com
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: I18nTransformer (with param substitution)
Posted by giacomo <gi...@apache.org>.
Konstantin
Can anybody work on this patch? I haven't had the time to look into it.
Giacomo
> Hi!
>
> I've implemented the param substitution in I18nTransformer. Now it is
> possible to use it like this:
> <i18n:translate>
> <i18n:text>This page was hit {0} times.{/i18n:text>
> <i18n:param><xsp:expr>count</xsp:expr></i18n:param>
> </i18n:translate>
> The source and samples are attached. I have also attached an XML Spy project
> file for convenience.
>
> I am open for comments and suggestions. Next task will be dictionary
> improvement to support include and import capabilities.
>
> Btw, is there a good way of internationalizing dates and currencies (to use
> different formatting)?
> Example:
> <i18n:translate>
> <i18n:text>Current date {0, date, 'dd/MM/yyy'}.{/i18n:text> <!-- this is
> stored in the dictionary -->
> <i18n:param><xsp:expr>new Date()</xsp:expr></i18n:param>
> </i18n:translate>
>
> The problem is that MessageFormat class that I use for substitution gets an
> array of Objects as argument, but I cannot get objects from XML - only
> strings. Any ideas?
>
> Best regards,
>
> Konstantin Piroumian
> Software engineer
>
> Protek Flagship LLC
> Phone: + 7 095 795 0520 (add. 1288)
> Fax: + 7 095 795 0525
> E-mail: kpiroumian@flagship.ru
> http://www.protek.com
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org