cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lassi Immonen <limmo...@malla.urova.fi>
Subject Re: [C2]I18n transformer
Date Fri, 03 Nov 2000 13:41:43 GMT
Berin Loritsch wrote:
> 
> ----- Original Message -----
> From: "Lassi Immonen" <limmonen@malla.urova.fi>
> To: "Conny Krappatsch" <conny@smb-tec.com>; <cocoon-dev@xml.apache.org>
> Sent: Friday, November 03, 2000 4:31 AM
> Subject: [C2]I18n transformer
> 
> > Hi,
> >
> > In attachment is C2 I18nTtransformer, which is port from Infozones
> > I18NProcessor.
> >
> > I don't have any license in there cause don't know which license to put
> > there??
> >
> > Usage:
> > ---------
> > Sitemap:
> > <map:match pattern="">
> >   <map:generate src="orig.xml"/>
> >     <map:transform type="translate">
> >       <parameter name="default_lang" value="en"/>
> >       <parameter name="src" value="orig_trans.xml"/>
> >     </map:transform>
> >     <map:transform src="simple2html.xsl"/>
> >     <map:serialize type="html"/>
> > </map:match>
> > ---------
> > orig.xml:
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <lang_test
> > xmlns:i="http://apache.org/cocoon/i18n">
> > <title><i:tr>Title</i:tr></title>
> > <para i:tr="y">Paragraph</para>
> > <para>Paragraph not to be translated</para>
> > </lang_test>
> > -----------
> > orig_trans.xml:
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <translations>
> >   <entry>
> >     <key>Title</key>
> >       <translation lang="fi">Otsikko</translation>
> >       <translation lang="sv">Titel</translation>
> >   </entry>
> >   <entry>
> >     <key>Paragraf</key>
> >       <translation lang="fi">Paragraafi</translation>
> >       <translation lang="sv">Paragraf</translation>
> >   </entry>
> > </translations>
> > --------
> >
> > So I modified syntax a bit from I18NProcessor. Now you have to put all
> > translations in one translation file, which is in my opinion better at
> > least small sites as we are doing.
> >
> > I didn't include parameter substitutions from I18NProcessor, but it
> > wouldn't be big thing to add. I don't have such a need now.
> 
> How different is it from the one in Avalon?  If it is the same, C2 already
> has it included.  If it is different, can you send me the diff and a quick
> summary of what you did?  The one in Avalon is the same as the one from
> infozone approx. 4 weeks ago.

What do you mean?
I couldn't find any I18NProcessor/Transformer in Avalon or C2. Where it
should be?

To summarize it:
It's C2 transformer which loads xml-file, eg. orig_trans.xml above, to
Hashtable according lang value it gets in Setup. 
After that it substitutes every occurrance of <i:tr>Text</i:tr> or
<some_elem i:tr="y">Text</some_elem> with value from Hashtable.

 Lassi
Mime
View raw message