You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Wyn Easton <wy...@yahoo.com> on 2002/10/09 13:55:54 UTC

Internationalization of parsing error messages

Hello:

I'm trying to write an XML validator that I can use in
the US and other countries. I tried setting the Locale
of the SAX Parser by using the setLocale() method.
I set it to FRENCH because I saw a French message
property file was shipped in the xerces jar file.
The error messages were still displayed in English.
Could someone point me to an archive or someplace that
explains the steps needed or maybe send the steps in a
reply? Thanks for the help.

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Internationalization of parsing error messages

Posted by Wyn Easton <wy...@yahoo.com>.
Things are working much better now.
Thanks for your help, Andy and Neil
--- Wyn Easton <wy...@yahoo.com> wrote:
> Andy:
> 
> Thanks for the clarification. I'll give it a shot
> latter today and let you know how it goes.
> 
> --- Andy Clark <an...@apache.org> wrote:
> > Wyn Easton wrote:
> > > I'm still confused about how to use the
> different
> > > translations. I thought that by setting the
> Locale
> > > with the setLocale() method of the parser that I
> > would
> > > be telling the parser to use the Locale that I
> > set.
> > > I didn't think the Locale of the machine
> mattered.
> > 
> > You should get the appropriate locale message when
> > you use the setLocale method. If you don't set the
> > locale, then it will go back to the machine
> default.
> > 
> > However, if there are no French messages available
> > in the Jar file with the parser, then you won't be
> > able to get French messages no matter what you
> set.
> > So you need to integrate the French messages from
> > the XML4J release.
> > 
> > -- 
> > Andy Clark * andyc@apache.org
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > xerces-j-user-unsubscribe@xml.apache.org
> > For additional commands, e-mail:
> > xerces-j-user-help@xml.apache.org
> > 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Faith Hill - Exclusive Performances, Videos & More
> http://faith.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> xerces-j-user-help@xml.apache.org
> 


__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Internationalization of parsing error messages

Posted by Wyn Easton <wy...@yahoo.com>.
Andy:

Thanks for the clarification. I'll give it a shot
latter today and let you know how it goes.

--- Andy Clark <an...@apache.org> wrote:
> Wyn Easton wrote:
> > I'm still confused about how to use the different
> > translations. I thought that by setting the Locale
> > with the setLocale() method of the parser that I
> would
> > be telling the parser to use the Locale that I
> set.
> > I didn't think the Locale of the machine mattered.
> 
> You should get the appropriate locale message when
> you use the setLocale method. If you don't set the
> locale, then it will go back to the machine default.
> 
> However, if there are no French messages available
> in the Jar file with the parser, then you won't be
> able to get French messages no matter what you set.
> So you need to integrate the French messages from
> the XML4J release.
> 
> -- 
> Andy Clark * andyc@apache.org
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> xerces-j-user-help@xml.apache.org
> 


__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Internationalization of parsing error messages

Posted by Andy Clark <an...@apache.org>.
Wyn Easton wrote:
> I'm still confused about how to use the different
> translations. I thought that by setting the Locale
> with the setLocale() method of the parser that I would
> be telling the parser to use the Locale that I set.
> I didn't think the Locale of the machine mattered.

You should get the appropriate locale message when
you use the setLocale method. If you don't set the
locale, then it will go back to the machine default.

However, if there are no French messages available
in the Jar file with the parser, then you won't be
able to get French messages no matter what you set.
So you need to integrate the French messages from
the XML4J release.

-- 
Andy Clark * andyc@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Internationalization of parsing error messages

Posted by Wyn Easton <wy...@yahoo.com>.
Andy:

Thanks for the information about what translations are
shipped.

I'm still confused about how to use the different
translations. I thought that by setting the Locale
with the setLocale() method of the parser that I would
be telling the parser to use the Locale that I set.
I didn't think the Locale of the machine mattered.
I was planning on using my validator on a web server
that may be set-up for English, but would be able to
send different language error messages to users in
different countries. I read somewhere that I would
need to reinstantiate the parser each time I want to
set a different Locale. That is fine with me, but is
the setLocale() method going to work for my situation
where I want to get various translations from the
error message property files by using the setLocale()
method of the parser?
Thanks for your help.

