forked from nuxt-modules/i18n
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.ts
117 lines (115 loc) · 2.55 KB
/
nuxt.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import Module1 from './module1'
import LayerModule from './layer-module'
import type { NuxtApp } from 'nuxt/dist/app/index'
// https://nuxt.com/docs/guide/directory-structure/nuxt.config
export default defineNuxtConfig({
extends: ['layers/i18n-layer'],
modules: [
(_, nuxt) => {
console.log(nuxt.options._installedModules)
},
Module1,
LayerModule,
'@nuxtjs/i18n',
'@nuxt/devtools'
],
vite: {
build: {
minify: false
}
},
// app: {
// pageTransition: {
// name: 'foo',
// onBeforeEnter: async (...args: unknown[]) => {
// console.log('global onBeforeEnter', ...args)
// }
// }
// },
debug: false,
i18n: {
experimental: {
jsTsFormatResource: true
},
precompile: {
strictMessage: false,
escapeHtml: true
},
langDir: 'locales',
lazy: true,
baseUrl: 'http://localhost:3000',
locales: [
{
code: 'en',
iso: 'en-US',
file: 'en.json',
// domain: 'localhost',
name: 'English'
},
{
code: 'en-GB',
iso: 'en-GB',
files: ['en.json', 'en-GB.js'],
name: 'English (UK)'
},
{
code: 'ja',
iso: 'ja-JP',
file: 'ja.ts',
domain: 'mydomain.com',
name: 'Japanses'
},
{
code: 'fr',
iso: 'fr-FR',
file: 'fr.json',
domain: 'mydomain.fr',
name: 'Français'
}
],
// trailingSlash: true,
debug: false,
defaultLocale: 'en',
// strategy: 'no_prefix',
// strategy: 'prefix',
// strategy: 'prefix_and_default',
strategy: 'prefix_except_default',
// rootRedirect: '/ja/about-ja',
dynamicRouteParams: true,
// customRoutes: 'config',
pages: {
history: {
ja: '/history-ja'
},
about: {
ja: '/about-ja'
}
},
// differentDomains: true,
// skipSettingLocaleOnNavigate: true,
// detectBrowserLanguage: false,
detectBrowserLanguage: {
useCookie: true
// alwaysRedirect: true
// cookieKey: 'i18n_redirected',
// // cookieKey: 'my_custom_cookie_name',
// redirectOn: 'root'
},
// vueI18n: './vue-i18n.options.ts'
vueI18n: {
legacy: false,
locale: 'en',
fallbackLocale: 'fr'
// messages: {
// ja: {
// hello: 'こんにちは!'
// }
// }
// fallbackLocale: {
// en: ['ja', 'fr', 'en-US'],
// ja: ['en', 'fr', 'ja-JP'],
// fr: ['en', 'ja', 'fr-FR']
// }
}
}
})