|
|
|||||
| Package com.dassault_systemes.catweb.tools.resource |
Class Language
|
| Class Hierarchy |
java.lang.Object | +-com.dassault_systemes.catweb.tools.resource.Language
| Class Location |
| Class Description |
public abstract class Language
Abstract Class for NLS widgets and messages management. This class need to be extended by the developers for their components. The Locale selected by the end user is automatically updated at the launch of the Portal.
| Field Summary |
| protected String | messagesFile
|
| protected PropertyResourceBundle | messagesRB
|
| protected String | widgetsFile
|
| protected PropertyResourceBundle | widgetsRB
|
| Constructor Summary |
| Language(String _widgetsFile, String _messagesFile)
Constructor with the name of widget and message NLS files |
| Method Summary |
| public String | _getMessagesString(String key)
Returns the translated nessage sepcified by its key in the current locale. |
| public String | _getWidgetsString(String key)
Returns the translated widget name sepcified by its key in the current locale. |
| protected PropertyResourceBundle | createResourceBundle(String baseFilename)
Creates and returns a PropertyResourceBundle object with a baseFileName using the Class to find a file named [baseFileName]_[2letter ISO639 code language].properties Example : widgets_en.properties |
| public static Locale | getLocale()
Returns the current Locale used by the Portal |
| public static void | registerLanguage(Language language)
Register all the languages so that we can change their locale if a locale modification occurs |
| public static void | setLocale(Locale newLocale)
Sets the Locale used by the Portal |
| Field Detail |
protected String messagesFile
protected PropertyResourceBundle messagesRB
protected String widgetsFile
protected PropertyResourceBundle widgetsRB
| Constructor Detail |
Language(String _widgetsFile, String _messagesFile)
Constructor with the name of widget and message NLS files
| Method Detail |
public String _getMessagesString(String key)
Returns the translated nessage sepcified by its key in the current locale.
If the key is not found in the messages file, the key value is returned.
public String _getWidgetsString(String key)
Returns the translated widget name sepcified by its key in the current locale.
If the key is not found in the widgets file, the key value is returned.
protected PropertyResourceBundle createResourceBundle(String baseFilename)
Creates and returns a PropertyResourceBundle object with a baseFileName
using the Class to find a file named [baseFileName]_[2letter ISO639 code language].properties
Example : widgets_en.properties
public static Locale getLocale()
Returns the current Locale used by the Portal
public static void registerLanguage(Language language)
Register all the languages so that we can change their locale if a locale modification occurs
public static void setLocale(Locale newLocale)
Sets the Locale used by the Portal