Class MapLanguageToBundle

java.lang.Object
com.portal.web.comp.MapLanguageToBundle

public class MapLanguageToBundle extends Object
Loads the appropriate resource bundle based on the Accept-Language and Accept-Charset headers in the HTTP input. The JSPs request the required character encoding by using the Content Type attribute in the page directive. The resource bundle loaded here should use the same encoding.
Version:
%version: 5 % %date_modified: Thu Nov 08 18:27:31 2001 %
Author:
wgeiger
  • Field Details

  • Constructor Details

    • MapLanguageToBundle

      public MapLanguageToBundle(String bundleName, String languages, String charsets)
      Constructs a new MapLanguageToBundle object for the given bundle name, language list, and charset list.
      Parameters:
      bundleName - the resource bundle name
      languages - the Accept-Language header
      charsets - the Accept-Charset header
  • Method Details

    • getLocale

      public Locale getLocale()
      Gets the resource bundle for the locale.
      Returns:
      The selected locale.
    • getCharset

      public String getCharset()
      Gets the character set.
      Returns:
      The selected character set.
    • getCharset

      public String getCharset(Locale locale)
      Gets the character set based on the WebKit locale.
      Returns:
      The requested character set, or if it's null, a String with the locale name.
    • getBundle

      public ResourceBundle getBundle()
      Gets the resource bundle for the locale.
      Returns:
      The selected resource bundle.
    • getCharset

      public static String getCharset(Locale locale, String charsets)