webwork/src/docs/manual howto-chain.html,1.3,1.4 howto-error.html,1.3,1.4 howto-i18n.html,1.2,1.3 index.html,1.11,1.12 howto-chain.jsp,1.3,NONE howto-error.jsp,1.2,NONE howto-i18n.jsp,1.2,NONE
[email protected] Sun, 02 Nov 2003 16:53:07 -0800
| Newsgroups | gmane.comp.java.open-symphony.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/opensymphony/webwork/src/docs/manual
In directory sc8-pr-cvs1:/tmp/cvs-serv9475/manual
Modified Files:
howto-i18n.html index.html
Added Files:
howto-chain.html howto-error.html
Removed Files:
howto-chain.jsp howto-error.jsp howto-i18n.jsp
Log Message:
More conversions to html
Index: howto-i18n.html
===================================================================
RCS file: /cvsroot/opensymphony/webwork/src/docs/manual/howto-i18n.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- howto-i18n.html 18 Jul 2002 13:57:46 -0000 1.2
+++ howto-i18n.html 3 Nov 2003 00:53:04 -0000 1.3
@@ -7,5 +7,67 @@
<body bgcolor="#FFFFFF" text="#000000">
+<p>Internationalization (i18n) support means that applications
+have the ability to display itself in multiple languages or locales.
+This doesn't necessarily mean that the application supports inputting
+data in multiple languages or translating stored data into another
+language for display. WW makes it easy for you to provide i18n support
+for GUI display by utilizing ResourceBundles. </p>
+
+<p>Resource bundles are property files with special names.
+Lets take for example a WW i18n application Webshop app. This application
+provides i18n support for English, French, Swedish, and German
+languages by providing 4 resource bundles located under webwork/action/test/i18n.
+These files are Shop.properties, Shop_de.properties, Shop_fr.properties,
+and Shop_sv.properties. These files correspond to a base class property
+file, a German property file, a French property file, and a Swedish property file.
+But, where is the English property file? We will soon see. </p>
+
+<p>The resource bundles are named after a base action for this application named Shop.
+This action extends ActionSupport which provides methods to load resource bundles
+and return i18n text. It is quite common for developers to extend their actions
+from this base class. Extending this class allows you to do the following if
+one of your actions is on the ValueStack. </p>
+
+<p>Use ActionSupport's getText() method with user as the key to find the appropriate i18n text. </p>
+
+<pre>
+<ui:textfield label="text('user_name')" name="'user'"/>
+</pre>
+
+<p>The non UI tag text will retrieve appropriate text from your resource bundle.
+In the next example, it is used to retrieve i18n text for the name value. </p>
+
+<pre>
+<webwork:text name="'cd.quantityLabel'"/>
+</pre>
+
+<p>In addition, you can use text to perform message formats for more sophisticated
+i18n needs. In the next example, text will retrieve i18n text for name value
+price which will return {0,number,currency} - see MessageFormat for more details.
+This pattern will be used to format the value in value0. For this example,
+this means our currency will be displayed appropriately - $ for Dollar, etc. </p>
+
+<pre>
+<webwork:text name="'price'" value0="totalPrice"/>
+</ww:property>
+</pre>
+
+<p>Now, back to the resource bundles. Remember earlier, that we said we did not
+provide an English resource bundle. The reason is that our base resource bundle
+Shop.properties is serving as our English resource bundle. For the other language
+bundles, we wrote over keys that should be language specific. With this setup,
+WW's ActionSupport class will use the following algorithm to retrieve i18n text.</p>
+
+<ol>
+<li>Find appropriate resource bundle for the specific action and locale that has its getText() called. </li>
+<li>If the resource bundle is not found, start up the inheritance tree looking for it. </li>
+<li>If the bundle is found, search for the key first in a locale specific bundle otherwise use the base bundle. </li>
+</ol>
+
+<p>WW provides you another custom tag for your i18n needs. This tag is named i18n
+and it allows you to place a resource bundle on the ValueStack for use inside
+its tag's body. This allows you to easily mix locales within a page. </p>
+
</body>
</html>
Index: index.html
===================================================================
RCS file: /cvsroot/opensymphony/webwork/src/docs/manual/index.html,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- index.html 2 Nov 2003 17:52:57 -0000 1.11
+++ index.html 3 Nov 2003 00:53:04 -0000 1.12
@@ -109,10 +109,10 @@
<li><a href="howto-validate.jsp#validate">Validation through doValidate()</a></li>
<li><a href="howto-validate.jsp#execute">Validation from doExecute()</a></li>
</ul>
- <li><a href="howto-error.jsp">Error Handling</a></li>
+ <li><a href="howto-error.html">Error Handling</a></li>
<li><a href="howto-wizard.html">Wizards</a></li>
- <li><a href="howto-chain.jsp">Chaining Actions</a></li>
- <li><a href="howto-i18n.jsp">Internationalization</a></li>
+ <li><a href="howto-chain.html">Chaining Actions</a></li>
+ <li><a href="howto-i18n.html">Internationalization</a></li>
</ul>
</li>
<li><b>About</b>
--- howto-chain.jsp DELETED ---
--- howto-error.jsp DELETED ---
--- howto-i18n.jsp DELETED ---
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/