{
id: 5,
modifiedAt: new Date('2017-02-22T09:50:50.212+0100'),
name: 'Module name',
version: '1.0.0',
definition: {
preconditions: {},
actions: {},
effects: {},
fieldDefinitions: {
room: {
title: 'Field title for "room"',
warning: 'Room is missing',
helpText: 'Enter room id/name',
type: 'string',
isRequired: true,
},
ui: {
title: 'Module title, i.e. title on input form',
menuItem: {
iconName: 'md-settings',
iconLibrary: 'Ionicons',
iconColor: null,
sortOrder: 99,
},
sections: [
{
id: 'ed472749-ec3d-4b72-9ce9-f88ee703b2cf',
title: 'Installation',
isRequired: true,
formFields: ['room', ...],
},
{
id: 'c070bfdf-88f1-423a-8854-b47b154c2359',
title: 'Photo before started repair',
isRequired: true,
sectionType: 'media',
}
],
},
},
jsonSchema: {
//schema to validate form output before saving
//also used by API before saving to database
},
i18n: {
en: {
},
de: {
}
}
};
我正在考虑使用react-i18next,因为它似乎有很好的文档记录,并且在我需要翻译我的Express站点时也会起作用。
我还考虑给每个模块一个唯一的guid,当应用程序加载每个i18n文件时,我可以将其用作命名空间id。
这是模块化i18n文件的合理方式吗?
我搜索了i18n教程,但最终只找到了特定语言的教程。有谁能推荐一本i18n入门书,并对选择何种结构、如何使用名称空间、如何模块化等进行充分讨论吗。