amis
amis copied to clipboard
JS SDK 多语言不生效
描述问题:
当使用 JS SDK 时,在 JSON 配置中设置多语言不生效。
截图或视频:
如何复现(请务必完整填写下面内容):
- 将项目 https://github.com/aisuda/amis-admin.git 克隆到本地,切换到 master 分支;
- 设置项目的 locale 为
en-US
;
index.html
let amisInstance = amis.embed(
'#root',
app,
{
location: history.location,
locale: 'en-US', // 设置 locale
}
)
- 更改 JSON schema 中的多语言配置;
pages/crud-new.json
{
type: 'text',
name: 'engine',
required: true,
inline: false,
description: '',
descriptionClassName: 'help-block',
placeholder: '',
addOn: null,
label: '引擎',
'en-US': {
label: 'engine', // locale 为 “en-US” 时应该匹配这个 label。
},
}
上述用法参考 https://aisuda.bce.baidu.com/amis/zh-CN/docs/extend/i18n#json-%E9%85%8D%E7%BD%AE%E4%B8%AD%E8%AE%BE%E7%BD%AE%E5%A4%9A%E8%AF%AD%E8%A8%80
期望:
使用 JS SDK 可以正常使用多语言功能。
👍 Thanks for this! 🏷 I have applied any labels matching special text in your issue.
Please review the labels and make any necessary changes.
+1
同问,这个问题解决了吗?