Skip to content

[IT9PE1-30149] Add the Spanish translation catalogue - #95

Merged
fguimier merged 1 commit into
mainfrom
florian_IT9PE1-30149_spanish-translations
Aug 25, 2026
Merged

[IT9PE1-30149] Add the Spanish translation catalogue#95
fguimier merged 1 commit into
mainfrom
florian_IT9PE1-30149_spanish-translations

Conversation

@fguimier

Copy link
Copy Markdown
Contributor

Context

The bundle shipped validators.en.xlf and validators.fr.xlf only. A Spanish-speaking user therefore
read the English message of every constraint — the SIREN and intra-EU VAT number ones included, which is
how the gap surfaced.

Nothing ever failed: a missing translation silently falls back to the source string, so the only symptom
is an English sentence in front of an end user.

What changed

  • translations/validators.es.xlf — the Spanish catalogue, mirroring the two existing ones unit for
    unit (15 messages, same trans-unit ids, same placeholders).
  • tests/TranslationCatalogueTest.php — pins the catalogues against each other so the next gap fails
    the suite instead of reaching a user:
    • every expected locale (en, fr, es) has a catalogue;
    • each catalogue covers exactly the same source messages as the English one;
    • no message is left with an empty translation.

The test reads the files with XPath on local-name(), so it stays independent from the XLIFF namespace
declared on the root element.

Test plan

Ran inside the open-source container (PHP 8.4):

Check Result
vendor/bin/phpunit 304 tests, 553 assertions, 4 skipped — green
vendor/bin/phpstan no errors
vendor/bin/phpcs no errors

The new test was also verified to be sensitive rather than tautological: it fails when a catalogue is
removed or when a target is emptied.

Translation choices worth a reviewer's eye, since the suite cannot judge wording:

  • intra-EU VAT numbernúmero de IVA intracomunitario (IVA, not a calque of the French TVA);
  • float precision is limited to {{ precision }} numbersla precisión está limitada a {{ precision }} decimales, which says decimals rather than digits — closer to the intent than a literal rendering.

Shipping

Merging this PR ships nothing: it needs a semver tag / GitHub release, then a
composer require assoconnect/validator-bundle:^x.y bump PR in the backend. Two reviews total.

Refs IT9PE1-30149

The bundle shipped English and French only, so a Spanish-speaking user read the English message.
The new catalogue mirrors the two existing ones, unit for unit.

A test now pins the catalogues against each other, so a missing locale or an untranslated message
fails the suite. Nothing failed before: an absent translation silently falls back to the English
default, which is exactly why the gap went unnoticed.

Refs IT9PE1-30149
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@fguimier
fguimier merged commit e82047c into main Aug 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant