This repository has been archived by the owner on Mar 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
nuxt-i18n.config.ts
103 lines (100 loc) · 2.1 KB
/
nuxt-i18n.config.ts
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import type { NuxtVueI18n } from 'nuxt-i18n'
const dateTimeFormatsCommon = {
dateTime: {
year: 'numeric',
month: 'short',
day: 'numeric',
hour: 'numeric',
minute: 'numeric',
hour12: false,
},
date: {
year: 'numeric',
month: 'short',
day: 'numeric',
},
dateWithoutYear: {
month: 'long',
day: 'numeric',
},
dateWithDayOfWeek: {
weekday: 'short',
month: 'short',
day: 'numeric',
},
}
const options: NuxtVueI18n.Options.AllOptionsInterface = {
strategy: 'prefix_except_default',
detectBrowserLanguage: false,
defaultLocale: 'ja',
vueI18n: {
fallbackLocale: 'ja',
dateTimeFormats: {
ja: dateTimeFormatsCommon,
en: dateTimeFormatsCommon,
'zh-cn': dateTimeFormatsCommon,
'zh-tw': dateTimeFormatsCommon,
ko: dateTimeFormatsCommon,
'ja-basic': dateTimeFormatsCommon,
},
formatFallbackMessages: true,
},
// vueI18nLoader: true,
lazy: true,
langDir: 'assets/locales-mixed/',
locales: [
{
code: 'ja',
name: '日本語',
iso: 'ja-JP',
file: 'ja.js',
description: 'Japanese',
},
{
code: 'en',
name: 'English',
iso: 'en-US',
file: 'en.js',
description: 'English',
},
{
code: 'zh-cn',
name: '简体中文',
iso: 'zh-CN',
file: 'zh_CN.js',
description: 'Simplified Chinese',
},
{
code: 'zh-tw',
name: '繁體中文',
iso: 'zh-TW',
file: 'zh_TW.js',
description: 'Traditional Chinese',
},
{
code: 'ko',
name: '한국어',
iso: 'ko-KR',
file: 'ko.js',
description: 'Korean',
},
// #1126, #872 (comment)
// ポルトガル語は訳が揃っていないため非表示
// {
// code: 'pt-BR',
// name: 'Portuguese',
// iso: 'pt-BR',
// file: 'pt_BR.js',
// description: 'Portuguese'
// },
{
code: 'ja-basic',
name: 'やさしい にほんご',
iso: 'ja-JP',
file: 'ja-Hira.js',
description: 'Easy Japanese',
},
],
seo: false,
}
export default options