-
Notifications
You must be signed in to change notification settings - Fork 2
/
next-i18next.config.js
44 lines (42 loc) · 1.17 KB
/
next-i18next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const languages = [
{ code: 'fi', text: 'Suomi' },
{ code: 'sv', text: 'Svenska' },
{ code: 'en', text: 'English' },
{ code: 'ru', text: 'Pусский' },
{ code: 'et', text: 'Eesti keel' },
{ code: 'uk', text: 'Українська' },
{ code: 'fr', text: 'Français' },
{ code: 'so', text: 'Soomaali' },
{ code: 'es', text: 'Español' },
{ code: 'tr', text: 'Türkçe' },
{ code: 'zh', text: '中文' },
{ code: 'fa', text: ' فارسی' },
{ code: 'ar', text: 'العربية' },
]
const rtlLocales = ['ar', 'fa']
const disabledLocales = ['so']
const locales = languages.map(({ code }) => code)
const supportedLanguages = languages.filter(
({ code }) => !disabledLocales.includes(code)
)
const supportedLocales = locales.filter(
(code) => !disabledLocales.includes(code)
)
const DIRECTION_LTR = 'ltr'
const DIRECTION_RTL = 'rtl'
module.exports = {
i18n: {
reloadOnPrerender: process.env.NODE_ENV === 'development',
locales,
languages,
disabledLocales,
supportedLocales,
supportedLanguages,
rtlLocales,
defaultLocale: 'en',
fallbackLocale: 'fi',
DIRECTION_LTR,
DIRECTION_RTL,
// localeDetection: false,
},
}