package com.i18n.bean;
import com.kre8orz.i18n.I18N;
import com.kre8orz.i18n.annotation.I18NMessage;
import com.kre8orz.i18n.annotation.I18NMessages;
import java.util.Locale;
public class MessageBean {
private static final String _key = "PASSPHRASE";
@I18NMessages({
@I18NMessage(value="Welcome ({0})"),
@I18NMessage(value="Welcome ({0})",locale="en"),
@I18NMessage(value="Bienvenido ({0})",locale="es"),
@I18NMessage(value="Bienvenue ({0})",locale="fr")
})
private static final String MSG_WELCOME = "M0001";
public static void main(String[] args){
String[] locales = new String[]{
"",
"en",
"es",
"fr"
};
String bundlePath = MessageCatalog.getBundlePath(MessageBean.class);
for (String locale : locales) {
I18N i18n = new I18N(bundlePath,new Locale(locale),_key);
System.out.println(i18n.get(MSG_WELCOME, locale));
}
}
}