mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 13:27:22 +00:00
feat(frontend): setting next-i18next
This commit is contained in:
@@ -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 }
|
||||||
|
};
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// next.config.js
|
const { i18n } = require("./next-i18next.config.js");
|
||||||
const nextTranslate = require("next-translate");
|
const nextTranslate = require("next-translate");
|
||||||
|
|
||||||
const ContentSecurityPolicy = `
|
const ContentSecurityPolicy = `
|
||||||
@@ -50,7 +50,7 @@ const securityHeaders = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
module.exports = nextTranslate({
|
module.exports = {
|
||||||
output: "standalone",
|
output: "standalone",
|
||||||
async headers() {
|
async headers() {
|
||||||
return [
|
return [
|
||||||
@@ -64,4 +64,5 @@ module.exports = nextTranslate({
|
|||||||
webpack: (config, { isServer, webpack }) => {
|
webpack: (config, { isServer, webpack }) => {
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
});
|
i18n,
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user