I18nInfo 国际化信息
端下节点,国际化的全部信息。
1. 结构声明
- TS Declaration
- JSON Schema
class I18nInfo extends BaseNode {
enabled: boolean;
locale: string;
messages: Map<string, Map<string, string>>;
}
{
"type": "object",
"properties": {
"composedBy": {
"type": "array",
"items": {
"type": "string"
}
},
"enabled": {
"type": "boolean"
},
"locale": {
"type": "string"
},
"messages": {
"type": "object",
"properties": {
"size": {
"type": "number"
}
},
"required": [
"size"
],
"additionalProperties": false
}
},
"required": [
"enabled",
"locale",
"messages"
],
"additionalProperties": false
}
2. 节点示例
(1) 示例
AST 如下:
- JSON
- YAML
{
"concept": "I18nInfo",
"enabled": true,
"locale": "zh-CN",
"messages": {
"en-US": {
"key1": "Loading...",
"key2": "Failed to load. Please try again",
"key3": "No data",
"key4": "Load more",
"key5": "No more items"
},
"zh-CN": {
"key1": "正在加载中...",
"key2": "加载失败,请重试",
"key3": "暂无数据",
"key4": "加载更多",
"key5": "没有更多了"
}
}
}
concept: I18nInfo
enabled: true
locale: zh-CN
messages:
en-US:
key1: Loading...
key2: Failed to load. Please try again
key3: No data
key4: Load more
key5: No more items
zh-CN:
key1: 正在加载中...
key2: 加载失败,请重试
key3: 暂无数据
key4: 加载更多
key5: 没有更多了
对应的代码如下:
- 文本化 NASL
[编译方法未实现]