public class I18nHelper extends Object
I18n.t(String, Object...) method on some attributes.
Make sure to set an i18nable compiler to have his CompilerConfiguration.isI18nable() returning true.
| Modifier and Type | Field and Description |
|---|---|
static List<String> |
I18N_ATTRIBUTES |
protected static org.apache.commons.logging.Log |
log |
| Constructor and Description |
|---|
I18nHelper() |
| Modifier and Type | Method and Description |
|---|---|
static String |
addI18nInvocation(String widgetId,
String attributeName,
String attributeValueCode,
JAXXCompiler compiler)
Add the i18n on a attribute.
|
static String |
addI18nMnemonicInvocation(CompiledObject object,
String attributeName,
String attributeValueCode,
JAXXCompiler compiler)
Box a i18n key with code to be used as a i18n mnemonic.
|
static boolean |
isI18nableAttribute(String attributeName,
JAXXCompiler compiler)
FIXME We should use
JAXXEngine.getI18nProperty(ClassDescriptor) to obtain this value
Test if we have an active i18n attribute (says an i18n attribute on a i18neable compiler). |
static boolean |
isI18nAttribute(String attributeName)
FIXME We should use
JAXXEngine.getI18nProperty(ClassDescriptor) to obtain this value
Test if we have an i18n attribute. |
static void |
tryToRegisterI18nInvocation(JAXXCompiler compiler,
String code) |
public static boolean isI18nableAttribute(String attributeName, JAXXCompiler compiler)
JAXXEngine.getI18nProperty(ClassDescriptor) to obtain this value
Test if we have an active i18n attribute (says an i18n attribute on a i18neable compiler).attributeName - name of attribute to testcompiler - current used compiler (contains options)true if wa have an active i18n attribute, false otherwise.public static boolean isI18nAttribute(String attributeName)
JAXXEngine.getI18nProperty(ClassDescriptor) to obtain this value
Test if we have an i18n attribute.attributeName - name of attribute to testtrue if wa have an active i18n attribute, false otherwise.public static String addI18nInvocation(String widgetId, String attributeName, String attributeValueCode, JAXXCompiler compiler)
Note: Be ware : no test is done here to ensure we are on a i18neable attribute for an i18nable compiler.
Make sure with the method isI18nableAttribute(String, JAXXCompiler) returns
true before using this method.
widgetId - the id of the widgetattributeName - the name of the attributeattributeValueCode - the value code of the attribute valuecompiler - the current used compilepublic static String addI18nMnemonicInvocation(CompiledObject object, String attributeName, String attributeValueCode, JAXXCompiler compiler)
Note: Be ware : no test is done here to ensure we are on a i18neable attribute for an i18nable compiler.
object - the object to useattributeName - the name of the attributeattributeValueCode - the value code of the attribute valuecompiler - the current used compilepublic static void tryToRegisterI18nInvocation(JAXXCompiler compiler, String code)
Copyright © 2008–2017 Ultreia.io. All rights reserved.