You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Mike Duffy <md...@yahoo.com> on 2006/02/18 05:17:27 UTC

Internationalization for Error Messages

What is the best way to do internationalization for error messages?

For example, "Specified attribute is not between the expected values of 1 and 1000."

According to the Kito Mann book on page 307, you can overwrite existing messages by creating the
name value pairs in your own properties file and specifying the properties file in your
faces-config.xml.

But what if you wanted to use the existing default locale for English and then add other locales?

Does anyone have a link that gives a clear example?  How can I find a list of all the existing
error message names with values that need to be translated (I assume there is a properties file
buried in a jar somewhere)?

It would be great if there were already default translations for several locales.

Thx.

Mike

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Internationalization for Error Messages

Posted by Gregg Bolinger <gd...@gmail.com>.
I *think* it should work the same way as all your other properties files.
Follow the example given on page 237 of JSF in Action and in the secondary
language properties files, place your overridden error messages in the
appropriate language.  I haven't tried this, but I believe it should work.

Gregg

On 2/17/06, Mike Duffy <md...@yahoo.com> wrote:
>
> What is the best way to do internationalization for error messages?
>
> For example, "Specified attribute is not between the expected values of 1
> and 1000."
>
> According to the Kito Mann book on page 307, you can overwrite existing
> messages by creating the
> name value pairs in your own properties file and specifying the properties
> file in your
> faces-config.xml.
>
> But what if you wanted to use the existing default locale for English and
> then add other locales?
>
> Does anyone have a link that gives a clear example?  How can I find a list
> of all the existing
> error message names with values that need to be translated (I assume there
> is a properties file
> buried in a jar somewhere)?
>
> It would be great if there were already default translations for several
> locales.
>
> Thx.
>
> Mike
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>

Re: Internationalization for Error Messages

Posted by Mike Duffy <md...@yahoo.com>.
Exactly what I needed to know.

Thx.

Mike

--- Jonathan Harley <jo...@parkplatz.net> wrote:

> Mike Duffy wrote:
> > What is the best way to do internationalization for error messages?
> > 
> > For example, "Specified attribute is not between the expected values of 1 and 1000."
> > 
> > According to the Kito Mann book on page 307, you can overwrite existing messages by creating
> the
> > name value pairs in your own properties file and specifying the properties file in your
> > faces-config.xml.
> 
> That's correct.
> 
> > But what if you wanted to use the existing default locale for English and then add other
> locales?
> > 
> > Does anyone have a link that gives a clear example?  How can I find a list of all the existing
> > error message names with values that need to be translated (I assume there is a properties
> file
> > buried in a jar somewhere)?
> 
> You just provide translations in your properties files for the other locales.
> All the error message keys and english messages are in the myfaces jar in
> file Messages.properties under javax.faces.
> 
> Jon.
> -- 
> .....................................................................
>            Dr Jonathan Harley   .
>                                 .   Email: jon@parkplatz.net
>             Zac Parkplatz Ltd   .   Office Telephone: 024 7633 1375
>             www.parkplatz.net   .   Mobile: 079 4116 0423
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Internationalization for Error Messages

Posted by Jonathan Harley <jo...@parkplatz.net>.
Mike Duffy wrote:
> What is the best way to do internationalization for error messages?
> 
> For example, "Specified attribute is not between the expected values of 1 and 1000."
> 
> According to the Kito Mann book on page 307, you can overwrite existing messages by creating the
> name value pairs in your own properties file and specifying the properties file in your
> faces-config.xml.

That's correct.

> But what if you wanted to use the existing default locale for English and then add other locales?
> 
> Does anyone have a link that gives a clear example?  How can I find a list of all the existing
> error message names with values that need to be translated (I assume there is a properties file
> buried in a jar somewhere)?

You just provide translations in your properties files for the other locales.
All the error message keys and english messages are in the myfaces jar in
file Messages.properties under javax.faces.

Jon.
-- 
.....................................................................
           Dr Jonathan Harley   .
                                .   Email: jon@parkplatz.net
            Zac Parkplatz Ltd   .   Office Telephone: 024 7633 1375
            www.parkplatz.net   .   Mobile: 079 4116 0423