com.ibm.mashups.enabler.context
Interface LocalizedContext


public LocalizedContext

LocalizedContext to get the preferred locale, the default locale, as well as titles and descriptions of localized resources within this localized context.


Method Summary
 String getPreferredLocale()
           Returns the preferred locale of this LocalizedContext.
 String getDefaultLocale()
           Returns the default locale of this LocalizedContext.
 String getLocale(Localized localized)
           Returns the locale of the localized resource, which matches best the locale set with the browser.
 String getDisplayLocale(String locale)
           Returns the display locale set with the browser matching the specified locale.
 String getTitle(Localized localized)
           Returns the title of the localized resource in the locale, which matches best the locale set with the browser.
 String getDescription(Localized localized)
           Returns the description of the localized resource in the locale, which matches best the locale set with the browser.
 

Method Detail

getPreferredLocale

String getPreferredLocale()
Returns the preferred locale of this LocalizedContext.

Returns:
the preferred locale

getDefaultLocale

String getDefaultLocale()
Returns the default locale of this LocalizedContext.

Returns:
the default locale

getLocale

String getLocale(Localized localized)
Returns the locale of the localized resource, which matches best the locale set with the browser.

Parameters:
localized - resource implementing the Localized interface; must not be null
Returns:
the preferred locale. Returns null if no locale is available.

getDisplayLocale

String getDisplayLocale(String locale)
Returns the display locale set with the browser matching the specified locale.

Parameters:
locale - ; mandatory, must not be null
Returns:
the display locale. Returns null if no display locale is available.

getTitle

String getTitle(Localized localized)
Returns the title of the localized resource in the locale, which matches best the locale set with the browser.

Parameters:
localized - resource implementing the Localized interface; must not be null
Returns:
the title string in the preferred locale. Returns null if no locale is available.

getDescription

String getDescription(Localized localized)
Returns the description of the localized resource in the locale, which matches best the locale set with the browser.

Parameters:
localized - resource implementing the Localized interface; must not be null
Returns:
the description string in the preferred locale. Returns null if no locale is available.


Copyright IBM Corp. 2010 All Rights Reserved.