ilog.cpl.util
Class IlpI18NUtil

java.lang.Object
  extended by ilog.cpl.util.IlpI18NUtil

public class IlpI18NUtil
extends Object

Utility functions for internationalization.

Since:
JTGO 3.1

Method Summary
static String getDefaultBundleName()
          Returns the default bundle name used by the application.
static Object getObject(String key, Object defaultValue, Locale locale)
          Returns the resource value for a given key, or the default value if the no entry is found for the key.
static ResourceBundle getResourceBundle(String baseName, Locale locale, String productName)
          Returns the requested resource bundle for the given locale.
static String getString(String msgid, String enDefault, IlpContext context, String bundle)
           
static String getString(String msgid, String enDefault, Locale locale, String bundle)
          Returns the translation for the given string, or the original string if no translation is available.
static ResourceBundle loadResourceBundle(String baseName, Locale locale, String productName)
          Loads a resource bundle.
static void setDefaultBundleName(String name)
          Sets the default bundle name used by the application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setDefaultBundleName

public static void setDefaultBundleName(String name)
Sets the default bundle name used by the application.

Compatibility Note: In JViews 8.0, this method was renamed from SetDefaultBundleName to setDefaultBundleName.

Since:
JViews 8.0

getDefaultBundleName

public static String getDefaultBundleName()
Returns the default bundle name used by the application.

Compatibility Note: In JViews 8.0, this method was renamed from GetDefaultBundleName to getDefaultBundleName.

Since:
JViews 8.0

getResourceBundle

public static ResourceBundle getResourceBundle(String baseName,
                                               Locale locale,
                                               String productName)
Returns the requested resource bundle for the given locale.

The resource bundle will be automatically loaded.

Compatibility Note: In JViews 8.0, this method was renamed from GetResourceBundle to getResourceBundle.

Parameters:
baseName - Resource bundle name
locale - Locale to be used when loading the resource bundle
productName - Product name to log messages during load operation
Returns:
the loaded resource bundle or an empty resource bundle
Since:
JViews 8.0

loadResourceBundle

public static ResourceBundle loadResourceBundle(String baseName,
                                                Locale locale,
                                                String productName)
Loads a resource bundle.

Returns:
the loaded resource bundle or null
Internal method or field: do not use!

getString

public static String getString(String msgid,
                               String enDefault,
                               Locale locale,
                               String bundle)
Returns the translation for the given string, or the original string if no translation is available.

Parameters:
msgid - The message id.
enDefault - The default English message, if no translation is found.
locale - The locale to be used.
bundle - The resource bundle to search for the translations.
Since:
JViews 8.0

getString

public static String getString(String msgid,
                               String enDefault,
                               IlpContext context,
                               String bundle)

getObject

public static Object getObject(String key,
                               Object defaultValue,
                               Locale locale)
Returns the resource value for a given key, or the default value if the no entry is found for the key.

Parameters:
key - The message id.
defaultValue - The default English message, if no translation is found.
locale - The locale.
Since:
JViews 8.0


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.