net.sf.provisioner.utils
Class I18n

java.lang.Object
  extended by net.sf.provisioner.utils.I18n

public class I18n
extends java.lang.Object

Internationalization aka I18n Sets the current locale and provides corresponding resources

Version:
$ $
Author:
Martin Mierse

Constructor Summary
I18n()
           
 
Method Summary
static java.lang.String getFormattedLogString(java.lang.String key, java.lang.Object[] arguments)
          Creates a compound message using a pattern for the given key from the resource bundle containing the log messages
static java.lang.String getLogString(java.lang.String key)
          Gets a string for the given key from the resource bundle containing the log messages
static void setLocale(java.lang.String language, java.lang.String country)
          Sets the current locale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

I18n

public I18n()
Method Detail

setLocale

public static void setLocale(java.lang.String language,
                             java.lang.String country)
Sets the current locale

Parameters:
language - a valid ISO Language Code. These codes are the lower-case, two-letter codes as defined by ISO-639
country - a valid ISO Country Code. These codes are the upper-case, two-letter codes as defined by ISO-3166

getLogString

public static java.lang.String getLogString(java.lang.String key)
Gets a string for the given key from the resource bundle containing the log messages

Parameters:
key - the key for the desired string
Returns:
the string for the given key

getFormattedLogString

public static java.lang.String getFormattedLogString(java.lang.String key,
                                                     java.lang.Object[] arguments)
Creates a compound message using a pattern for the given key from the resource bundle containing the log messages

Parameters:
key - the key for the desired pattern
arguments - the arguments for the compound message
Returns:
the formatted message


Copyright © 2007-2008. All Rights Reserved.