next-intl选择基于XML的值不起作用

gblwokeq  于 9个月前  发布在  其他
关注(0)|答案(1)|浏览(132)

我需要为我的next.js项目(nextjs v13.4)进行next-intl翻译。https://next-intl-docs.vercel.app/docs/usage/messages#selecting-enum-based-values
其中指出
(in文件en.json)

"message": "{gender, select, female {She} male {He} other {They}} is online."

字符串
和(代替使用)

t('message', {gender: 'female'});


由于某种原因,它没有工作,没有阅读翻译信息好吗?

xqnpmsa8

xqnpmsa81#

如果我有另一个翻译文件,

sr.json(塞尔维亚语)

等价的值(对于相同的键)也必须包含在该文件中,就像在en.json文件中一样,为了使其在语言中工作,应该没有区别。
比如:

"message": "{gender, select, female {Она} male {Oн} other {Oни}} је на мрежи."

字符串

相关问题