v6破坏性更新
vite-plugin-i18n-ally/client
i18nAlly
现在是一个类,且命名更改为I18nAllyClient
,而不是一个函数。你需要使用new
来创建一个实例allLanguages
/allNamespaces
重命名为supportedLngs
/supportedNs
onInit
重命名为onBeforeInit
language
/languages
重命名为lng
/lngs
namespace
/namespaces
重命名为ns
getLanguages
/getNamespaces
重命名为getSupportedLngs
/getSupportedNs
命名偏向 i18next
,以便于更好的兼容性。
vite-plugin-i18n-ally/server
这是v6新增的功能,支持在服务端使用 i18n-ally
来获取国际化资源,并且提供了基于 request cookie
的语言探测功能