我们有一个 React 应用程序,其中所有小部件的标签都是从属性文件中读取的,
属性文件:
export const properties = {
dashboardcrumb_label: 'DASHBOARD',
channelcrumb_label: 'CHANNELS',
jobcard_header: 'JOBS',
cancel_label: 'CANCEL'
}
在 js 文件中的使用(示例):
import { properties } from '../../../../resources/label_property'
<FlatButton label={properties.cancel_label}
现在我们需要使其与 i18n 兼容。请建议一种更简单的方法来实现 i18n,我可以在 js 中没有太多更改的情况下重用这个属性文件