[Yanel-commits] rev 32943 - in public/yanel/trunk/src/realms/yanel-website/content/documentation/i18n: . en.xhtml.yarep en.xhtml.yarep/revisions en.xhtml.yarep/revisions/1204734818837

josias at wyona.com josias at wyona.com
Wed Mar 5 17:22:55 CET 2008


Author: josias
Date: 2008-03-05 17:22:54 +0100 (Wed, 05 Mar 2008)
New Revision: 32943

Added:
   public/yanel/trunk/src/realms/yanel-website/content/documentation/i18n/en.xhtml.yarep/revisions/1204734818837/
   public/yanel/trunk/src/realms/yanel-website/content/documentation/i18n/en.xhtml.yarep/revisions/1204734818837/content
   public/yanel/trunk/src/realms/yanel-website/content/documentation/i18n/en.xhtml.yarep/revisions/1204734818837/meta
Modified:
   public/yanel/trunk/src/realms/yanel-website/content/documentation/i18n/en.xhtml
   public/yanel/trunk/src/realms/yanel-website/content/documentation/i18n/en.xhtml.yarep/meta
Log:
added info about parameter substitution

Modified: public/yanel/trunk/src/realms/yanel-website/content/documentation/i18n/en.xhtml
===================================================================
--- public/yanel/trunk/src/realms/yanel-website/content/documentation/i18n/en.xhtml	2008-03-05 16:02:47 UTC (rev 32942)
+++ public/yanel/trunk/src/realms/yanel-website/content/documentation/i18n/en.xhtml	2008-03-05 16:22:54 UTC (rev 32943)
@@ -11,10 +11,10 @@
 <h3>Overview</h3>
 <p>I18n serves for translating parts of your application to different languages. It uses a message catalogue to look up a message in a given language which is identified by a unique key.</p>
 <h3>Example</h3>
-<p>This example assumes that you are using the XMLResource (or any other subclass of BasicXMLResource).<br/></p><p>Example message catalogue (let's say it's stored in the default repository of your realm, with the path /i18n/foo.xml):<br/></p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;<br/>&lt;messages&gt;<br/>  &lt;message key=&quot;foo.user&quot;&gt;<br/>    &lt;text language=&quot;de&quot;&gt;Benutzer&lt;/text&gt;<br/>    &lt;text language=&quot;en&quot;&gt;User&lt;/text&gt;<br/>  &lt;/message&gt;<br/>  &lt;message key=&quot;foo.logout&quot;&gt;<br/>    &lt;text language=&quot;de&quot;&gt;Abmelden&lt;/text&gt;<br/>    &lt;text language=&quot;en&quot;&gt;Log out&lt;/text&gt;<br/>  &lt;/message&gt;<br/>&lt;/messages&gt;<br/></pre>To translate text using this catalogue, use the following code in your xslt:<br/><tt><br/>&lt;i18n:text xmlns:i18n=&quot;http://www.wyona.org/yanel/i18n/1.0&quot; key=&quot;foo.user&quot;/&gt;</tt><br/><br/>Or to transla!
 te an attribute:<tt><br/><br/>&lt;input type=&quot;submit&quot; value=&quot;foo.logout&quot; i18n:attr=&quot;value&quot;/&gt;</tt>
-<p>The catalogue has to be associated with the content. There are two ways to do so: <br/></p>
+<p>This example assumes that you are using the XMLResource (or any other subclass of BasicXMLResource).<br/></p><p>Example message catalogue (let's say it's stored in the default repository of your realm, with the path /i18n/foo.xml):<br/></p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;<br/>&lt;messages&gt;<br/>  &lt;message key=&quot;foo.user&quot;&gt;<br/>    &lt;text language=&quot;de&quot;&gt;Benutzer&lt;/text&gt;<br/>    &lt;text language=&quot;en&quot;&gt;User&lt;/text&gt;<br/>  &lt;/message&gt;<br/>  &lt;message key=&quot;foo.logout&quot;&gt;<br/>    &lt;text language=&quot;de&quot;&gt;Abmelden&lt;/text&gt;<br/>    &lt;text language=&quot;en&quot;&gt;Log out&lt;/text&gt;<br/>  &lt;/message&gt;<br/>  &lt;message key=&quot;foo.registeredUsers&quot;&gt;<br/>    &lt;text language=&quot;de&quot;&gt;Es sind {0} Benutzer registriert.&lt;/text&gt;<br/>    &lt;text language=&quot;en&quot;&gt;{0} users are registered.&lt;/text&gt;<br/>  &lt;/message&g!
 t;<br/>&lt;/messages&gt;<br/></pre>To translate text using this catalogue, use the following code in your xslt:<br/><tt><br/>&lt;i18n:text xmlns:i18n=&quot;http://www.wyona.org/yanel/i18n/1.0&quot; key=&quot;foo.user&quot;/&gt;</tt><br/><br/>To translate an attribute:<tt><br/><br/>&lt;input type=&quot;submit&quot; value=&quot;foo.logout&quot; i18n:attr=&quot;value&quot;/&gt;</tt>
