test: translations through __(), and the browser tests in Firefox and WebKit nightly - #332
Merged
Merged
Conversation
…tests WordPress's __() is renamed __wp() by the framework's patch, and pollora/helper-overrider's __() routes a call with a text domain to WordPress and a call with replacements to Laravel. If Laravel reclaims the name, nothing fails: WordPress catalogues just stop resolving. The e2e-features plugin ships a fr_FR catalogue and a REST route that loads it and answers what __() and __wp() return. Replayed on a site: with the WordPress side of the resolver disabled, the string comes back untranslated and the test fails.
E2E_BROWSERS selects the Playwright projects (chromium by default). Pull requests and pushes keep Chromium alone; the nightly schedule and a manual run use all three engines. Measured locally in Firefox: the suite passes but for the the_content check, which fails on pollora-test for a theme defect already fixed in theme-apiary.
Since WordPress 6.5 translations are kept per locale. The route loaded the plugin's catalogue as fr_FR through plugin_locale, which only worked on a site whose language is fr_FR (pollora-test); on the CI site, in en_US, __() found nothing. Measured with the locale forced to en_US: the former loading leaves the string untranslated, this one translates it.
This was referenced Sep 25, 2026
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.
i18n (plan §3.3)
In Pollora, WordPress's
__()is renamed__wp()(framework patch), andpollora/helper-overrider's__()routes calls:If Laravel reclaims the name, nothing fails: WordPress catalogues just stop resolving (known trap, see
OverrideOrderTest).The
e2e-featuresplugin now ships afr_FRcatalogue (.po+.mocompiled bywp i18n make-mo), plus a REST route that loads it and returns what__()and__wp()answer. Test:__('E2E greeting', 'e2e-features')→Bonjour depuis le catalogue__('Shipping :brand', ['brand' => 'Example'])→Shipping Example__wp(...)→ the translationReplay: with the WordPress branch of
TranslationResolver::translate()disabled (in pollora-test'svendor/, restored afterwards), the string comes back untranslated and the test fails.Nightly Firefox + WebKit
playwright.config.ts:E2E_BROWSERSselects the projects (chromiumby default; an unknown value fails loudly).ci.yml:schedule(03:30 UTC) andworkflow_dispatch. The E2E job runschromium,firefox,webkiton those events, and onlychromiumon push and PR.the_contentcheck, a pollora-test defect (its copy of apiary predates theme-apiary#7). WebKit could not run locally (missing system libraries,sudorequired); a manual run of this workflow on the branch measures it.Note: GitHub runs
schedulefrom the default branch (main), so the nightly starts once this reachesmain.