Skip to content

Commit 8dd029d

Browse files
committed
chore: upgrade to nuxtjs/i18n v9
1 parent f792b5c commit 8dd029d

File tree

9 files changed

+871
-999
lines changed

9 files changed

+871
-999
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"i18n-ally.keystyle": "nested",
77
"i18n-ally.localesPaths": [
8-
"app/locales"
8+
"i18n/locales"
99
],
1010
"i18n-ally.sourceLanguage": "zh-CN",
1111
"i18n-ally.displayLanguage": "zh-CN",

app/plugins/i18n.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { Locale } from 'vant'
22
import enUS from 'vant/es/locale/lang/en-US'
33
import zhCN from 'vant/es/locale/lang/zh-CN'
44

5+
type AppLocale = 'zh-CN' | 'en-US'
6+
57
export default defineNuxtPlugin(() => {
68
// 载入 vant 语言包
79
Locale.use('zh-CN', zhCN)
@@ -14,7 +16,7 @@ export default defineNuxtPlugin(() => {
1416
const lang = localStorage.getItem('lang')
1517

1618
if (lang) {
17-
setLocale(lang)
19+
setLocale(lang as AppLocale)
1820
Locale.use(lang)
1921
}
2022
else {
File renamed without changes.

nuxt.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { currentLocales } from './app/config/i18n'
21
import { appDescription } from './app/constants/index'
2+
import { currentLocales } from './i18n/i18n'
33

44
export default defineNuxtConfig({
55
modules: [
@@ -53,7 +53,7 @@ export default defineNuxtConfig({
5353
detectBrowserLanguage: false,
5454
langDir: 'locales',
5555
defaultLocale: 'zh-CN',
56-
vueI18n: './app/config/i18n.config.ts',
56+
vueI18n: './i18n/i18n.config.ts',
5757
},
5858

5959
app: {

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nuxt-vant-mobile",
33
"type": "module",
44
"private": true,
5-
"packageManager": "pnpm@9.13.0",
5+
"packageManager": "pnpm@9.14.2",
66
"scripts": {
77
"build": "nuxt build",
88
"dev": "nuxt dev",
@@ -15,18 +15,18 @@
1515
},
1616
"dependencies": {
1717
"@nuxtjs/color-mode": "^3.5.2",
18-
"@nuxtjs/i18n": "^8.5.5",
19-
"nuxt": "^3.14.159",
18+
"@nuxtjs/i18n": "^9.1.0",
19+
"nuxt": "^3.14.1592",
2020
"pinia-plugin-persistedstate": "^4.1.3",
2121
"vue": "^3.5.13",
22-
"vue-router": "^4.4.5"
22+
"vue-router": "^4.5.0"
2323
},
2424
"devDependencies": {
25-
"@antfu/eslint-config": "^3.9.1",
26-
"@commitlint/cli": "^19.5.0",
27-
"@commitlint/config-conventional": "^19.5.0",
25+
"@antfu/eslint-config": "^3.10.0",
26+
"@commitlint/cli": "^19.6.0",
27+
"@commitlint/config-conventional": "^19.6.0",
2828
"@iconify-json/carbon": "^1.2.4",
29-
"@nuxt/eslint": "^0.7.0",
29+
"@nuxt/eslint": "^0.7.2",
3030
"@pinia/nuxt": "^0.7.0",
3131
"@unocss/eslint-plugin": "^0.64.1",
3232
"@unocss/nuxt": "^0.64.1",
@@ -35,7 +35,7 @@
3535
"eslint": "^9.15.0",
3636
"eslint-plugin-format": "^0.1.2",
3737
"lint-staged": "^15.2.10",
38-
"postcss-mobile-forever": "^4.2.4",
38+
"postcss-mobile-forever": "^4.3.0",
3939
"simple-git-hooks": "^2.11.1",
4040
"typescript": "^5.6.3",
4141
"vant": "^4.9.9",

pnpm-lock.yaml

Lines changed: 856 additions & 986 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)