public class XItemPropertyI18NUtils extends Object
Constructor and Description |
---|
XItemPropertyI18NUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
getBestLanguage(IXFormRenderConfig config,
com.alibaba.fastjson.JSONObject object,
String propName)
Given a language, searches for the closest language with an available translation for the given form element
property.
|
static String |
getI18NValue(IXFormRenderConfig config,
com.alibaba.fastjson.JSONObject json,
String defaultValue,
XPropertyEnum property) |
static String |
getI18NValue(XItem xitem,
IXFormRenderConfig config,
XPropertyEnum xProperty) |
static String |
getI18NValueR(IXFormRenderConfig config,
com.alibaba.fastjson.JSONObject json,
String defaultValue,
XPropertyEnum property) |
static String |
getI18NValueR(IXFormRenderConfig config,
String property,
String defaultValue,
XItemRenderData properties) |
static String |
getI18NValueR(IXFormRenderConfig config,
XPropertyEnum property,
String defaultValue,
XItemRenderData properties) |
static String |
replaceI18NAndEmptyValue(String value,
IXFormRenderConfig config) |
public static String replaceI18NAndEmptyValue(String value, IXFormRenderConfig config)
public static String getBestLanguage(IXFormRenderConfig config, com.alibaba.fastjson.JSONObject object, String propName)
fr-CA
, this method first checks
whether a translation is available for that language. If so, that language is returned. Otherwise, this method
checks whether a translation is available for the language tag fr
. If none is available either, the empty
string is returned.config
- A form configuration with a language tag.object
- A JSON object with the language tag as the key and another JSON object as the value. These JSON
objects have the property name as the key and the localized text as the value.propName
- Name of the (form element) property for which to find the localized text.public static String getI18NValueR(IXFormRenderConfig config, XPropertyEnum property, String defaultValue, XItemRenderData properties)
public static String getI18NValueR(IXFormRenderConfig config, String property, String defaultValue, XItemRenderData properties)
public static String getI18NValueR(IXFormRenderConfig config, com.alibaba.fastjson.JSONObject json, String defaultValue, XPropertyEnum property)
public static String getI18NValue(XItem xitem, IXFormRenderConfig config, XPropertyEnum xProperty)
public static String getI18NValue(IXFormRenderConfig config, com.alibaba.fastjson.JSONObject json, String defaultValue, XPropertyEnum property)
Copyright © 2021 XIMA MEDIA GmbH. All rights reserved.