forked from giscus/giscus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
i18n.js
48 lines (45 loc) · 799 Bytes
/
i18n.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
45
46
47
48
const fallbacks = {
gsw: 'de',
'zh-Hans': 'zh-CN',
'zh-Hant': 'zh-TW',
};
const workaround = require('next-translate/lib/cjs/plugin/utils.js');
// https://github.com/aralroca/next-translate/issues/851#issuecomment-1173611946
workaround.defaultLoader = `
(l, n) => {
const lang = ${JSON.stringify(fallbacks)}[l] ?? l;
return import(\`@next-translate-root/locales/\${lang}/\${n}\`).then(m => m.default);
}
`;
module.exports = {
locales: [
'ar',
'de',
'en',
'es',
'fr',
'gsw',
'id',
'it',
'ja',
'ko',
'nl',
'pl',
'pt',
'ro',
'ru',
'th',
'tr',
'vi',
'zh-CN',
'zh-Hans',
'zh-Hant',
'zh-TW',
],
fallbacks,
defaultLocale: 'en',
pages: {
'*': ['common'],
'/': ['config'],
},
};