From 3ba15f645798b0a5f5fa3b24d5751d559417a587 Mon Sep 17 00:00:00 2001 From: yunimm Date: Mon, 6 Mar 2023 23:52:38 +0800 Subject: [PATCH 1/3] Add @intlify/unplugin-vue-i18n/vite --- vite.config.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vite.config.ts b/vite.config.ts index 6405f3e32e0..e1bdee5b486 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,6 +6,9 @@ import Components from 'unplugin-vue-components/vite' import ViteIcons from 'unplugin-icons/vite' import IconsResolver from 'unplugin-icons/resolver' import { VitePWA } from 'vite-plugin-pwa' +import { resolve, dirname } from 'node:path' +import { fileURLToPath } from 'url' +import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite' export default defineConfig(({ mode, command }) => { const parsed = loadEnv(mode, process.cwd()) @@ -59,6 +62,11 @@ export default defineConfig(({ mode, command }) => { } }, plugins: [ + VueI18nPlugin({ + /* options */ + // locale messages resource pre-compile option + include: resolve(dirname(fileURLToPath(import.meta.url)), './path/to/src/locales/**') + }), Vue({ include: [/\.vue$/, /\.md$/] }), From cc2cc87d7e2a1ce2b14317d5193e3eea4b5ed8dc Mon Sep 17 00:00:00 2001 From: Spyup Date: Sat, 4 May 2024 01:10:20 +0800 Subject: [PATCH 2/3] feat/i18n: move unplugin-vue-i18n to v1.0.0 --- package.json | 1 + pnpm-lock.yaml | 156 +++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 146 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index ff7e900c306..63f3c570349 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ }, "dependencies": { "@gtm-support/vue-gtm": "^2.0.0", + "@intlify/unplugin-vue-i18n": "1.0.0", "@types/socket.io-client": "^1.4.36", "@vueuse/core": "^10.0.2", "@vueuse/shared": "^10.1.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4067ff6982f..49934cc64a9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,7 @@ specifiers: '@faker-js/faker': ^7.6.0 '@gtm-support/vue-gtm': ^2.0.0 '@iconify/json': ^2.2.52 + '@intlify/unplugin-vue-i18n': 1.0.0 '@types/google-spreadsheet': ^3.3.1 '@types/lodash': ^4.14.194 '@types/markdown-it': ^12.2.3 @@ -76,6 +77,7 @@ specifiers: dependencies: '@gtm-support/vue-gtm': 2.0.0_vue@3.3.1 + '@intlify/unplugin-vue-i18n': 1.0.0_vue-i18n@9.2.2 '@types/socket.io-client': 1.4.36 '@vueuse/core': 10.1.2_vue@3.3.1 '@vueuse/shared': 10.1.2_vue@3.3.1 @@ -1678,6 +1680,31 @@ packages: - supports-color dev: false + /@intlify/bundle-utils/7.5.1_vue-i18n@9.2.2: + resolution: {integrity: sha512-UovJl10oBIlmYEcWw+VIHdKY5Uv5sdPG0b/b6bOYxGLln3UwB75+2dlc0F3Fsa0RhoznQ5Rp589/BZpABpE4Xw==} + engines: {node: '>= 14.16'} + peerDependencies: + petite-vue-i18n: '*' + vue-i18n: '*' + peerDependenciesMeta: + petite-vue-i18n: + optional: true + vue-i18n: + optional: true + dependencies: + '@intlify/message-compiler': 9.13.1 + '@intlify/shared': 9.13.1 + acorn: 8.8.2 + escodegen: 2.1.0 + estree-walker: 2.0.2 + jsonc-eslint-parser: 2.4.0 + magic-string: 0.30.0 + mlly: 1.7.0 + source-map-js: 1.0.2 + vue-i18n: 9.2.2_vue@3.3.1 + yaml-eslint-parser: 1.2.2 + dev: false + /@intlify/core-base/9.2.2: resolution: {integrity: sha512-JjUpQtNfn+joMbrXvpR4hTF8iJQ2sEFzzK3KIESOx+f+uwIjgw20igOyaIdhfsVVBCds8ZM64MoeNSx+PHQMkA==} engines: {node: '>= 14'} @@ -1695,6 +1722,14 @@ packages: '@intlify/shared': 9.2.2 dev: false + /@intlify/message-compiler/9.13.1: + resolution: {integrity: sha512-SKsVa4ajYGBVm7sHMXd5qX70O2XXjm55zdZB3VeMFCvQyvLew/dLvq3MqnaIsTMF1VkkOb9Ttr6tHcMlyPDL9w==} + engines: {node: '>= 16'} + dependencies: + '@intlify/shared': 9.13.1 + source-map-js: 1.0.2 + dev: false + /@intlify/message-compiler/9.2.2: resolution: {integrity: sha512-IUrQW7byAKN2fMBe8z6sK6riG1pue95e5jfokn8hA5Q3Bqy4MBJ5lJAofUsawQJYHeoPJ7svMDyBaVJ4d0GTtA==} engines: {node: '>= 14'} @@ -1703,11 +1738,49 @@ packages: source-map: 0.6.1 dev: false + /@intlify/shared/9.13.1: + resolution: {integrity: sha512-u3b6BKGhE6j/JeRU6C/RL2FgyJfy6LakbtfeVF8fJXURpZZTzfh3e05J0bu0XPw447Q6/WUp3C4ajv4TMS4YsQ==} + engines: {node: '>= 16'} + dev: false + /@intlify/shared/9.2.2: resolution: {integrity: sha512-wRwTpsslgZS5HNyM7uDQYZtxnbI12aGiBZURX3BTR9RFIKKRWpllTsgzHWvj3HKm3Y2Sh5LPC1r0PDCKEhVn9Q==} engines: {node: '>= 14'} dev: false + /@intlify/unplugin-vue-i18n/1.0.0_vue-i18n@9.2.2: + resolution: {integrity: sha512-kY82RV7cmclnIx5dPNs+3IOQ2ycOZTcOAW968UKP+EBL4Dq0MWaPUljosbWBhGlpgyjp31/8QzWTVk8ap9vFGA==} + engines: {node: '>= 14.16'} + peerDependencies: + petite-vue-i18n: '*' + vue-i18n: '*' + vue-i18n-bridge: '*' + peerDependenciesMeta: + petite-vue-i18n: + optional: true + vue-i18n: + optional: true + vue-i18n-bridge: + optional: true + dependencies: + '@intlify/bundle-utils': 7.5.1_vue-i18n@9.2.2 + '@intlify/shared': 9.13.1 + '@rollup/pluginutils': 5.0.2 + '@vue/compiler-sfc': 3.3.1 + debug: 4.3.4 + fast-glob: 3.2.12 + js-yaml: 4.1.0 + json5: 2.2.3 + pathe: 1.1.0 + picocolors: 1.0.0 + source-map-js: 1.0.2 + unplugin: 1.3.1 + vue-i18n: 9.2.2_vue@3.3.1 + transitivePeerDependencies: + - rollup + - supports-color + dev: false + /@intlify/vue-devtools/9.2.2: resolution: {integrity: sha512-+dUyqyCHWHb/UcvY1MlIpO87munedm3Gn6E9WWYdWrMuYLcoIoOEVDWSS8xSwtlPU+kA+MEQTP6Q1iI/ocusJg==} engines: {node: '>= 14'} @@ -1880,7 +1953,6 @@ packages: '@types/estree': 1.0.1 estree-walker: 2.0.2 picomatch: 2.3.1 - dev: true /@rollup/pluginutils/5.0.2_rollup@3.21.6: resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==} @@ -1926,7 +1998,6 @@ packages: /@types/estree/1.0.1: resolution: {integrity: sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==} - dev: true /@types/google-spreadsheet/3.3.2: resolution: {integrity: sha512-uBwRhNwx5JPsmrV+XmD77dxL8vVdOY/Aba1kx/mxtR6jePLZIN06I1jjEXEFidAyLUz+JWCphsVk8CCJ2Kzy2w==} @@ -2335,13 +2406,18 @@ packages: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: acorn: 8.8.2 - dev: true /acorn-walk/8.2.0: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} engines: {node: '>=0.4.0'} dev: true + /acorn/8.11.3: + resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: false + /acorn/8.8.2: resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} engines: {node: '>=0.4.0'} @@ -2927,6 +3003,10 @@ packages: /concat-map/0.0.1: resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} + /confbox/0.1.7: + resolution: {integrity: sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==} + dev: false + /config-chain/1.1.13: resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} dependencies: @@ -3569,6 +3649,18 @@ packages: source-map: 0.6.1 dev: true + /escodegen/2.1.0: + resolution: {integrity: sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==} + engines: {node: '>=6.0'} + hasBin: true + dependencies: + esprima: 4.0.1 + estraverse: 5.3.0 + esutils: 2.0.3 + optionalDependencies: + source-map: 0.6.1 + dev: false + /eslint-config-standard/17.0.0_2xftn3py4nyxsuagfjbabfwmr4: resolution: {integrity: sha512-/2ks1GKyqSOkH7JFvXJicu0iMpoojkwB+f5Du/1SC0PtBL+s8v30k9njRZ21pm2drKYm2342jFnGWzttxPmZVg==} peerDependencies: @@ -3782,7 +3874,6 @@ packages: /eslint-visitor-keys/3.4.1: resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true /eslint/8.40.0: resolution: {integrity: sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ==} @@ -3847,13 +3938,11 @@ packages: acorn: 8.8.2 acorn-jsx: 5.3.2_acorn@8.8.2 eslint-visitor-keys: 3.4.1 - dev: true /esprima/4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true - dev: true /esquery/1.5.0: resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} @@ -3877,7 +3966,6 @@ packages: /estraverse/5.3.0: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} - dev: true /estree-walker/1.0.1: resolution: {integrity: sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==} @@ -3889,7 +3977,6 @@ packages: /esutils/2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} - dev: true /event-target-shim/5.0.1: resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} @@ -5083,7 +5170,16 @@ packages: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} hasBin: true - dev: true + + /jsonc-eslint-parser/2.4.0: + resolution: {integrity: sha512-WYDyuc/uFcGp6YtM2H0uKmUwieOuzeE/5YocFJLnLfclZ4inf3mRn8ZVy1s7Hxji7Jxm6Ss8gqpexD/GlKoGgg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + acorn: 8.8.2 + eslint-visitor-keys: 3.4.1 + espree: 9.5.2 + semver: 7.5.0 + dev: false /jsonfile/6.1.0: resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} @@ -5288,7 +5384,6 @@ packages: /lodash/4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} - dev: true /log-symbols/5.1.0: resolution: {integrity: sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==} @@ -5562,6 +5657,15 @@ packages: minimist: 1.2.8 dev: true + /mlly/1.7.0: + resolution: {integrity: sha512-U9SDaXGEREBYQgfejV97coK0UL1r+qnF2SyO9A3qcI8MzKnsIFKHNVEkrDyNncQTKQQumsasmeq84eNMdBfsNQ==} + dependencies: + acorn: 8.11.3 + pathe: 1.1.2 + pkg-types: 1.1.0 + ufo: 1.5.3 + dev: false + /ms/2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} @@ -6010,7 +6114,10 @@ packages: /pathe/1.1.0: resolution: {integrity: sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w==} - dev: true + + /pathe/1.1.2: + resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} + dev: false /pbf/3.2.1: resolution: {integrity: sha512-ClrV7pNOn7rtmoQVF4TS1vyU0WhYRnP92fzbfF75jAIwpnzdJXf8iTd4CMEqO4yUenH6NDqLiwjqlh6QgZzgLQ==} @@ -6063,6 +6170,14 @@ packages: engines: {node: '>=0.10.0'} dev: true + /pkg-types/1.1.0: + resolution: {integrity: sha512-/RpmvKdxKf8uILTtoOhAgf30wYbP2Qw+L9p3Rvshx1JZVX+XQNZQFjlbmGHEGIm4CkVPlSn+NXmIM8+9oWQaSA==} + dependencies: + confbox: 0.1.7 + mlly: 1.7.0 + pathe: 1.1.2 + dev: false + /postcss-html/1.5.0: resolution: {integrity: sha512-kCMRWJRHKicpA166kc2lAVUGxDZL324bkj/pVOb6RhjB0Z5Krl7mN0AsVkBhVIRZZirY0lyQXG38HCVaoKVNoA==} engines: {node: ^12 || >=14} @@ -7333,6 +7448,10 @@ packages: resolution: {integrity: sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==} dev: false + /ufo/1.5.3: + resolution: {integrity: sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==} + dev: false + /uglify-js/3.17.4: resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} engines: {node: '>=0.8.0'} @@ -8044,6 +8163,21 @@ packages: /yallist/4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + /yaml-eslint-parser/1.2.2: + resolution: {integrity: sha512-pEwzfsKbTrB8G3xc/sN7aw1v6A6c/pKxLAkjclnAyo5g5qOh6eL9WGu0o3cSDQZKrTNk4KL4lQSwZW+nBkANEg==} + engines: {node: ^14.17.0 || >=16.0.0} + dependencies: + eslint-visitor-keys: 3.4.1 + lodash: 4.17.21 + yaml: 2.4.2 + dev: false + + /yaml/2.4.2: + resolution: {integrity: sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==} + engines: {node: '>= 14'} + hasBin: true + dev: false + /yargs-parser/20.2.9: resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} engines: {node: '>=10'} From c93316a9497d278cde0f8b6ab3b7e3554967f5e7 Mon Sep 17 00:00:00 2001 From: Spyup Date: Sat, 4 May 2024 01:46:41 +0800 Subject: [PATCH 3/3] feat/i18n: adding unplugin-vue-i18n in plugin --- locales/en/home.json | 2 +- locales/en/sponsorship.json | 4 ++-- locales/zh-TW/sponsorship.json | 4 ++-- src/modules/i18n/index.ts | 6 +++--- tsconfig.json | 3 ++- vite.config.ts | 5 ++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/locales/en/home.json b/locales/en/home.json index 833871039a9..6c93ddeddde 100644 --- a/locales/en/home.json +++ b/locales/en/home.json @@ -26,7 +26,7 @@ }, "coc": { "title": "COSCUP Code of Conduct", - "content": "Since 2006, the COSCUP, Conference for Open Source Coders, Users, and Promoters has gradually developed into an annual event in the Chinese-speaking open-source community. In establishing an open, friendly, diverse, inclusive, and transparent open-source community environment, COSCUP believes that “respecting all people” is the most basic social consensus. On this basis, we promote equal interaction, maintain community values, prevent the occurrence of inappropriate incidents, and avoid any form of discrimination or harassment of all participants. This is the direction COSCUP strives towards, and therefore, the establishment of this Code of Conduct is the concrete implementation of this goal and also a fulfillment of our social responsibility.\n\n[More](https://hackmd.io/@coscup/cococo-en)" + "content": "Since 2006, the COSCUP, Conference for Open Source Coders, Users, and Promoters has gradually developed into an annual event in the Chinese-speaking open-source community. In establishing an open, friendly, diverse, inclusive, and transparent open-source community environment, COSCUP believes that “respecting all people” is the most basic social consensus. On this basis, we promote equal interaction, maintain community values, prevent the occurrence of inappropriate incidents, and avoid any form of discrimination or harassment of all participants. This is the direction COSCUP strives towards, and therefore, the establishment of this Code of Conduct is the concrete implementation of this goal and also a fulfillment of our social responsibility.\n\n[More](https://hackmd.io/{'@'}coscup/cococo-en)" }, "about": { "title": "About COSCUP", diff --git a/locales/en/sponsorship.json b/locales/en/sponsorship.json index 1722d334f52..52e31e01a61 100644 --- a/locales/en/sponsorship.json +++ b/locales/en/sponsorship.json @@ -12,7 +12,7 @@ "title": "SOLD OUT: Thanks to the support of all sponsors, COSCUP 2023 is officially closed for sponsorship requests.", "list": [ "Sponsors are welcome to visit COSCUP on both days of the event and email us to reserve a sponsorship for COSCUP 2023.", - "email: sponsorship@coscup.org" + "email: sponsorship{'@'}coscup.org" ] }, "description": "For the past 3 to 5 years, COSCUP has received an average of 2,000 participants from dozens of communities.", @@ -251,7 +251,7 @@ "list": [ { "q": "Besides the current sponsorship plan, can I sponsor other projects or items?", - "a": "Yes, contact us at [sponsorship@coscup.org](mailto:sponsorship@coscup.org) to create custom sponsorship packages." + "a": "Yes, contact us at [sponsorship{'@'}coscup.org](mailto:sponsorship{'@'}coscup.org) to create custom sponsorship packages." }, { "q": "Our company would like to have a booth at COSCUP. Which sponsorship level should we choose?", diff --git a/locales/zh-TW/sponsorship.json b/locales/zh-TW/sponsorship.json index 939c6792ad6..8764752bb45 100644 --- a/locales/zh-TW/sponsorship.json +++ b/locales/zh-TW/sponsorship.json @@ -12,7 +12,7 @@ "title": "售罄:感激所有贊助商支持, COSCUP 2023 贊助徵求正式截止。", "list": [ "歡迎所有贊助商在活動兩天參觀 COSCUP,並來信預約 COSCUP 2023 贊助。", - "email: sponsorship@coscup.org" + "email: sponsorship{'@'}coscup.org" ] }, "description": "COSCUP 過去三至五年平均約有 2,000 多位會眾和數十個社群一同參與。", @@ -258,7 +258,7 @@ "list": [ { "q": "除了目前的贊助方案,還可以贊助其他項目嗎?或是不需要某些項目換折扣", - "a": "COSCUP 歡迎洽談客製化贊助方案,請來信聯繫我們:[sponsorship@coscup.org](mailto:sponsorship@coscup.org)" + "a": "COSCUP 歡迎洽談客製化贊助方案,請來信聯繫我們:[sponsorship{'@'}coscup.org](mailto:sponsorship{'@'}coscup.org)" }, { "q": "我們公司想要在 COSCUP 擺攤位,要選擇哪個贊助級別呢?", diff --git a/src/modules/i18n/index.ts b/src/modules/i18n/index.ts index b31dac44a07..c46e8dd7531 100644 --- a/src/modules/i18n/index.ts +++ b/src/modules/i18n/index.ts @@ -25,8 +25,8 @@ function getFallbackLocale () { return 'en' } -const i18nOptions: I18nOptions = { - legacy: false, +const i18nOptions = { + // legacy: false, locale: 'zh-TW', fallbackLocale: getFallbackLocale(), messages @@ -69,7 +69,7 @@ export const setupI18nRoutes = (routes: RouteRecordRaw[]) => { } export const install: UserModuleInstall = ({ app }) => { - const i18n = createI18n(i18nOptions) + const i18n = createI18n(i18nOptions) app.use(i18n) } diff --git a/tsconfig.json b/tsconfig.json index 229444f87f3..42d989a3df7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,8 @@ "forceConsistentCasingInFileNames": true, "types": [ "vite/client", - "vite-plugin-pwa/client" + "vite-plugin-pwa/client", + "@intlify/unplugin-vue-i18n/messages" ], "paths": { "@/*": ["src/*"] diff --git a/vite.config.ts b/vite.config.ts index e1bdee5b486..2993385b1c7 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,8 +6,6 @@ import Components from 'unplugin-vue-components/vite' import ViteIcons from 'unplugin-icons/vite' import IconsResolver from 'unplugin-icons/resolver' import { VitePWA } from 'vite-plugin-pwa' -import { resolve, dirname } from 'node:path' -import { fileURLToPath } from 'url' import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite' export default defineConfig(({ mode, command }) => { @@ -65,7 +63,8 @@ export default defineConfig(({ mode, command }) => { VueI18nPlugin({ /* options */ // locale messages resource pre-compile option - include: resolve(dirname(fileURLToPath(import.meta.url)), './path/to/src/locales/**') + strictMessage: false, + escapeHtml: true }), Vue({ include: [/\.vue$/, /\.md$/]