Haktan Aydın
Haktan Aydın

Reputation: 591

how to provide completely multi-language support in my jsf application

I'm developing a web application and using JSF 2.2 and Primefaces.

It contains a lot of output texts, user warning messages etc. I want to support many different languages. What is the most usable way to do this? Is there any standard or efficient procedure to achieve this?

Upvotes: 1

Views: 3222

Answers (1)

WitYoBadSelf
WitYoBadSelf

Reputation: 98

JSF supports internationalized messaging through locale specific .properties resource files. Once a locale is set, either implicitly via the browser or explicitly by the user, the appropriate bundle will be loaded. For browser settings:

<f:view locale="#{facesContext.externalContext.requestLocale}">

You will also need to define the <resource-bundle> in you faces-config.xml where base-name defines the base file name and var defines the scoped result map.

I would start with this doc from @BalusC: http://jdevelopment.nl/internationalization-jsf-utf8-encoded-properties-files/

Also from @Mkyong: http://www.mkyong.com/jsf2/jsf-2-message-and-messages-example/

Upvotes: 1

Related Questions