public class TranslatorUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CAPTION_PROPERTY |
static String |
EDITOR_TEMPLATES_NODETYPE |
static String |
EDITOR_TEMPLATESET_NODETYPE |
Modifier and Type | Method and Description |
---|---|
static Map<String,String> |
getCriteria(String key) |
static org.apache.wicket.model.IModel<String> |
getExceptionTranslation(org.apache.wicket.Component component,
Throwable t,
Object... parameters)
Create a model containing the translated message for the given exception and its parameters.
|
static javax.jcr.Node |
getTemplateNode(javax.jcr.Node typeNode)
Get the first node of type 'frontend:plugincluster' under the 'editor:templates' node
|
static org.apache.wicket.model.IModel |
getTranslatedModel(IPluginConfig translations,
Map<String,String> criteria) |
static IPluginConfig |
getTranslationsConfig(javax.jcr.Node typeNode)
Given the doc-type node at /hippo:namespaces/${projectName}/${docType}, return the i18n translation configurations
of the node type 'hippostd:translations' at ${docType-path}/editor:templates/${first-frontend:plugincluster}/${translator.id}
|
public static final String EDITOR_TEMPLATES_NODETYPE
public static final String EDITOR_TEMPLATESET_NODETYPE
public static final String CAPTION_PROPERTY
public static IPluginConfig getTranslationsConfig(javax.jcr.Node typeNode) throws TranslatorException
typeNode
- the node referring to a document type at /hippo:namespaces/${projectName}/${docType}TranslatorException
public static javax.jcr.Node getTemplateNode(javax.jcr.Node typeNode) throws TranslatorException
typeNode
- a node of type 'editor:templates'javax.jcr.RepositoryException
TranslatorException
- if either no child node of type 'frontend:plugincluster'
is found, typeNode
is null or not the type 'editor:templates'.public static org.apache.wicket.model.IModel getTranslatedModel(IPluginConfig translations, Map<String,String> criteria)
public static org.apache.wicket.model.IModel<String> getExceptionTranslation(org.apache.wicket.Component component, Throwable t, Object... parameters)
exception,type\=${exception-class-path},message\=${exception-message}=<your-localized-message>
component
- the component having translated resource filest
- the throwable exceptionparameters
- parameters used in the message template storing in resource filesCopyright © 2007–2015 Hippo B.V. (http://www.onehippo.com). All rights reserved.