com.atlassian.jira.web.bean
Class I18nBean

java.lang.Object
  extended bycom.atlassian.jira.web.bean.I18nBean
All Implemented Interfaces:
I18nHelper

public class I18nBean
extends Object
implements I18nHelper

Bean that searches for i18n text in JiraWebActionSupport.properties Can be used by Classes that do not inherit from JiraWebActionSupport (and hence don't have access to the getText()) Please note that getText() in this bean ONLY searches the JiraWebActionSupport.properties file.


Field Summary
 
Fields inherited from interface com.atlassian.jira.util.I18nHelper
DEFAULT_RESOURCE_BUNDLE
 
Constructor Summary
I18nBean()
           
I18nBean(Locale locale)
           
I18nBean(String localeStr)
           
I18nBean(User user)
           
I18nBean(User user, String additionalResourceBundle)
           
 
Method Summary
 ResourceBundle getDefaultResourceBundle()
           
 List getI18nLocations()
           
 Locale getLocale()
           
 String getText(String key)
           
 String getText(String key, Object parameters)
          A parameterised i18n'zed message
 String getText(String key, Object value1, Object value2, Object value3)
           
 String getText(String key, String value1)
           
 String getText(String key, String value1, String value2)
           
 String getText(String key, String value1, String value2, String value3)
           
 String getText(String key, String value1, String value2, String value3, String value4)
           
 String getText(String key, String value1, String value2, String value3, String value4, String value5, String value6, String value7, String value8, String value9)
           
 String getUnescapedText(String key)
          Get the raw property value, complete with {0}'s.
 boolean hasKey(String key)
          Returns true if a translation for the specified key is present.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

I18nBean

public I18nBean(User user)

I18nBean

public I18nBean()

I18nBean

public I18nBean(String localeStr)

I18nBean

public I18nBean(Locale locale)

I18nBean

public I18nBean(User user,
                String additionalResourceBundle)
Method Detail

getLocale

public Locale getLocale()
Specified by:
getLocale in interface I18nHelper

hasKey

public boolean hasKey(String key)
Returns true if a translation for the specified key is present. Useful for where a single key has replaced another (or perhaps a series), eg: #if ($i18n.hasKey("new.key") $i18n.getText("new.key", a, b) #else $i18n.getText("old.key") #end


getText

public String getText(String key)
Specified by:
getText in interface I18nHelper

getText

public String getText(String key,
                      String value1)
Specified by:
getText in interface I18nHelper

getText

public String getText(String key,
                      String value1,
                      String value2,
                      String value3,
                      String value4)

getText

public String getText(String key,
                      String value1,
                      String value2)
Specified by:
getText in interface I18nHelper

getText

public String getText(String key,
                      String value1,
                      String value2,
                      String value3)
Specified by:
getText in interface I18nHelper

getText

public String getText(String key,
                      Object value1,
                      Object value2,
                      Object value3)

getText

public String getText(String key,
                      String value1,
                      String value2,
                      String value3,
                      String value4,
                      String value5,
                      String value6,
                      String value7,
                      String value8,
                      String value9)
Specified by:
getText in interface I18nHelper

getText

public String getText(String key,
                      Object parameters)
A parameterised i18n'zed message

Specified by:
getText in interface I18nHelper
Parameters:
parameters - A single object, or array of objects, or list of objects

getUnescapedText

public String getUnescapedText(String key)
Get the raw property value, complete with {0}'s.

Parameters:
key - Non-null key to look up
Returns:
Unescaped property value for the key, or the key itself if no property with the specified key is found

getI18nLocations

public List getI18nLocations()

getDefaultResourceBundle

public ResourceBundle getDefaultResourceBundle()
Specified by:
getDefaultResourceBundle in interface I18nHelper


Copyright © 2002-2007 Atlassian. All Rights Reserved.