net.mchaplin.commons.i18n
Class I18n

java.lang.Object
  extended by net.mchaplin.commons.i18n.I18n

public class I18n
extends java.lang.Object

Static Helper Class for reading messages from properties file.

Author:
mchaplin@users.sourceforge.net $Header: $Revision: $Date:

Constructor Summary
I18n()
           
 
Method Summary
static java.lang.String getMessage(java.lang.String propsFile, java.lang.String key)
          Retrieve a message in a properties file according to the given key
static java.lang.String getMessage(java.lang.String propsFile, java.lang.String key, java.lang.String locale)
          Retrieve a message in a properties file according to the given key & locale
static java.util.Map<java.lang.String,java.util.ResourceBundle> getMessageResources()
           
 void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

I18n

public I18n()
Method Detail

getMessage

public static java.lang.String getMessage(java.lang.String propsFile,
                                          java.lang.String key)
Retrieve a message in a properties file according to the given key

Parameters:
propsFile - name of the property file to load message from
key - name of the key identifying the message
Returns:
message identified by key or ""

getMessage

public static java.lang.String getMessage(java.lang.String propsFile,
                                          java.lang.String key,
                                          java.lang.String locale)
Retrieve a message in a properties file according to the given key & locale

Parameters:
propsFile - name of the property file to load message from
key - name of the key identifying the message
locale - ISO-639 locale to use
Returns:
message identified by key or ""

getMessageResources

public static java.util.Map<java.lang.String,java.util.ResourceBundle> getMessageResources()

reset

public void reset()
See Also:
net.mchaplin.ioc.ComponentI#reset()


Copyright © 2004-2005 mchaplin.net. All Rights Reserved.