Writing Message Facility enabled internalizable Java program is easy,
you define the messages with a constant
String
variable and its comment, then use the constant string to get formatted
result according to user preferred Locale.
Create messages by writing String constants with comment.
A message definition is shared by referencing its constant value from where needed.
Obtain a Messager and format messages with it.
Be Locale sensitive is the basic requirement for an I18n ready application. And Locales need to be received and used in proper manners.
Thanks to JSR 269 released with JDK 6 as a standard, Annotation Processing has been seamlessly integrated into the normal Java Compilation process. Steps to compile the tutorial examples are shown in this section, you'll see no different than normal Java compilation.