next-i18next可以工作,但不能在Safari上运行。
我甚至在我们的Next.js应用程序中设置了区域本地化,因为Safari通常不会传递hu,而会传递hu-hu。我不会为地区差异创建单独的翻译json。因此,hu和hu-hu都应该使用子文件夹中的匈牙利JSON。但奇怪的是,当在Safari中打开站点时,却加载了英语。为什么?我是不是用错了什么?有了i18next,一切都变好了。甚至defaultLocale也被设置为hu。
const { nextI18NextRewrites } = require("next-i18next/rewrites");
const localeSubpaths = {
hu: "hu",
"hu-hu": "hu",
"hu-HU": "hu",
en: "en",
};
module.exports = {
rewrites: async () => nextI18NextRewrites(localeSubpaths),
publicRuntimeConfig: {
localeSubpaths,
},
images: {
domains: ["ticket-t01.s3.eu-central-1.amazonaws.com"],
},
defaultLocale: "hu",
};发布于 2021-08-31 07:15:13
尝试使用参数:
load : 'languageOnly'https://stackoverflow.com/questions/66171635
复制相似问题