From 0b5fd2a0c8ff9f58f60ec4d39267af8c4399e1ad Mon Sep 17 00:00:00 2001 From: Marlon Pina Tojal Date: Fri, 5 Apr 2024 17:13:24 +0200 Subject: [PATCH] add workflow to validate translations Signed-off-by: Marlon Pina Tojal --- .github/workflows/i18n.yaml | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/i18n.yaml diff --git a/.github/workflows/i18n.yaml b/.github/workflows/i18n.yaml new file mode 100644 index 000000000..60677e464 --- /dev/null +++ b/.github/workflows/i18n.yaml @@ -0,0 +1,38 @@ +name: i18n +on: + push: + branches: + - 'master' # Default branch + pull_request: + branches: + - 'master' # Default branch + +permissions: + contents: read + +env: + NODE_VERSION: 18 + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4.1.1 + + - name: Set up NodeJs + uses: actions/setup-node@v4.0.2 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + + - name: Check for Missing Keys + continue-on-error: false + run: | + cd src/ + for filename in i18n/locales/*.json; do + LOCALE_FILE=`basename $filename .json` + npx @oreliain/vue-i18n-extract-keys -l $LOCALE_FILE -s . + done + git diff --exit-code i18n/locales/ \ No newline at end of file