+<p>To translate a text with parameters:</p><p><tt>&lt;i18n:translate&gt;<br/>  &lt;i18n:text key=&quot;foo.registeredUsers&quot;/&gt;<br/>  &lt;i18n:param&gt;7&lt;/i18n:param&gt;<br/>&lt;/i18n:translate&gt;</tt></p><p>The catalogue has to be associated with the content. There are two ways to do so: <br/></p>
 <ol>
 <li><p>Resource-specific messages<br/>Add a property to the resource configuration file (.rc):</p><p><tt>&lt;i18n-catalogue&gt;yanelrepo:/i18n/foo.xml&lt;/i18n-catalogue&gt;</tt>
 </p></li><li><p>Realm specific messages<br/>Add the following element to your realm.xml:<br/></p><p><tt>&lt;i18n-catalogue&gt;yanelrepo:/i18n/foo.xml&lt;/i18n-catalogue&gt;</tt>
 </p></li></ol><h3>How it works</h3>There is a transformer (I18nTransformer) which transforms the &lt;i18n:text&gt; elements  into the text messages from the catalogue. If no message is found for a given key and a given language, fallback to the default language is applied. If still no message is found, the transformer inserts the message key.<br/><br/>As of today there are three different versions of this transformer in yanel: I18nTransformer, I18nTransformer2, and I18nTransformer3. The first two versions are deprecated. They use a different syntax and they support only plain-text property files as catalogues (ResourceBundles).<br/>I18nTransformer3 still supports the old syntax and also allows to use ResourceBundle catalogues, so it's the recommended choice.<br/><h3>Multiple Catalogues</h3>It is possible to have more than one catalogue. <br/>A resource configuration can have several catalogues, the realm can have one, and Yanel has a global message catalogue. Yanel will loo!
 k for a message with a given key first in the resource catalogues, then in the realm catalogue, and eventually in the global catalogue.<br/><br/><br/></body>
-</html>
+</html>
\ No newline at end of file

Modified: public/yanel/trunk/src/realms/yanel-website/content/documentation/i18n/en.xhtml.yarep/meta
===================================================================
--- public/yanel/trunk/src/realms/yanel-website/content/documentation/i18n/en.xhtml.yarep/meta	2008-03-05 16:02:47 UTC (rev 32942)
+++ public/yanel/trunk/src/realms/yanel-website/content/documentation/i18n/en.xhtml.yarep/meta	2008-03-05 16:22:54 UTC (rev 32943)
@@ -1,7 +1,7 @@
 yarep_type<string>:resource
 yarep_isCheckedOut<boolean>:false
-yarep_checkoutDate<date>:2008-02-28T11:37:22+0100
-yarep_size<long>:3236
+yarep_size<long>:3704
+yarep_checkoutDate<date>:2008-03-05T17:28:31+0100
 yarep_checkoutUserID<string>:lenya
-yarep_lastModifed<long>:1204195101000
-yarep_checkinDate<date>:2008-02-28T11:38:21+0100
+yarep_lastModifed<long>:1204734818000
+yarep_checkinDate<date>:2008-03-05T17:33:38+0100

