[IT9PE1-30149] Add the Spanish translation catalogue - #95
Merged
Conversation
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>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Context
The bundle shipped
validators.en.xlfandvalidators.fr.xlfonly. A Spanish-speaking user thereforeread 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 forunit (15 messages, same
trans-unitids, same placeholders).tests/TranslationCatalogueTest.php— pins the catalogues against each other so the next gap failsthe suite instead of reaching a user:
en,fr,es) has a catalogue;The test reads the files with XPath on
local-name(), so it stays independent from the XLIFF namespacedeclared on the root element.
Test plan
Ran inside the
open-sourcecontainer (PHP 8.4):vendor/bin/phpunitvendor/bin/phpstanvendor/bin/phpcsThe new test was also verified to be sensitive rather than tautological: it fails when a catalogue is
removed or when a
targetis emptied.Translation choices worth a reviewer's eye, since the suite cannot judge wording:
intra-EU VAT number→número de IVA intracomunitario(IVA, not a calque of the FrenchTVA);float precision is limited to {{ precision }} numbers→la 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.ybump PR in the backend. Two reviews total.Refs IT9PE1-30149