org.equanda.util
Class Internationalize

java.lang.Object
  extended by org.equanda.util.Internationalize

public class Internationalize
extends Object

Internationalization support

Author:
Joachim Van der Auwera

Constructor Summary
Internationalize()
           
Internationalize(boolean stealth)
           
Internationalize(String language, String country, String variant)
          constructor
Internationalize(String language, String country, String variant, boolean stealth)
           
 
Method Summary
 String getResource(String name)
          getResource : get the string from a resource.
 String getResource(String fullname, Locale locale)
          getResource : get the string from a resource.
 void setLanguage(String language)
          change the locale to the given combination of language, country and variant
 void setLanguage(String language, String country)
           
 void setLanguage(String language, String country, String variant)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Internationalize

public Internationalize(String language,
                        String country,
                        String variant)
constructor

Parameters:
language -
country - can be "" or null
variant - can be "" or null

Internationalize

public Internationalize(String language,
                        String country,
                        String variant,
                        boolean stealth)

Internationalize

public Internationalize()

Internationalize

public Internationalize(boolean stealth)
Method Detail

setLanguage

public void setLanguage(String language)
change the locale to the given combination of language, country and variant


setLanguage

public void setLanguage(String language,
                        String country)

setLanguage

public void setLanguage(String language,
                        String country,
                        String variant)

getResource

public String getResource(String name)
getResource : get the string from a resource. You can scope this call to a specific resource bundle by using "bundle:name". This will then search in the MessagesBundle file, if no bundle is specified, "MessagesDefault" is used. When there is no definition for the name in the resource bundle (or no bundle), then the name itself is returned. Uses he default locale (as specified when the class was initialised).


getResource

public String getResource(String fullname,
                          Locale locale)
getResource : get the string from a resource. You can scope this call to a specific resource bundle by using "bundle:name". This will then search in the MessagesBundle file, if no bundle is specified, "MessagesDefault" is used. When there is no definition for the name in the resource bundle (or no bundle), then the name itself is returned. The locale can (optionally) be specified.



Copyright © 2007-2009. All Rights Reserved.