1
0
mirror of https://github.com/uetchy/namae.git synced 2025-03-17 04:30:31 +09:00
namae/next-i18next.config.js

32 lines
744 B
JavaScript
Raw Permalink Normal View History

2022-06-07 13:30:48 +09:00
const HttpBackend = require('i18next-http-backend/cjs');
const ChainedBackend = require('i18next-chained-backend').default;
const LocalStorageBackend = require('i18next-localstorage-backend').default;
module.exports = {
backend: {
backendOptions: [{ expirationTime: 60 * 60 * 1000 }, {}], // 1 hour
backends:
typeof window !== 'undefined' ? [LocalStorageBackend, HttpBackend] : [],
},
i18n: {
defaultNS: 'translation',
defaultLocale: 'en',
locales: [
'en',
'ja',
'de',
'fr',
'zh-Hans',
'zh-Hant',
'pt-BR',
'es',
'it',
'ru',
'nl',
'id',
],
},
serializeConfig: false,
use: typeof window !== 'undefined' ? [ChainedBackend] : [],
};