ci(check-locale): fix issues with i18n-extract workflow (#2194)

This commit is contained in:
Stefan Dej 2025-04-21 19:03:56 +02:00 committed by GitHub
parent 8239ea99bd
commit b699a94c57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 3 additions and 10 deletions

View File

@ -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

1
.gitignore vendored
View File

@ -20,3 +20,4 @@ package-lock.json
cypress/screenshots/
cypress/videos/
components.d.ts
i18n-extract

View File

@ -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'",

View File

@ -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,
}