Demo of I18N (Internationalization) with JAVA

I18N is called Internationalization, which supports Multiparty language in your software. again its not convert one language to other language but Display selected language from “Properties” file.

Crate file Copy the following code.


 import java.util.*;
public class I18nDemo {
 private static Locale aLocale;
 private static Locale frLocale;
 private static ResourceBundle Message;
 public static void main(String[] args)
aLocale = new Locale("en","US");
 frLocale = new Locale("fr","FR");
Message = ResourceBundle.getBundle("MessagesBundle",aLocale);


Create Properties file with name “” for Default language.(our Default language is EN). put in same folder.

greetings = Hello
farewell = Goodbye
inquiry = How are you?


Create new properties file for French Language with “”

greetings = Bonjour.
farewell = Au revoir.
inquiry = Comment allez-vous?

Create same file for US English

greetings = Hello
farewell = Goodbye
inquiry = How are you?

Now change aLocate to frLocate (visa verse)  compile and run the program.

Share Post