--- Andy Clark <an...@apache.org> wrote:
> Wyn Easton wrote:
> > In other words, what translations are shipped with
> > Xerces? 
> 
> I just checked and I don't see any other language
> files included with Xerces. A long time ago we had
> a complete set of translations done for XML4J and
> Xerces but those messages are now completely out
> of date and can't be used with the new version of
> Xerces.
> 
> BUT...
> 
> I just downloaded the latest XML4J version (which
> is built using Xerces2) and it contains a complete
> set of translations for all of the message files!
> So you could download them, add them to your local
> copy of the Xerces source, and do a "build jars".
> 
> And if you want the French messages to be the
> default no matter what the host encoding of the
> machine, rename the XML error messages file to
> XMLMessages_en.properties and the French one to
> XMLMessages.properties. (This is just an example
> because there are other sets of error message
> files.)
> 
> NOTE: I just looked at it a bit more and it
> appears that the latest XML4J version is only
> Xerces 2.0.0. Therefore some messages may have
> been added since then. However, most should be
> the same. In that case, it may be best to keep
> the English messages as the default and rely on
> the locale of the machine. That way, French
> messages will appear when the locale is set to
> French and any messages that don't exist in the
> Xerces 2.0.0 French translation will default to
> English (which should be a very small number).
> 
> -- 
> Andy Clark * andyc@apache.org
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> xerces-j-user-help@xml.apache.org
> 


__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Internationalization of parsing error messages

Posted by Andy Clark <an...@apache.org>.
Wyn Easton wrote:
> In other words, what translations are shipped with
> Xerces? 

I just checked and I don't see any other language
files included with Xerces. A long time ago we had
a complete set of translations done for XML4J and
Xerces but those messages are now completely out
of date and can't be used with the new version of
Xerces.

BUT...

I just downloaded the latest XML4J version (which
is built using Xerces2) and it contains a complete
set of translations for all of the message files!
So you could download them, add them to your local
copy of the Xerces source, and do a "build jars".

And if you want the French messages to be the
default no matter what the host encoding of the
machine, rename the XML error messages file to
XMLMessages_en.properties and the French one to
XMLMessages.properties. (This is just an example
because there are other sets of error message
files.)

NOTE: I just looked at it a bit more and it
appears that the latest XML4J version is only
Xerces 2.0.0. Therefore some messages may have
been added since then. However, most should be
the same. In that case, it may be best to keep
the English messages as the default and rely on
the locale of the machine. That way, French
messages will appear when the locale is set to
French and any messages that don't exist in the
Xerces 2.0.0 French translation will default to
English (which should be a very small number).

-- 
Andy Clark * andyc@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Internationalization of parsing error messages

Posted by Wyn Easton <wy...@yahoo.com>.
Andy:
Here is the JVM information:
java version "1.3.1_03"
Java(TM) 2 Runtime Environment, Standard Edition
(build 1.3.1_03-b03)
Java HotSpot(TM) Client VM (build 1.3.1_03-b03, mixed
mode)

I'm running on Windows 2000.

I'm using a US version of W2K. I have not configured
my system to be able to display French characters.
I thought that if I was pulling the French text from
the Xerces property file I would see some funny
characters displayed and that way I could tell at
least it was not coming from the English property
file.
If this isn't working because I'm not on a real
foreign language version of W2K, let me know and I can

try my validator on a machine that is configured
properly. How do I know what the default locale is? 
When I type CHCP at the commad prompt it says 437.
Once I get things setup correctly to display French
error messages, how would I get other languages?
In other words, what translations are shipped with
Xerces? 
Thanks for your help.



--- Andy Clark <an...@apache.org> wrote:
> Wyn Easton wrote:
> > I'm trying to write an XML validator that I can
> use in
> > the US and other countries. I tried setting the
> Locale
> > of the SAX Parser by using the setLocale() method.
> > I set it to FRENCH because I saw a French message
> > property file was shipped in the xerces jar file.
> > The error messages were still displayed in
> English.
> 
> The idea is that error messages will be displayed in
> the language of the user. Therefore, if the messages
> you see are in English and not in French, then I
> apologize -- they should be French.
> 
> What is the default locale of the machine that you
> are using? More information will help us fix the
> problem. For example, please let us know what OS
> and JVM you are using.
> 
> -- 
> Andy Clark * andyc@apache.org
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> xerces-j-user-help@xml.apache.org
> 


__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Internationalization of parsing error messages

Posted by Andy Clark <an...@apache.org>.
Wyn Easton wrote:
> I'm trying to write an XML validator that I can use in
> the US and other countries. I tried setting the Locale
> of the SAX Parser by using the setLocale() method.
> I set it to FRENCH because I saw a French message
> property file was shipped in the xerces jar file.
> The error messages were still displayed in English.

The idea is that error messages will be displayed in
the language of the user. Therefore, if the messages
you see are in English and not in French, then I
apologize -- they should be French.

What is the default locale of the machine that you
are using? More information will help us fix the
problem. For example, please let us know what OS
and JVM you are using.

-- 
Andy Clark * andyc@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org