Skip to content

[Copy] Updates error message when a file no longer exists #15029

[Copy] Updates error message when a file no longer exists

[Copy] Updates error message when a file no longer exists #15029

Workflow file for this run

name: Translations
on:
push:
branches: [main]
paths:
- .github/workflows/translations.yml
- apps/**
- packages/**
- api/app/Enums/**
- api/lang/**
pull_request:
paths:
- .github/workflows/translations.yml
- apps/**
- packages/**
- api/app/Enums/**
- api/lang/**
merge_group:
branches: [main]
jobs:
translations:
name: Translations
runs-on: ubuntu-22.04
env:
PNPM_VERSION: "9.7.1"
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: "./.nvmrc"
cache: pnpm
- name: "Install dependencies: workspace"
working-directory: ./
run: pnpm install
- name: "Extract English files: all workspaces"
working-directory: ./
run: pnpm run intl-extract
- name: "Generate untranslated files: all workspaces"
working-directory: ./
run: |
pnpm run check-intl --force
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
extensions: bcmath
- name: Install composer dependencies
working-directory: api
run: |
cp .env.example .env
composer install --no-interaction --prefer-dist --optimize-autoloader
- name: "Generate lang files: api"
working-directory: api
run: php artisan app:check-intl
- name: "Verify no untranslated file: i18n"
if: always()
working-directory: packages/i18n/src/lang
run: >
if test -f "untranslated.json"; then
echo ":x: i18n has untranslated strings" | tee -a $GITHUB_STEP_SUMMARY;
exit 1;
else
echo ":heavy_check_mark: i18n is fully translated" | tee -a $GITHUB_STEP_SUMMARY;
exit 0;
fi
- name: "Verify clean file: i18n"
if: always()
working-directory: packages/i18n/src/lang
run: >
if [[ "$(git status --porcelain)" == *packages/i18n/src/lang/fr.json* ]]; then
echo ":x: i18n is dirty" | tee -a $GITHUB_STEP_SUMMARY;
exit 1;
else
echo ":heavy_check_mark: i18n is clean" | tee -a $GITHUB_STEP_SUMMARY;
exit 0;
fi
- name: "Verify no untranslated file: web"
if: always()
working-directory: apps/web/src/lang
run: >
if test -f "untranslated.json"; then
echo ":x: Web has untranslated strings" | tee -a $GITHUB_STEP_SUMMARY;
exit 1;
else
echo ":heavy_check_mark: Web is fully translated" | tee -a $GITHUB_STEP_SUMMARY;
exit 0;
fi
- name: "Verify clean file: web"
if: always()
working-directory: apps/web/src/lang
run: >
if [[ "$(git status --porcelain)" == *apps/web/src/lang/fr.json* ]]; then
echo ":x: Web is dirty" | tee -a $GITHUB_STEP_SUMMARY;
exit 1;
else
echo ":heavy_check_mark: Web is clean" | tee -a $GITHUB_STEP_SUMMARY;
exit 0;
fi
- name: "Verify: api"
if: always()
working-directory: api/storage/app
run: >
if test -f "intlErrors.json"; then
echo ":x: API has missing files" | tee -a $GITHUB_STEP_SUMMARY;
exit 1;
else
echo ":heavy_check_mark: All API files exist" | tee -a $GITHUB_STEP_SUMMARY;
exit 0;
fi
- name: "Upload untranslated files: all workspaces"
if: always()
uses: actions/upload-artifact@v4
with:
name: untranslated
path: |
apps/**/lang/untranslated.json
packages/**/lang/untranslated.json
!packages/node_modules/**
api/**/intlErrors.json
if-no-files-found: ignore