Vyacheslav,

You're right that I could use ListResourceBundles, but, one of the
advantages of
using property resource bundles when the only items to be localized are
string
is that the property files can be handed over to a translator or someone
with no
idea how code should look, and a translated version can be provided in the
appropriate language,  As soon as you have code elements, the potential for
confusion on their part, and errors in the translated copy, increases.

Another major advantage is that adding a property resource bundle is quite
easy
- it means adding a text file, no compilation necessary.  This can actually
be
done at run-time, allowing dynamic addition of support for a new language
without any system downtime.  Adding a class, however, can be much more
complicated, as most class-files are released within jars, etc which cannot
be
erased/modified while in use by most servers.

As for specifying the locale, well, the locale is only used to the extent
that
the name of the ResourceBundle to be instantiated is specified by the
locale.
The actual contents of the bundle are loaded completely independently of
locale.
With respect to Property Resource Bundles in particular, notice that Locale
objects do not provide any means to derive a valid text encoding - this is
reasonable
as there are multiple encodings which can effectively encode the characters
from any specific Locale.

Thanks for the input though....
-AMT

> -----Original Message-----
> From: Vyacheslav Pedak [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 10, 2000 6:53 PM
> To: Arun Thomas
> Subject: Re: Re: localization
>
>
> Hi
>
> You do not need to know encoding to work with ResourceBundles,
> because you may use ListResourceBundle (this is java class, so
> you characters will be in unicode).
> To work with ResourceBundles you need to specify locale or
> use default locale from JVM. (see java.util.Locale class).
> The default system locale is established by JVM from your
> environment.
>
> Vyacheslav Pedak
>
> ----- Original Message -----
> From: Arun Thomas <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, April 11, 2000 4:19 AM
> Subject: Re: localization
>
>
> > Govind,
> >
> > I'm hoping you can help clarify a point about localization that
> I've been
> > able
> > to find little comment about....  In the last few lines of your
> JavaWorld
> > article,
> > you write:
> >
> >         If you are using something other than the ISO-8859-1 character
> set, you
> >         must communicate this to the browser using the contentType
> attribute of
> >       the page tag, as:
> >           <%@ page contentType="text/html; charset=charset_name" %>
> >
> > You follow on to explain the compliancy requirements of the browser.
> >
> > My question deals with the JSP engine (and ResourceBundles for that
> matter).
> > How do these objects know the encoding used to store the JSP Page or
> > Property file?  In order to read in these items for parsing into JSP
> > Servlets/
> > ResourceBundles, some particular encoding must be used.  I can't
> understand
> > how
> > the engine could possible determine the encoding to use for a particular
> > file
> > based on information stored within the file (the @page directive above).
> In
> > the case of ResourceBundles, as far as I can see, the getBundle method
> must
> > be
> > assuming a particular encoding for the Property files, as none of the
> > various
> > method signatures provide any means to specify the encoding to use.
> >
> > Any clarification would be greatly appreciated.
> >
> > Thanks for a good article.
> > -AMT
> >
>
>
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to