com.atlassian.jira.util.i18n
Class I18nTranslationModeImpl

java.lang.Object
  extended by com.atlassian.jira.util.i18n.I18nTranslationModeImpl
All Implemented Interfaces:
I18nTranslationMode

public class I18nTranslationModeImpl
extends Object
implements I18nTranslationMode

This implementation class can turn on the translations mode so that i18n produced messages get sent in a specially marked up way

Since:
4.3

Constructor Summary
I18nTranslationModeImpl()
          This uses a ThreadLocal under the covers so we don't care how many instances of us there are.
 
Method Summary
 boolean isTranslationMode()
           
 void setTranslationsModeOff()
          Turns off the i18n translations mode for this thread.
 void setTranslationsModeOn(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
          Attempts to turn on the i18n translations mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

I18nTranslationModeImpl

public I18nTranslationModeImpl()
This uses a ThreadLocal under the covers so we don't care how many instances of us there are.

We always set the thread local value to false on instantiation.

Method Detail

isTranslationMode

public boolean isTranslationMode()
Specified by:
isTranslationMode in interface I18nTranslationMode
Returns:
true if the I18n translations mode is on for this thread

setTranslationsModeOff

public void setTranslationsModeOff()
Description copied from interface: I18nTranslationMode
Turns off the i18n translations mode for this thread.

Specified by:
setTranslationsModeOff in interface I18nTranslationMode

setTranslationsModeOn

public void setTranslationsModeOn(javax.servlet.http.HttpServletRequest httpServletRequest,
                                  javax.servlet.http.HttpServletResponse httpServletResponse)
Description copied from interface: I18nTranslationMode
Attempts to turn on the i18n translations mode. JIRA may decide that its not sensible to turn it on

Specified by:
setTranslationsModeOn in interface I18nTranslationMode
Parameters:
httpServletRequest - the request in play
httpServletResponse - the response in play


Copyright © 2002-2013 Atlassian. All Rights Reserved.