steps to provide I18N Support in JSF Application

Ratings:
(4)
Views: 526
Banner-Img
Share this blog:

steps to provide I18N Support in JSF Application  

  • Prepare properties files for each and every locale

To prepare properties files, we have to use the following naming convections for the properties file <base-name>-<long>.properties In the properties files, we have to provide locale respective messages in the form of key-value pairs, where keys should be in English and values should be in locale language EX: abe-en. properties:- Income = user name Upwd= password   abc-it. properties u name- user name Upwd= password

  • Configure locale and properties file in faces configuration file

To configure locale and properties files in faces configuration file, we have to use the following tags <faces-config> --- <application> <locale-config> <default-locale>en</default-locale> <supported-locale>it</ supported -locale> </locale-config> <resource-bundle> <base-name>abe</base-name> <var>msg</ var > </resource-bundle> </application> ---------- </faces-config>

  1. Access the message from properties file

To access the messages from properties file, we have to use the following <hi output text>gag <h:output text value=”#{msg. uname}”/> <h:output text value=”#{msg. upwd}”/>

You liked the article?

Like: 0

Vote for difficulty

Current difficulty (Avg): Medium

EasyMediumHardDifficultExpert
IMPROVE ARTICLEReport Issue

About Author

Authorlogo
Name
TekSlate
Author Bio

TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.

Stay Updated
Get stories of change makers and innovators from the startup ecosystem in your inbox