【发布时间】:2020-02-15 14:19:47
【问题描述】:
我正在使用react : coreui 的管理模板。为了翻译组件中的标签,我使用 react-intl。
我想翻译导航栏,它是一个简单的数组:
export default {
items: [
{
title: true,
name: 'ESSAI DOM',
},
{
name: 'Schools',
url: '/schools',
icon: 'fa fa-university'
},
.... other items...
],
};
我的翻译是在这样的 json 中(例如“法语”):
{
"Schools.Schools.title": "Ecoles"
}
在这个例子中,我想写这样的东西:
{
name : some_function(languageId, 'Schools.Schools.title'),
.....
}
我该怎么做?
【问题讨论】:
标签: reactjs react-intl core-ui