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.
Thanks,
Lassi Immonen
|