-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
nuxt-i18n.config.ts
75 lines (71 loc) · 1.43 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
import type { NuxtConfig } from '@nuxt/types'
import type { DateTimeFormat } from 'vue-i18n'
const dateTimeFormatsCommon: DateTimeFormat = {
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',
},
dateWithoutDay: {
year: 'numeric',
month: 'short',
},
dateWithDayOfWeek: {
weekday: 'short',
month: 'short',
day: 'numeric',
},
}
const options: NuxtConfig['i18n'] = {
strategy: 'prefix_except_default',
detectBrowserLanguage: false,
defaultLocale: 'ja',
vueI18n: {
fallbackLocale: 'ja',
formatFallbackMessages: true,
dateTimeFormats: {
ja: dateTimeFormatsCommon,
en: dateTimeFormatsCommon,
'ja-basic': dateTimeFormatsCommon,
},
},
// vueI18nLoader: true,
lazy: true,
langDir: 'assets/locales/',
locales: [
{
code: 'ja',
name: '日本語',
iso: 'ja-JP',
file: 'ja.json',
description: 'Japanese',
},
{
code: 'en',
name: 'English',
iso: 'en-US',
file: 'en.json',
description: 'English',
},
{
code: 'ja-basic',
name: 'やさしい にほんご',
iso: 'ja-JP',
file: 'ja-Hira.json',
description: 'Easy Japanese',
},
],
}
export default options