net.sourceforge.geeboss.view.i18n
Class I18nUtil

java.lang.Object
  extended by net.sourceforge.geeboss.view.i18n.I18nUtil

public class I18nUtil
extends java.lang.Object

Utility methods for i18n support

Author:
Frederic BORRY

Field Summary
static java.util.Locale DEFAULT_LANGUAGE
          Default language
static java.util.List<java.lang.String> LANGUAGE_LIST
          Available language list
static java.util.Locale[] LANGUAGES
          Available languages
 
Constructor Summary
I18nUtil()
           
 
Method Summary
static java.lang.String formatString(java.lang.String aFormat, java.lang.Object[] aParams)
          Format a given string
static java.util.ResourceBundle getGeebossBundle(java.util.Locale locale)
          Get the Geeboss message bundle for the specified locale
static java.lang.String getI18nString(java.lang.String key)
          Get a translated string for the default locale
static java.lang.String getI18nString(java.lang.String key, java.util.Locale locale)
          Get a translated string for a given locale
static java.lang.String getI18nString(java.lang.String key, java.lang.Object[] parameters)
          Get a translated string for a set of parametersa and the default locale
static java.lang.String getI18nString(java.lang.String key, java.lang.Object[] parameters, java.util.Locale locale)
          Get a translated string for a set of parametersa and given locale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LANGUAGES

public static java.util.Locale[] LANGUAGES
Available languages


LANGUAGE_LIST

public static java.util.List<java.lang.String> LANGUAGE_LIST
Available language list


DEFAULT_LANGUAGE

public static java.util.Locale DEFAULT_LANGUAGE
Default language

Constructor Detail

I18nUtil

public I18nUtil()
Method Detail

getGeebossBundle

public static java.util.ResourceBundle getGeebossBundle(java.util.Locale locale)
Get the Geeboss message bundle for the specified locale

Parameters:
locale - the locale we want the bundle for
Returns:
the suitable message bundle according to the provided locale

getI18nString

public static java.lang.String getI18nString(java.lang.String key,
                                             java.util.Locale locale)
Get a translated string for a given locale

Parameters:
key - the string key
locale - the locale
Returns:
the translated string

getI18nString

public static java.lang.String getI18nString(java.lang.String key,
                                             java.lang.Object[] parameters,
                                             java.util.Locale locale)
Get a translated string for a set of parametersa and given locale

Parameters:
key - the string key
parameters - the parameters to use to format the string
locale - the locale
Returns:
the translated string

getI18nString

public static java.lang.String getI18nString(java.lang.String key)
Get a translated string for the default locale

Parameters:
key - the string key
Returns:
the translated string

getI18nString

public static java.lang.String getI18nString(java.lang.String key,
                                             java.lang.Object[] parameters)
Get a translated string for a set of parametersa and the default locale

Parameters:
key - the string key
parameters - the parameters to use to format the string
Returns:
the translated string

formatString

public static java.lang.String formatString(java.lang.String aFormat,
                                            java.lang.Object[] aParams)
Format a given string

Parameters:
aFormat - the format string
aParams - the parameters
Returns:
the formated string


Copyright (c) 2005 The Geeboss team (http://geeboss.sourceforge.net). All Rights Reserved.