net.pandoragames.util.i18n
Class BundleLocalizer

java.lang.Object
  extended by net.pandoragames.util.i18n.LocalizerBase
      extended by net.pandoragames.util.i18n.BundleLocalizer
All Implemented Interfaces:
Localizer

public class BundleLocalizer
extends LocalizerBase

ResourceBundle based implementation of the Localizer interface.

Author:
Olivier Wehner
See Also:
ResourceBundle

Field Summary
 
Fields inherited from class net.pandoragames.util.i18n.LocalizerBase
decimalFormater, integerFormater
 
Constructor Summary
BundleLocalizer(java.lang.String baseName, java.util.Locale locale)
          The constructor takes the bundle base name and the desired locale.
 
Method Summary
 java.lang.String localize(java.lang.String code)
          Returns some locale specific, human readable text for the specified code, or the code unchanged if no such translation could be done,
 
Methods inherited from class net.pandoragames.util.i18n.LocalizerBase
getLanguage, getLocale, localize, localize, localize, localize, localize, parseDate, parseDouble, parseInt, parseLong
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BundleLocalizer

public BundleLocalizer(java.lang.String baseName,
                       java.util.Locale locale)
The constructor takes the bundle base name and the desired locale. See java.util.ResourceBundle for details.

Parameters:
baseName - the base name of the resource bundle, a fully qualified class name
locale - non null locale
Method Detail

localize

public java.lang.String localize(java.lang.String code)
Returns some locale specific, human readable text for the specified code, or the code unchanged if no such translation could be done,

Parameters:
code - application internal code for some text
Returns:
human readable text (or supplied code)