Internationalization

Locale

  • Defines a language (e.g. en)
  • Defines a country (e.g. US)
  • Defines a script (e.g. latin)

Locale Dependencies

  • Strings
  • Images
  • Colors
  • Audio or video clips
  • Dates
  • Times
  • Numbers
  • Currency

Properties Files

  • MenusBundle_de.properties
# File menu
open = offnen
close = schlie├čen
new = neue
exit = verlassen
~~~~~~~~~~

# Create a Resource Bundle

ResourceBundle menusBundle = ResourceBundle.getBundle("MenusBundle", Locale.getDefault()); ~~

Looking up a String

String open = menus.getString("open");

Formatting Dates

DateFormat df =
  DateFormat.getDateInstance(DateFormat.SHORT, Locale.GERMANY);
df.format(date);