Added: public/yanel/trunk/src/realms/yanel-website/content/documentation/i18n/en.xhtml.yarep/revisions/1204734818837/content
===================================================================
--- public/yanel/trunk/src/realms/yanel-website/content/documentation/i18n/en.xhtml.yarep/revisions/1204734818837/content	                        (rev 0)
+++ public/yanel/trunk/src/realms/yanel-website/content/documentation/i18n/en.xhtml.yarep/revisions/1204734818837/content	2008-03-05 16:22:54 UTC (rev 32943)
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>Internationalization in YANEL</title>
+</head>
+<body>
+<h2>How i18n works in Yanel</h2>
+<h3>Overview</h3>
+<p>I18n serves for translating parts of your application to different languages. It uses a message catalogue to look up a message in a given language which is identified by a unique key.</p>
+<h3>Example</h3>
+<p>This example assumes that you are using the XMLResource (or any other subclass of BasicXMLResource).<br/></p><p>Example message catalogue (let's say it's stored in the default repository of your realm, with the path /i18n/foo.xml):<br/></p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;<br/>&lt;messages&gt;<br/>  &lt;message key=&quot;foo.user&quot;&gt;<br/>    &lt;text language=&quot;de&quot;&gt;Benutzer&lt;/text&gt;<br/>    &lt;text language=&quot;en&quot;&gt;User&lt;/text&gt;<br/>  &lt;/message&gt;<br/>  &lt;message key=&quot;foo.logout&quot;&gt;<br/>    &lt;text language=&quot;de&quot;&gt;Abmelden&lt;/text&gt;<br/>    &lt;text language=&quot;en&quot;&gt;Log out&lt;/text&gt;<br/>  &lt;/message&gt;<br/>  &lt;message key=&quot;foo.registeredUsers&quot;&gt;<br/>    &lt;text language=&quot;de&quot;&gt;Es sind {0} Benutzer registriert.&lt;/text&gt;<br/>    &lt;text language=&quot;en&quot;&gt;{0} users are registered.&lt;/text&gt;<br/>  &lt;/message&g!
 t;<br/>&lt;/messages&gt;<br/></pre>To translate text using this catalogue, use the following code in your xslt:<br/><tt><br/>&lt;i18n:text xmlns:i18n=&quot;http://www.wyona.org/yanel/i18n/1.0&quot; key=&quot;foo.user&quot;/&gt;</tt><br/><br/>To translate an attribute:<tt><br/><br/>&lt;input type=&quot;submit&quot; value=&quot;foo.logout&quot; i18n:attr=&quot;value&quot;/&gt;</tt>
+<p>To translate a text with parameters:</p><p><tt>&lt;i18n:translate&gt;<br/>  &lt;i18n:text key=&quot;foo.registeredUsers&quot;/&gt;<br/>  &lt;i18n:param&gt;7&lt;/i18n:param&gt;<br/>&lt;/i18n:translate&gt;</tt></p><p>The catalogue has to be associated with the content. There are two ways to do so: <br/></p>
+<ol>
+<li><p>Resource-specific messages<br/>Add a property to the resource configuration file (.rc):</p><p><tt>&lt;i18n-catalogue&gt;yanelrepo:/i18n/foo.xml&lt;/i18n-catalogue&gt;</tt>
+</p></li><li><p>Realm specific messages<br/>Add the following element to your realm.xml:<br/></p><p><tt>&lt;i18n-catalogue&gt;yanelrepo:/i18n/foo.xml&lt;/i18n-catalogue&gt;</tt>
+</p></li></ol><h3>How it works</h3>There is a transformer (I18nTransformer) which transforms the &lt;i18n:text&gt; elements  into the text messages from the catalogue. If no message is found for a given key and a given language, fallback to the default language is applied. If still no message is found, the transformer inserts the message key.<br/><br/>As of today there are three different versions of this transformer in yanel: I18nTransformer, I18nTransformer2, and I18nTransformer3. The first two versions are deprecated. They use a different syntax and they support only plain-text property files as catalogues (ResourceBundles).<br/>I18nTransformer3 still supports the old syntax and also allows to use ResourceBundle catalogues, so it's the recommended choice.<br/><h3>Multiple Catalogues</h3>It is possible to have more than one catalogue. <br/>A resource configuration can have several catalogues, the realm can have one, and Yanel has a global message catalogue. Yanel will loo!
 k for a message with a given key first in the resource catalogues, then in the realm catalogue, and eventually in the global catalogue.<br/><br/><br/></body>
+</html>
\ No newline at end of file

Added: public/yanel/trunk/src/realms/yanel-website/content/documentation/i18n/en.xhtml.yarep/revisions/1204734818837/meta
===================================================================
--- public/yanel/trunk/src/realms/yanel-website/content/documentation/i18n/en.xhtml.yarep/revisions/1204734818837/meta	                        (rev 0)
+++ public/yanel/trunk/src/realms/yanel-website/content/documentation/i18n/en.xhtml.yarep/revisions/1204734818837/meta	2008-03-05 16:22:54 UTC (rev 32943)
@@ -0,0 +1,12 @@
+yarep_revisionComment<string>:updated
+yarep_type<string>:resource
+yarep_isCheckedOut<boolean>:false
+yarep_revisionCreator<string>:lenya
+workflow-date<date>:2008-03-05T17:33:39+0100
+yarep_checkoutDate<date>:2008-03-05T17:28:31+0100
+yarep_size<long>:3704
+yarep_checkoutUserID<string>:lenya
+yarep_lastModifed<long>:1204734818000
+workflow-state<string>:draft
+yarep_checkinDate<date>:2008-02-28T11:38:21+0100
+yarep_revisionCreationDate<date>:2008-03-05T17:33:38+0100



More information about the Yanel-commits mailing list