名称的国际化设置¶
EnOS 对名称类字段,提供国际化支持,包括但不限于以下名称类字段:
模型名称

服务输入参数及输出参数

产品名称

资产树名称

告警类型描述

对于适用国际化的字段,EnOS 提供 默认(Default) 名称供填写。点击默认名称输入框中的 进入 国际化 弹窗。你可以在这里继续编辑 默认(Default) 名称,或根据需要编辑 英语(en-US) 名称、中文(zh-CN) 名称。

如果你设置了国际化字段,EnOS 展示的名称与当前的语言环境保持一致:即中文环境显示中文的名称,英文环境显示英文的名称,如果缺少对应语言的名称则显示默认名称;如果你没有设置任何国际化字段,显示默认名称。
EnOS API 中的国际化字段¶
在请求参数和返回结果中,使用国际化名称结构体表示国际化的名称。
名称 |
数据类型 |
描述 |
---|---|---|
defaultValue |
String |
默认名称 |
i18nValue |
Map(Key 为 String,Value 为 String) |
各个 Locale 下的名称,key 为 locale,value 为各个 locale 下的名称。 |
defaultValue
指,当使用的 locale
未在 i18nValue
中指定时,应当采用的名称。locale
格式遵循 Unicode locale identifier,例如 “en_US”。有关更多信息,请参阅https://www.unicode.org/reports/tr35/tr35-55/tr35.html#BCP_47_Language_Tag_Conversion。
示例:
{
"defaultValue": "Turbine",
"i18nValue": {"zh_CN": "风机", "en_US": "Turbine"}
}
以上示例表示,当使用的 locale
为 “zh_CN” 时,名称为“风机”,当使用的 locale
为 “en_US” 时,名称为 “Turbine”,当使用其他 locale
时,名称为 “Turbine”。