org.robokind.api.common.localization
Class Localizer

java.lang.Object
  extended by org.robokind.api.common.localization.Localizer

public class Localizer
extends Object

Static methods for language localization.

Author:
Matthew Stevenson

Constructor Summary
Localizer()
           
 
Method Summary
static String _$_(String key)
          Return the String associated with the given key surrounded with spaces: ' '.
static String _$(String key)
          Return the String associated with the given key proceeded with a space: ' '.
static String $_(String key)
          Return the String associated with the given key followed by a space: ' '.
static String $(String key)
          Return the String associated with the given key for the set LanguageLocale
static LanguageLocale getLocale()
          Returns the LanguageLocale being used.
static String getLocaleName()
          Returns the name of the current LanguageLocale.
static String localize(String key)
          Returns the localized value for the given key.
static void setLocale(LanguageLocale locale)
          Sets the LanguageLocale to use for localization.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Localizer

public Localizer()
Method Detail

setLocale

public static void setLocale(LanguageLocale locale)
Sets the LanguageLocale to use for localization.

Parameters:
locale - new LanguageLocal

getLocale

public static LanguageLocale getLocale()
Returns the LanguageLocale being used.

Returns:
current LanguageLocale

getLocaleName

public static String getLocaleName()
Returns the name of the current LanguageLocale.

Returns:
name of the current LanguageLocale. null if no locale is set.

localize

public static String localize(String key)
Returns the localized value for the given key.

Parameters:
key - String to localize
Returns:
localized value for the given key

$

public static String $(String key)
Return the String associated with the given key for the set LanguageLocale

Parameters:
key - the key of the String to lookup
Returns:
String associated with the given key for the set LanguageLocale

$_

public static String $_(String key)
Return the String associated with the given key followed by a space: ' '.

Parameters:
key - the key of the String to lookup
Returns:
String associated with the given key followed by a space

_$

public static String _$(String key)
Return the String associated with the given key proceeded with a space: ' '.

Parameters:
key - the key of the String to lookup
Returns:
String associated with the given key proceeded with a space

_$_

public static String _$_(String key)
Return the String associated with the given key surrounded with spaces: ' '.

Parameters:
key - the key of the String to lookup
Returns:
String associated with the given key surrounded with spaces


Copyright © 2011. All Rights Reserved.