From b699a94c574842330a41c14dc4c77324a845520a Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Mon, 21 Apr 2025 19:03:56 +0200 Subject: [PATCH] ci(check-locale): fix issues with i18n-extract workflow (#2194) --- .github/workflows/check_locale.yml | 2 +- .gitignore | 1 + package.json | 2 +- vue-i18n-extract.config.js | 8 -------- 4 files changed, 3 insertions(+), 10 deletions(-) delete mode 100644 vue-i18n-extract.config.js diff --git a/.github/workflows/check_locale.yml b/.github/workflows/check_locale.yml index 3ad2c628..b56e4a09 100644 --- a/.github/workflows/check_locale.yml +++ b/.github/workflows/check_locale.yml @@ -36,7 +36,7 @@ jobs: run: | mkdir ./i18n-extract for file in ${{ steps.changed-files.outputs.all_changed_files }}; do - npm run i18n-extract -- --languageFiles=src/locales/${file##*/} --output=i18n-extract/${file##*/} + vue-i18n-extract --vueFiles './src/**/{*.?(js|ts|vue),.i18nignore}' --languageFiles './src/locales/${file##*/}' --output './i18n-extract/${file##*/}' MISSING=$(cat i18n-extract/${file##*/} | jq '.missingKeys | length') UNUSED=$(cat i18n-extract/${file##*/} | jq '.unusedKeys | length') echo "$file=|${file##*/}|${MISSING}|${UNUSED}|" >> $GITHUB_OUTPUT diff --git a/.gitignore b/.gitignore index acffdf23..b31df1f4 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ package-lock.json cypress/screenshots/ cypress/videos/ components.d.ts +i18n-extract diff --git a/package.json b/package.json index 756ddd1b..f76f0f9c 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "lint": "eslint --ignore-path .gitignore src", "lint:fix": "npm run lint -- --fix", "build.zip": "cd ./dist && zip -r mainsail.zip ./ -x '**.DS_Store' ./ && cd ..", - "i18n-extract": "vue-i18n-extract use-config", + "i18n-extract": "vue-i18n-extract --vueFiles './src/**/{*.?(js|ts|vue),.i18nignore}' --languageFiles './src/locales/*.json'", "preview": "vite preview", "start": "vite build && vite preview", "test": "start-server-and-test preview http://127.0.0.1:4173/ 'cypress run'", diff --git a/vue-i18n-extract.config.js b/vue-i18n-extract.config.js deleted file mode 100644 index eebb3e63..00000000 --- a/vue-i18n-extract.config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - vueFiles: './src/**/{*.?(js|ts|vue),.i18nignore}', - languageFiles: './src/locales/*.json', - exclude: ['_last_update'], - output: false, - add: false, - ci: false, -}