From ce415217bf097798fabb621666be40499835012b Mon Sep 17 00:00:00 2001 From: Marijn Doeve Date: Fri, 10 Jul 2026 23:50:44 +0200 Subject: [PATCH] feat: show a hint for the candidates textarea and gate translations in CI Add a help hint on the add-candidates form explaining one candidate per line, and translate it plus a few strings from the earlier reset-progress feature that had been missed. Also add a CI step that re-runs translation:extract and fails the build if it produces uncommitted changes, so untranslated/stale strings can't slip through review again. --- .github/workflows/ci.yml | 10 ++++++++++ CLAUDE.md | 1 + src/Form/AddCandidatesFormType.php | 4 +++- translations/messages+intl-icu.nl.xliff | 16 ++++++++++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18d7428..917862d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,6 +95,15 @@ jobs: id: rector continue-on-error: true run: docker compose exec -T php vendor/bin/rector process --dry-run --no-progress-bar --output-format=github + - name: Translations + id: translations + continue-on-error: true + run: | + docker compose exec -T php bin/console translation:extract --force --format=xliff --sort=asc nl + if ! git diff --exit-code -- translations; then + echo "::error::Translations are out of date. Run 'just translations' and commit the changes." + exit 1 + fi - name: Check HTTP reachability run: curl -v --fail-with-body http://localhost - name: Assert all checks passed @@ -113,6 +122,7 @@ jobs: check "Twig Coding Style" "${{ steps.twig_cs.outcome }}" check "PHPStan" "${{ steps.phpstan.outcome }}" check "Rector" "${{ steps.rector.outcome }}" + check "Translations" "${{ steps.translations.outcome }}" exit $failed tests: diff --git a/CLAUDE.md b/CLAUDE.md index ced2ff6..e66b603 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -306,6 +306,7 @@ GitHub Actions workflow (`.github/workflows/ci.yml`): - Twig-CS-Fixer style check - PHPStan static analysis - Rector dry-run + - Translation extraction check (fails if `translation:extract` produces uncommitted changes) 3. **Integration Tests**: - Docker image build and start services - Database creation and migration diff --git a/src/Form/AddCandidatesFormType.php b/src/Form/AddCandidatesFormType.php index a75823d..0aff05d 100644 --- a/src/Form/AddCandidatesFormType.php +++ b/src/Form/AddCandidatesFormType.php @@ -19,7 +19,9 @@ class AddCandidatesFormType extends AbstractType { $builder ->add('candidates', TextareaType::class, [ - 'label' => $this->translator->trans('Candidates'), 'translation_domain' => false, + 'label' => $this->translator->trans('Candidates'), + 'help' => $this->translator->trans('One candidate per line'), + 'translation_domain' => false, ]) ; } diff --git a/translations/messages+intl-icu.nl.xliff b/translations/messages+intl-icu.nl.xliff index 4733a0e..76eb9ec 100644 --- a/translations/messages+intl-icu.nl.xliff +++ b/translations/messages+intl-icu.nl.xliff @@ -117,6 +117,10 @@ Are you sure you want to delete this quiz? Weet je zeker dat je deze test wilt verwijderen? + + Are you sure you want to reset progress for this candidate? Their given answers for this quiz will be deleted. + Weet je zeker dat je de voortgang van deze kandidaat wilt resetten? De ingevulde antwoorden voor deze test worden verwijderd. + Assign Toewijzen @@ -161,6 +165,10 @@ Candidate not found Kandidaat niet gevonden + + Candidate progress reset + Voortgang kandidaat gereset + Candidate renamed Kandidaat hernoemd @@ -541,6 +549,10 @@ Number of dropouts: Aantal afvallers: + + One candidate per line + Eén kandidaat per regel + Open Openen @@ -761,6 +773,10 @@ Reset password Wachtwoord herstellen + + Reset progress + Voortgang resetten + Reset your password Wachtwoord herstellen