feat(frontend): setting next-i18next

This commit is contained in:
이강준
2022-12-09 09:20:37 +09:00
parent d516b295bf
commit 96ebe3e3d2
2 changed files with 38 additions and 3 deletions
+34
View File
@@ -0,0 +1,34 @@
// @ts-check
/**
* @type {import('next-i18next').UserConfig}
*/
module.exports = {
// https://www.i18next.com/overview/configuration-options#logging
debug: process.env.NODE_ENV === "development",
i18n: {
defaultLocale: "en",
locales: ["en", "de"],
},
/** To avoid issues when deploying to some paas (vercel...) */
// localePath:
// typeof window === "undefined"
// ? require("path").resolve("./public/locales")
// : "/locales",
localePath: (locale, namespace, missing) => {
const data = JSON.parse(
require("path").resolve(`./public/locales/${locale}.json`)
);
return data.default[namespace];
},
reloadOnPrerender: process.env.NODE_ENV === "development",
/**
* @link https://github.com/i18next/next-i18next#6-advanced-configuration
*/
// saveMissing: false,
// strictMode: true,
// serializeConfig: false,
// react: { useSuspense: false }
};