juife
v0.1a

net.sf.juife
Class I18n

java.lang.Object
  extended by net.sf.juife.I18n
Direct Known Subclasses:
JuifeI18n

public class I18n
extends java.lang.Object

This class provides methods for managing the locale-specific data of a particular UI application or library.


Constructor Summary
I18n()
          Creates a new instance of I18n.
 
Method Summary
 java.lang.String getButtonLabel(java.lang.String key)
          Gets a button label for the given key.
 java.lang.String getButtonLabel(java.lang.String pattern, java.lang.Object... arguments)
          Formats a button label using the specified pattern and arguments.
 java.util.Locale getCurrentLocale()
          Gets the current locale.
 java.lang.String getError(java.lang.String key)
          Gets an error message for the given key.
 java.lang.String getError(java.lang.String pattern, java.lang.Object... arguments)
          Formats an error message using the specified pattern and arguments.
 java.lang.String getLabel(java.lang.String key)
          Gets a label for the given key.
 java.lang.String getLabel(java.lang.String pattern, java.lang.Object... arguments)
          Formats a label using the specified pattern and arguments.
 java.lang.String getLogMessage(java.lang.String key)
          Gets a log message for the given key.
 java.lang.String getLogMessage(java.lang.String pattern, java.lang.Object... arguments)
          Formats a log message using the specified pattern and arguments.
 java.lang.String getMenuLabel(java.lang.String key)
          Gets a menu label for the given key.
 java.lang.String getMenuLabel(java.lang.String pattern, java.lang.Object... arguments)
          Formats a menu label using the specified pattern and arguments.
 java.lang.String getMessage(java.lang.String key)
          Gets a message for the given key.
 java.lang.String getMessage(java.lang.String pattern, java.lang.Object... arguments)
          Formats a message using the specified pattern and arguments.
 void setButtonsBundle(java.lang.String baseName)
          Sets the resource bundle that will provide the button labels.
 void setCurrentLocale(java.lang.String language, java.lang.String country)
          Sets the current locale using the specified language and country.
 void setErrorsBundle(java.lang.String baseName)
          Sets the resource bundle that will provide the error messages.
 void setLabelsBundle(java.lang.String baseName)
          Sets the resource bundle that will provide the common labels.
 void setLogsBundle(java.lang.String baseName)
          Sets the resource bundle that will provide the log messages.
 void setMenusBundle(java.lang.String baseName)
          Sets the resource bundle that will provide the menu labels.
 void setMessagesBundle(java.lang.String baseName)
          Sets the resource bundle that will provide the common messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

I18n

public I18n()
Creates a new instance of I18n.

Method Detail

setCurrentLocale

public void setCurrentLocale(java.lang.String language,
                             java.lang.String country)
Sets the current locale using the specified language and country.

Parameters:
language - lowercase two-letter ISO-639 code.
country - uppercase two-letter ISO-3166 code.

getCurrentLocale

public java.util.Locale getCurrentLocale()
Gets the current locale.

Returns:
The current locale.

setButtonsBundle

public void setButtonsBundle(java.lang.String baseName)
Sets the resource bundle that will provide the button labels.

Parameters:
baseName - The base name of the resource bundle that will provide the button labels (a fully qualified class name).

setLabelsBundle

public void setLabelsBundle(java.lang.String baseName)
Sets the resource bundle that will provide the common labels.

Parameters:
baseName - The base name of the resource bundle that will provide the common labels (a fully qualified class name).

setMenusBundle

public void setMenusBundle(java.lang.String baseName)
Sets the resource bundle that will provide the menu labels.

Parameters:
baseName - The base name of the resource bundle that will provide the menu labels (a fully qualified class name).

setErrorsBundle

public void setErrorsBundle(java.lang.String baseName)
Sets the resource bundle that will provide the error messages.

Parameters:
baseName - The base name of the resource bundle that will provide the error messages (a fully qualified class name).

setMessagesBundle

public void setMessagesBundle(java.lang.String baseName)
Sets the resource bundle that will provide the common messages.

Parameters:
baseName - The base name of the resource bundle that will provide the common messages (a fully qualified class name).

setLogsBundle

public void setLogsBundle(java.lang.String baseName)
Sets the resource bundle that will provide the log messages.

Parameters:
baseName - The base name of the resource bundle that will provide the log messages (a fully qualified class name).

getButtonLabel

public java.lang.String getButtonLabel(java.lang.String key)
Gets a button label for the given key.

Parameters:
key - The key for the desired button label.
Returns:
The button label for the given key.

getButtonLabel

public java.lang.String getButtonLabel(java.lang.String pattern,
                                       java.lang.Object... arguments)
Formats a button label using the specified pattern and arguments.

Parameters:
pattern - The pattern for the desired button label.
arguments - The arguments to be used to format the button label.
Returns:
The button label for the given pattern and arguments.

getError

public java.lang.String getError(java.lang.String key)
Gets an error message for the given key.

Parameters:
key - The key for the desired error message.
Returns:
The error message for the given key.

getError

public java.lang.String getError(java.lang.String pattern,
                                 java.lang.Object... arguments)
Formats an error message using the specified pattern and arguments.

Parameters:
pattern - The pattern for the desired error message.
arguments - The arguments to be used to format the error message.
Returns:
The error message for the given pattern and arguments.

getLabel

public java.lang.String getLabel(java.lang.String key)
Gets a label for the given key.

Parameters:
key - The key for the desired label.
Returns:
The label for the given key.

getLabel

public java.lang.String getLabel(java.lang.String pattern,
                                 java.lang.Object... arguments)
Formats a label using the specified pattern and arguments.

Parameters:
pattern - The pattern for the desired label.
arguments - The arguments to be used to format the label.
Returns:
The label for the given pattern and arguments.

getLogMessage

public java.lang.String getLogMessage(java.lang.String key)
Gets a log message for the given key.

Parameters:
key - The key for the desired log message.
Returns:
The log message for the given key.

getLogMessage

public java.lang.String getLogMessage(java.lang.String pattern,
                                      java.lang.Object... arguments)
Formats a log message using the specified pattern and arguments.

Parameters:
pattern - The pattern for the desired log message.
arguments - The arguments to be used to format the log message.
Returns:
The log message for the given pattern and arguments.

getMenuLabel

public java.lang.String getMenuLabel(java.lang.String key)
Gets a menu label for the given key.

Parameters:
key - The key for the desired menu label.
Returns:
The menu label for the given key.

getMenuLabel

public java.lang.String getMenuLabel(java.lang.String pattern,
                                     java.lang.Object... arguments)
Formats a menu label using the specified pattern and arguments.

Parameters:
pattern - The pattern for the desired menu label.
arguments - The arguments to be used to format the menu label.
Returns:
The menu label for the given pattern and arguments.

getMessage

public java.lang.String getMessage(java.lang.String key)
Gets a message for the given key.

Parameters:
key - The key for the desired message.
Returns:
The message for the given key.

getMessage

public java.lang.String getMessage(java.lang.String pattern,
                                   java.lang.Object... arguments)
Formats a message using the specified pattern and arguments.

Parameters:
pattern - The pattern for the desired message.
arguments - The arguments to be used to format the message.
Returns:
The message for the given pattern and arguments.

juife
v0.1a

Copyright © 2005 Grigor Iliev. All rights reserved. SourceForge.net Logo