public class I18nAccess extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static Properties |
FAKE_I18N_FILE |
static String |
KEY_NOT_FOUND |
protected static Logger |
logger
create a static logger.
|
Modifier and Type | Method and Description |
---|---|
void |
changeViewLanguage(ContentContext ctx) |
void |
forceReloadEdit(GlobalContext globalContext,
javax.servlet.http.HttpSession session,
String lg) |
String |
getAllText(String key,
String defautlValue) |
String |
getComponentText(String componentPath,
String key) |
String |
getContentViewText(String key) |
String |
getContentViewText(String key,
String defaultValue) |
String |
getContextKey() |
Map |
getCountries() |
Map |
getCountries(ContentContext ctx) |
Module |
getCurrentModule() |
Map<String,String> |
getEdit() |
String |
getEditLg() |
String |
getHelpText(String key) |
Map<String,String> |
getHelpTranslation() |
static I18nAccess |
getInstance(ContentContext ctx) |
static I18nAccess |
getInstance(GlobalContext globalContext,
javax.servlet.http.HttpSession session) |
static I18nAccess |
getInstance(javax.servlet.http.HttpServletRequest request)
call this method in view mode (language can change at any click).
|
Collection<String> |
getMonths() |
Map<String,String> |
getRequestMap() |
String |
getTest() |
String |
getText(ContentContext ctx,
String key) |
String |
getText(String key) |
String |
getText(String key,
Map<?,?> balises)
replace the balise in text, value of balise is defined in the map. you can
defined a balise as : ${balise_name}, this balise is replace with the value
of balise name in the map. if the value is not found the balise is not
replaced.
|
String |
getText(String key,
String notFoundValue) |
String |
getText(String key,
String[][] balises)
replace the balise in text, value of balise is defined in the array. you can
defined a balise as : ${balise_name}, this balise is replace with the value
of balise name in the array. if the value is not found the balise is not
replaced.
|
Map<String,String> |
getView() |
String |
getViewText(String key) |
String |
getViewText(String key,
Map<?,?> balises)
replace the balise in text, value of balise is defined in the map. you can
defined a balise as : ${balise_name}, this balise is replace with the value
of balise name in the map. if the value is not found the balise is not
replaced.
|
String |
getViewText(String key,
String defaultValue) |
String |
getViewText(String key,
String[][] balises)
replace the balise in text, value of balise is defined in the array. you can
defined a balise as : ${balise_name}, this balise is replace with the value
of balise name in the array. if the value is not found the balise is not
replaced.
|
boolean |
isDisplayKey() |
static void |
main(String[] args) |
void |
requestInit(ContentContext ctx) |
void |
resetForceEditLg() |
void |
resetRequestMap() |
void |
resetViewLanguage(ContentContext ctx) |
void |
setContextKey(String contextKey) |
void |
setCurrentModule(GlobalContext globalContext,
javax.servlet.http.HttpSession session,
Module currentModule) |
void |
setRequestMap(Map<String,String> requestMap) |
protected static Logger logger
public static final Properties FAKE_I18N_FILE
public static final String KEY_NOT_FOUND
public static I18nAccess getInstance(ContentContext ctx) throws ServiceException, Exception
ServiceException
Exception
public static final I18nAccess getInstance(javax.servlet.http.HttpServletRequest request) throws FileNotFoundException, IOException
request
- the requestFileNotFoundException
IOException
ConfigurationException
public static final I18nAccess getInstance(GlobalContext globalContext, javax.servlet.http.HttpSession session) throws FileNotFoundException, IOException
session
- FileNotFoundException
IOException
ConfigurationException
public void setCurrentModule(GlobalContext globalContext, javax.servlet.http.HttpSession session, Module currentModule) throws IOException
IOException
public Module getCurrentModule()
public void changeViewLanguage(ContentContext ctx) throws ServiceException, Exception
ServiceException
Exception
public void resetViewLanguage(ContentContext ctx) throws ServiceException, Exception
ServiceException
Exception
public Map getCountries(ContentContext ctx) throws Exception
Exception
public static void main(String[] args)
public String getTest()
public String getText(ContentContext ctx, String key)
public String getText(String key, Map<?,?> balises)
key
- the key of i18n textbalises
- in map with [ balise_name, balise_value ]public String getText(String key, String[][] balises)
key
- the key of i18n textbalises
- in array with [ balise_name, balise_value ]public String getViewText(String key, Map<?,?> balises)
key
- the key of i18n textbalises
- in map with [ balise_name, balise_value ]public String getViewText(String key, String[][] balises)
key
- the key of i18n textbalises
- in array with [ balise_name, balise_value ]public String getEditLg()
public void resetForceEditLg()
public void forceReloadEdit(GlobalContext globalContext, javax.servlet.http.HttpSession session, String lg) throws IOException
IOException
public void requestInit(ContentContext ctx) throws Exception
Exception
public boolean isDisplayKey()
public String getContextKey()
public void setContextKey(String contextKey)
public Collection<String> getMonths()
public void resetRequestMap()
Copyright © 2012-2018. All Rights Reserved.