Skip to content

Commit 615c176

Browse files
author
Clovis
committed
chore: revert "chore: use latest i18n v9 (elk-zone#3059)"
This reverts commit f4b667f.
1 parent 3239258 commit 615c176

File tree

8 files changed

+50
-31
lines changed

8 files changed

+50
-31
lines changed

elk/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ We've added some `UnoCSS` utilities styles to help you with that:
9090

9191
## Internationalization
9292

93-
We are using [vue-i18n](https://vue-i18n.intlify.dev/) via [nuxt-i18n](https://i18n.nuxtjs.org/) to handle internationalization.
93+
We are using [vue-i18n](https://vue-i18n.intlify.dev/) via [nuxt-i18n](https://v8.i18n.nuxtjs.org/) to handle internationalization.
9494

9595
You can check the current [translation status](https://docs.elk.zone/docs/guide/contributing#translation-status): more instructions on the table caption.
9696

elk/config/i18n.ts

-5
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,11 @@ export const countryLocaleVariants: Record<string, (LocaleObjectData & { country
7575

7676
const locales: LocaleObjectData[] = [
7777
{
78-
// @ts-expect-error en used as placeholder
7978
code: 'en',
8079
file: 'en.json',
8180
name: 'English',
8281
},
8382
({
84-
// @ts-expect-error ar used as placeholder
8583
code: 'ar',
8684
file: 'ar.json',
8785
name: 'العربية',
@@ -112,7 +110,6 @@ const locales: LocaleObjectData[] = [
112110
},
113111
} satisfies LocaleObjectData),
114112
{
115-
// @ts-expect-error ca used as placeholder
116113
code: 'ca',
117114
file: 'ca.json',
118115
name: 'Català',
@@ -153,7 +150,6 @@ const locales: LocaleObjectData[] = [
153150
name: 'Nederlands',
154151
},
155152
{
156-
// @ts-expect-error es used as placeholder
157153
code: 'es',
158154
file: 'es.json',
159155
name: 'Español',
@@ -207,7 +203,6 @@ const locales: LocaleObjectData[] = [
207203
},
208204
},
209205
{
210-
// @ts-expect-error pt used as placeholder
211206
code: 'pt',
212207
file: 'pt.json',
213208
name: 'Português',

elk/netlify.toml

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
publish = "dist"
33
command = "pnpm run build"
44

5-
[build.environment]
6-
NODE_OPTIONS = '--max-old-space-size=4096'
7-
85
# Redirect to Discord server
96
[[redirects]]
107
from = "https://chat.elk.zone"

elk/nuxt.config.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,8 @@ export default defineNuxtConfig({
311311
lazy: true,
312312
strategy: 'no_prefix',
313313
detectBrowserLanguage: false,
314-
// relative to i18n dir on rootDir: not yet v4 compat layout
315-
langDir: '../locales',
314+
langDir: 'locales',
316315
defaultLocale: 'en-US',
317-
experimental: {
318-
generatedLocaleFilePathFormat: 'relative',
319-
},
320316
vueI18n: './config/i18n.config.ts',
321317
},
322318
pwa,

elk/package.json

+21-13
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
"@nuxt/devtools": "^1.5.2",
4040
"@nuxt/test-utils": "^3.14.3",
4141
"@nuxtjs/color-mode": "^3.4.4",
42-
"@nuxtjs/i18n": "^9.1.0",
43-
"@pinia/nuxt": "^0.7.0",
42+
"@nuxtjs/i18n": "^8.5.3",
43+
"@pinia/nuxt": "^0.5.4",
4444
"@tiptap/core": "2.2.4",
4545
"@tiptap/extension-bold": "2.2.4",
4646
"@tiptap/extension-character-count": "2.2.4",
@@ -55,9 +55,9 @@
5555
"@tiptap/starter-kit": "2.2.4",
5656
"@tiptap/suggestion": "2.2.4",
5757
"@tiptap/vue-3": "2.2.4",
58-
"@unocss/nuxt": "^0.64.0",
58+
"@unocss/nuxt": "^0.63.6",
5959
"@upstash/redis": "^1.27.1",
60-
"@vercel/kv": "^3.0.0",
60+
"@vercel/kv": "^2.0.0",
6161
"@vue-macros/nuxt": "^1.11.12",
6262
"@vueuse/core": "^11.0.3",
6363
"@vueuse/gesture": "^2.0.0",
@@ -84,15 +84,15 @@
8484
"lru-cache": "^11.0.0",
8585
"masto": "^6.10.1",
8686
"node-emoji": "^2.1.3",
87-
"nuxt-security": "^2.0.0",
87+
"nuxt-security": "^1.4.3",
8888
"page-lifecycle": "^0.1.2",
89-
"pinia": "^2.2.6",
90-
"postcss-nested": "^7.0.0",
89+
"pinia": "^2.2.2",
90+
"postcss-nested": "^6.0.1",
9191
"prosemirror-highlight": "^0.9.0",
9292
"rollup-plugin-node-polyfills": "^0.2.1",
9393
"shiki": "^1.22.2",
9494
"simple-git": "^3.19.1",
95-
"slimeform": "^0.10.0",
95+
"slimeform": "^0.9.1",
9696
"stale-dep": "^0.7.0",
9797
"std-env": "^3.7.0",
9898
"string-length": "^5.0.1",
@@ -104,16 +104,16 @@
104104
"ufo": "^1.5.3",
105105
"ultrahtml": "^1.5.3",
106106
"unimport": "^3.10.0",
107-
"vite-plugin-pwa": "^0.21.0",
107+
"vite-plugin-pwa": "^0.20.5",
108108
"vue-advanced-cropper": "^2.8.9",
109109
"vue-virtual-scroller": "2.0.0-beta.8",
110110
"workbox-build": "^7.1.1",
111111
"workbox-window": "^7.1.0",
112112
"ws": "^8.15.1"
113113
},
114114
"devDependencies": {
115-
"@antfu/eslint-config": "^3.9.2",
116-
"@antfu/ni": "^0.23.1",
115+
"@antfu/eslint-config": "^3.9.1",
116+
"@antfu/ni": "^0.23.0",
117117
"@nuxt/schema": "^3.14.1592",
118118
"@types/chroma-js": "^2.4.4",
119119
"@types/file-saver": "^2.0.7",
@@ -132,7 +132,7 @@
132132
"flat": "^6.0.1",
133133
"fs-extra": "^11.2.0",
134134
"lint-staged": "^15.2.10",
135-
"nuxt": "^3.14.1592",
135+
"nuxt": "^3.14.159",
136136
"prettier": "^3.3.3",
137137
"sharp": "^0.33.5",
138138
"sharp-ico": "^0.1.5",
@@ -142,6 +142,14 @@
142142
"vitest": "2.1.5",
143143
"vue-tsc": "^2.1.6"
144144
},
145+
"pnpm": {
146+
"patchedDependencies": {
147+
"pinceau": "patches/pinceau.patch",
148+
"vue-i18n": "patches/vue-i18n.patch",
149+
"nuxt-security": "patches/nuxt-security.patch",
150+
"nuxt": "patches/nuxt.patch"
151+
}
152+
},
145153
"resolutions": {
146154
"nuxt-component-meta": "0.9.0",
147155
"unstorage": "^1.13.1",
@@ -154,4 +162,4 @@
154162
"lint-staged": {
155163
"*": "eslint --fix"
156164
}
157-
}
165+
}

elk/plugins/setup-i18n.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import type { Locale } from '#i18n'
2-
31
export default defineNuxtPlugin(async (nuxt) => {
42
const t = nuxt.vueApp.config.globalProperties.$t
53
const d = nuxt.vueApp.config.globalProperties.$d
@@ -13,14 +11,14 @@ export default defineNuxtPlugin(async (nuxt) => {
1311
const i18n = useNuxtApp().$i18n
1412
const { setLocale, locales } = i18n
1513
const userSettings = useUserSettings()
16-
const lang = computed(() => userSettings.value.language as Locale)
14+
const lang = computed(() => userSettings.value.language)
1715

1816
const supportLanguages = unref(locales).map(locale => locale.code)
1917
if (!supportLanguages.includes(lang.value))
2018
userSettings.value.language = getDefaultLanguage(supportLanguages)
2119

2220
if (lang.value !== i18n.locale)
23-
await setLocale(userSettings.value.language as Locale)
21+
await setLocale(userSettings.value.language)
2422

2523
watch([lang, isHydrated], () => {
2624
if (isHydrated.value && lang.value !== i18n.locale)

patches/nuxt.patch

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/dist/index.mjs b/dist/index.mjs
2+
index a5c61adc0c21b5df5b1a3ffcf81d2469c7f96873..9241cf294b398b43a4a5555f39746a6c844d0b0f 100644
3+
--- a/dist/index.mjs
4+
+++ b/dist/index.mjs
5+
@@ -2183,6 +2183,7 @@ function createTransformPlugin(nuxt, getComponents, mode) {
6+
}
7+
return createUnplugin(() => ({
8+
name: "nuxt:components:imports",
9+
+ enforce: "post",
10+
transformInclude(id) {
11+
id = normalize(id);
12+
return id.startsWith("virtual:") || id.startsWith("\0virtual:") || id.startsWith(nuxt.options.buildDir) || !isIgnored(id);

patches/vue-i18n.patch

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/dist/vue-i18n.d.ts b/dist/vue-i18n.d.ts
2+
index 8d5c4fc0e551ab3beccfcaa67764818a2c4c6756..0cee95f214e03add239d3df5e91ad2a8a154ac1e 100644
3+
--- a/dist/vue-i18n.d.ts
4+
+++ b/dist/vue-i18n.d.ts
5+
@@ -3125,7 +3125,7 @@ export declare type WarnHtmlInMessageLevel = 'off' | 'warn' | 'error';
6+
7+
export { }
8+
9+
-declare module '@vue/runtime-core' {
10+
+declare module 'vue' {
11+
/**
12+
* Component Custom Options for Vue I18n
13+
*

0 commit comments

Comments
 (0)