Package com.dassault_systemes.catweb.tools.resource

   
Class Language

 
Class Hierarchy
java.lang.Object
  |
  +-com.dassault_systemes.catweb.tools.resource.Language
Class Location

Framework : PortalBase

Module : PLBtools

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
PropertyResourceBundle widgetsRB
PropertyResourceBundle messagesRB
String widgetsFile
String messagesFile

Constructor Summary
Language(String _widgetsFile, String _messagesFile)

Method Summary
Locale getLocale()
void setLocale(Locale newLocale)
void registerLanguage(Language language)
PropertyResourceBundle createResourceBundle(String baseFilename)
String _getWidgetsString(String key)
String _getMessagesString(String key)


Field Detail

widgetsRB

    PropertyResourceBundle widgetsRB


messagesRB

    PropertyResourceBundle messagesRB


widgetsFile

    String widgetsFile


messagesFile

    String messagesFile


Constructor Detail

Language

    Language(String _widgetsFile, String _messagesFile)

Constructor with the name of widget and message NLS files


Method Detail

getLocale

    Locale getLocale()

Returns the current Locale used by the Portal


setLocale

    void setLocale(Locale newLocale)

Sets the Locale used by the Portal


registerLanguage

    void registerLanguage(Language language)

Register all the languages so that we can change their locale if a locale modification occurs


createResourceBundle

    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

Returns:
null if the file for the current locale is not found

_getWidgetsString

    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.


_getMessagesString

    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.



Copyright © 2000, Dassault Systèmes. All rights reserved