Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const NextI18Next = require('next-i18next').default;
module.exports = new NextI18Next({
defaultLanguage: 'zh-CN',
otherLanguages: ['en-US', 'zh-CN'],
browserLanguageDetection: true,
whitelist: ['en-US', 'zh-CN', 'zh', 'en'],
localeSubpaths: 'foreign',
// debug: true,
});
const NextI18Next = require('next-i18next').default;
module.exports = new NextI18Next({
lng: 'en',
defaultLanguage: 'en',
otherLanguages: ['kr', 'cn', 'ru'],
// https://github.com/isaachinman/next-i18next/issues/523
localePath: typeof window === 'undefined' ? 'public/locales' : 'locales',
browserLanguageDetection: true,
debug: false,
});
const NextI18Next = require('next-i18next').default;
const { localeSubpaths } = require('next/config').default().publicRuntimeConfig;
const localeSubpathVariations = {
none: {},
foreign: {
de: 'de',
},
all: {
en: 'en',
de: 'de',
},
};
const nextI18Next = new NextI18Next({
otherLanguages: ['de'],
localeSubpaths: localeSubpathVariations[localeSubpaths],
});
if (process.env.NODE_ENV === 'development') {
const { applyClientHMR } = require('i18next-hmr');
applyClientHMR(nextI18Next.i18n);
}
module.exports = nextI18Next;
const NextI18Next = require("next-i18next").default;
const NextI18NextInstance = new NextI18Next({
defaultLanguage: "en",
otherLanguages: ["de"],
defaultNS: "translations",
browserLanguageDetection: false,
localePath: typeof window === "undefined" ? "public/locales" : "locales"
});
module.exports = NextI18NextInstance;
module.exports.withTranslation = NextI18NextInstance.withTranslation;
module.exports.appWithTranslation = NextI18NextInstance.appWithTranslation;
module.exports.useTranslation = NextI18NextInstance.useTranslation;
const NextI18Next = require('next-i18next').default
module.exports = new NextI18Next({ otherLanguages: ['de'] })
const NextI18Next = require('next-i18next').default;
const options = {
browserLanguageDetection: true,
serverLanguageDetection: true,
defaultNS: 'common',
defaultLanguage: 'en',
ignoreRoutes: ['/_next', '/static'],
otherLanguages: ['vi', 'ja'],
localePath: typeof window === 'undefined' ? 'public/static/locales' : 'static/locales',
localeStructure: '{{lng}}/{{ns}}',
localeSubpaths: {},
keySeparator: '::'
};
const nextI18NextInstance = new NextI18Next(options);
module.exports = { ...nextI18NextInstance };
const { localeSubpaths } = require('next/config').default().publicRuntimeConfig;
const EN = 'en';
const ES = 'es';
const localeSubpathMapping = {
none: {},
en: EN,
es: ES,
all: {
EN,
ES,
},
};
module.exports = new NextI18Next({
defaultNS: 'common',
defaultLanguage: 'es',
otherLanguages: [EN, ES],
localeSubpaths: localeSubpathMapping[localeSubpaths],
});
const NextI18Next = require('next-i18next').default;
module.exports = new NextI18Next({
defaultLanguage: 'en',
otherLanguages: ['fr', 'ar'],
localeSubpaths: {
en: 'en',
fr: 'fr',
ar: 'ar',
},
fallbackLng: 'en',
});
const NextI18Next = require('next-i18next').default
const { localeSubpaths } = require('next/config').default().publicRuntimeConfig
const localeSubpathVariations = {
none: {},
foreign: {
de: 'de',
},
all: {
en: 'en',
de: 'de',
},
}
module.exports = new NextI18Next({
otherLanguages: ['de'],
localeSubpaths: localeSubpathVariations[localeSubpaths],
})
const { localeSubpaths } = require('next/config').default().publicRuntimeConfig;
const NextI18Next = require('next-i18next').default;
module.exports = new NextI18Next({
defaultLanguage: 'en',
otherLanguages: ['de'],
localeSubpaths
});