Saturday, 14 March 2015

I18N

The application/project which sends the output based on the client regional  language then those applications called as internationalization applications.
If we want to develop the i18n application we have to find the local information means system language.
    public static void main(String[] args)
    {
        Locale l = Locale.getDefault();
    }
If we want to information form properties file we have to use the Resource bundle object. Bellow is the example of application
public class UserSpecificData
{

    public static void main(String[] args)
    {
       ResourceBundle rb =        ResourceBundle.getBundle("com/ibm/pdc/ephs/java/i18n/Abc",           Locale.CANADA);
       System.out.println(rb.getString("name"));
    }

}
If key is not present in the properties file then we get the Exception in thread "main" java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key name1









No comments:

Post a Comment