>
> Hi all,
>
> the APM, p. 105 says:
>
> "The JavaServer Pages 1.1 specification allows you to deliver
> locale-specific files by following the naming convention used by resource
> bundles. This naming convention is the base file name followed by and
> underscore and the language variant. A country and a variante can also be
> used:
>
> jsp + _ + language
> jsp + _ + language + _ + country
>
> <etc>
> "
>
> So this is a nice idea, but it doesn't say:
>
> a) what the language and country values should be: codes or what?
> b) how to set the locale and country set by these things


   Look up the documentation for the Locale and ResourceBundle objects,
they probably mean writing files like


foo.jsp_en_US
foo.jsp_ja
foo.jsp_de

etc


However, using multiple JSP's to do internationalization is probably
not the best method, since you end up with duplicated code. If you
fix a bug or change logic in one JSP, you have to alter it in all
the localized versions.

If your JSP has lots of scriptlets in it, you're better off pulling
text from ResourceBundles.



Mozilla has the most superior technique which relies on XML
entities. I use this method myself in XML/XSL. What you do
is declare your locale specific strings in an external
DTD, and then reference them in your JSP/XML via entity
references.


For instance,

<h1> &section.heading; </h1>

<p> &section.paragraph;

<table>
<tr><th>&column.firstname;</th><th>&column.lastname</th></tr>
...
</table>



-Ray

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to