com.jeta.open.i18n
Class I18N

java.lang.Object
  extended by com.jeta.open.i18n.I18N

public class I18N
extends Object

This is a wrapper class around I18NHelper


Constructor Summary
I18N()
           
 
Method Summary
static int compareToIgnoreCase(String str1, String str2)
           
static boolean equals(char[] str1, char[] str2)
          Compares two string arrays in a Locale independent way.
static boolean equals(String str1, String str2)
          Compares two strings in a Locale independent way.
static boolean equalsIgnoreCase(String str1, String str2)
          Compares two strings in a Locale independent way.
static String format(String template, Object arg1)
          This is a helper routine that formats a message string that takes 1 argument in the current locale
static String format(String template, Object[] arguments)
          A wrapper routine around I18NHelper for formatting locale specific messages.
static String format(String template, Object arg1, Object arg2)
          This is a helper routine that formats a message string that takes 2 arguments in the current locale
static String format(String template, Object arg1, Object arg2, Object arg3)
          This is a helper routine that formats a message string that takes 3 arguments in the current locale
static String generateCSVList(Collection objs)
          iterates over the collection of objects and creates a string that contains the objects separated by a comma (or the locale version of a CSV list)
static String generateCSVList(String[] strs)
          iterates over the collection of objects and creates a string that contains the objects separated by a comma (or the locale version of a CSV list).
static String getLocalizedDialogLabel(String resourceName)
          Returns the locale string for the given resource name with the addition of a colon on the end (for western languages).
static String getLocalizedMessage(String resourceName)
          Gets the locale string for the given resource name.
static String getResource(String resourceName)
          Deprecated.  
 
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

compareToIgnoreCase

public static int compareToIgnoreCase(String str1,
                                      String str2)

equals

public static boolean equals(char[] str1,
                             char[] str2)
Compares two string arrays in a Locale independent way.

Parameters:
str1 - the first string to compare
str2 - the second string to compare
Returns:
true if the two strings are equals

equals

public static boolean equals(String str1,
                             String str2)
Compares two strings in a Locale independent way.

Parameters:
str1 - the first string to compare
str2 - the second string to compare
Returns:
true if the two strings are equals

equalsIgnoreCase

public static boolean equalsIgnoreCase(String str1,
                                       String str2)
Compares two strings in a Locale independent way.

Parameters:
str1 - the first string to compare
str2 - the second string to compare
Returns:
true if the two strings are equals

format

public static String format(String template,
                            Object[] arguments)
A wrapper routine around I18NHelper for formatting locale specific messages.

Parameters:
template - the template name of the message
arguments - an array or arguments required for the message
Returns:
the formatted message.

format

public static String format(String template,
                            Object arg1)
This is a helper routine that formats a message string that takes 1 argument in the current locale

Parameters:
template - the name of the message template to use
arg1 - the argument value for the message tempalte
Returns:
the formatted message

format

public static String format(String template,
                            Object arg1,
                            Object arg2)
This is a helper routine that formats a message string that takes 2 arguments in the current locale

Parameters:
template - the name of the message template to use
arg1 - the first argument value for the message tempalte
arg2 - the second argument value for the message tempalte
Returns:
the formatted message

format

public static String format(String template,
                            Object arg1,
                            Object arg2,
                            Object arg3)
This is a helper routine that formats a message string that takes 3 arguments in the current locale

Parameters:
template - the name of the message template to use
arg1 - the first argument value for the message tempalte
arg2 - the second argument value for the message tempalte
arg3 - the third argument value for the message tempalte
Returns:
the formatted message

generateCSVList

public static String generateCSVList(String[] strs)
iterates over the collection of objects and creates a string that contains the objects separated by a comma (or the locale version of a CSV list). If an item in the array is null it is skipped.

Returns:
the generated string

generateCSVList

public static String generateCSVList(Collection objs)
iterates over the collection of objects and creates a string that contains the objects separated by a comma (or the locale version of a CSV list)

Returns:
the generated string

getLocalizedDialogLabel

public static String getLocalizedDialogLabel(String resourceName)
Returns the locale string for the given resource name with the addition of a colon on the end (for western languages). Dialog labels generally have a colon at the end of the label.

Parameters:
resourceName - the name of the resource to lookup in the properties files.
Returns:
the localized string. If the resourceName is not found, it is returned.

getLocalizedMessage

public static String getLocalizedMessage(String resourceName)
Gets the locale string for the given resource name.

Parameters:
resourceName - the name of the resource to lookup in the properties files.
Returns:
the localized string. If the resourceName is not found, it is returned.

getResource

public static String getResource(String resourceName)
Deprecated. 

Gets the locale string for the given resource name.

Parameters:
resourceName - the name of the resource to lookup in the properties files.
Returns:
the localized string. If the resourceName is not found, it is returned.


Copyright © 2005-2007 Jeff Tassin & Todd Viegut. All Rights Reserved.