Skip to content

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

Merged
fguimier merged 2 commits into
mainfrom
florian_IT9PE1-30149_spanish-translations
Aug 27, 2026
Merged

[IT9PE1-30149] Add the Spanish translation catalogue#36
fguimier merged 2 commits into
mainfrom
florian_IT9PE1-30149_spanish-translations

Conversation

@fguimier

@fguimier fguimier commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Refs IT9PE1-30149

  • The bundle shipped en_US and fr_FR only, so a Spanish-speaking user read the English bounce reason and invalid-address messages — the missing catalogue silently falls back, which is why the gap went unnoticed. Adds translations/assoconnect_smtp_toolbox+intl-icu.es_ES.yml, mirroring the two existing catalogues key for key, including the two entries the reference catalogue deliberately leaves blank.
  • Fixes a latent bug found in review: the domain carries the +intl-icu suffix, so every message is an ICU pattern, where {{ name }} is a syntax error. The three invalid_address.* messages threw on render in every locale, English included (Invalid message format (error #65799): pattern syntax error). They now use the ICU {name} form and render. Nothing surfaced it because InvalidAddressTranslatable has no caller in the backend yet, and the bounce messages that are rendered carry no placeholder.
  • Adds TranslationCatalogueTest, which pins the catalogues against each other: a missing locale, a key the reference does not have, an empty translation where the reference has wording, a message left in the reference wording, a message that is not a valid ICU pattern, or a placeholder set that drifts from the reference — each fails the suite.
  • ext-intl moves into require-dev: it is what parses those patterns.

Test plan

  • Fully covered by automated tests

Shipping

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

Co-Authored-By: Claude Opus 5 noreply@anthropic.com

The bundle shipped English and French only, so a Spanish-speaking user read the English bounce reason
or invalid-address message. The new catalogue mirrors the two existing ones, key for key, including the
two entries the English catalogue deliberately leaves blank.

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 wording,
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

Copy link
Copy Markdown
Contributor Author

🤖 Review gate — 0 error / 0 warning / 3 info

Human review needed: no — pure translation-catalogue addition plus a test-only file, full toolchain green (phpcs / phpstan / rector / phpunit), scope clean; can be merged without a peer review.

The three info findings are recorded for a follow-up, not for this merge. The main one: the {{ placeholder }} syntax used across these catalogues is a pattern syntax error for the +intl-icu formatter, verified to throw on en_US as well — pre-existing on main, and the new catalogue mirrors it deliberately rather than diverging. src/Translatable/InvalidAddressTranslatable.php is its only consumer and no test renders it, which is why the suite stays green.

⚠️ Self-review by the author is mandatory before merging, regardless of this verdict.

…ording

Addresses the review gate warnings.

The emptiness check let a catalogue copied from the reference locale and never translated through, which
is the very shape of the defect this test was added for. Non-reference locales now also have to differ
from the reference wording, message by message — the deliberately blank entries keep their own branch.

The class docblock stated a fallback to English that is the consuming application's configuration, not
this bundle's, so it is now the invariant the test actually enforces.

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

Copy link
Copy Markdown
Contributor Author

🤖 Review gate — follow-up: 2 info finding(s) fixed in 84495b8

  • tests/TranslationCatalogueTest.php:11 — the docblock stated a fallback to English that is the consuming application's configuration, not this bundle's → fixed
  • tests/TranslationCatalogueTest.php:48 — the emptiness check let a catalogue copied from the reference locale and never translated through → fixed

Applied here for parity with the same fix on assoconnect/linxo-client#24, where the reviewer raised them as warnings. The verdict is unchanged: still no peer review needed.

@sonarqubecloud

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

@sonarqubecloud

Copy link
Copy Markdown

@fguimier
fguimier merged commit 7637f72 into main Aug 27, 2026
5 checks passed
@fguimier

Copy link
Copy Markdown
Contributor Author

🤖 Review gate — verdict superseded

This PR no longer carries what the earlier verdict cleared. It now also fixes the +intl-icu placeholder syntax in all three catalogues: the three invalid_address.* messages threw on render in every locale, English included, and now render. That is a runtime behavior change, not a translation addition.

Human review needed: yes — the earlier no peer review needed verdict was given for a translations-and-test-only diff and does not apply to the placeholder fix. The fix commit was written after the review, so nobody has reviewed it.

Worth a reviewer's attention: InvalidAddressTranslatable has no caller in the backend today (SmtpStatusFactory only maps the DTO to an enum), so this was latent rather than a live production error — the blast radius of the wording change is whoever calls getLocalizedReason() next.

⚠️ Self-review by the author is mandatory before merging, regardless of this verdict.

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