如何使用i18n工具动态翻译标题文字,如 i18next
.
目前我传递的标题是这样的,请问如何用i18next等i18n工具动态翻译标题文字?
Settings.options = {
topBar: {
title: {
text: 'Settings',
},
},
};
// get t function somewhere, i.e.
const t = i18next.t:
Settings.options = {
topBar: {
title: {
text: t('settings.title'),
},
},
};
在语言改变时,确保这部分代码再次执行......所以t()函数可以再次评估。