Skip to content

test: translations through __(), and the browser tests in Firefox and WebKit nightly - #332

Merged
ogorzalka merged 3 commits into
developfrom
test/e2e-i18n-and-nightly-browsers
Sep 25, 2026
Merged

ogorzalka merged 3 commits into
developfrom
test/e2e-i18n-and-nightly-browsers

Conversation

@ogorzalka

Copy link
Copy Markdown
Member

i18n (plan §3.3)

In Pollora, WordPress's __() is renamed __wp() (framework patch), and pollora/helper-overrider's __() routes calls:

  • a call with a text domain goes to WordPress;
  • a call with replacements goes to Laravel.

If Laravel reclaims the name, nothing fails: WordPress catalogues just stop resolving (known trap, see OverrideOrderTest).

The e2e-features plugin now ships a fr_FR catalogue (.po + .mo compiled by wp 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
  • a string not in the catalogue → returned as is
  • __('Shipping :brand', ['brand' => 'Example']) → Shipping Example
  • __wp(...) → the translation

Replay: with the WordPress branch of TranslationResolver::translate() disabled (in pollora-test's vendor/, restored afterwards), the string comes back untranslated and the test fails.

Nightly Firefox + WebKit

  • playwright.config.ts: E2E_BROWSERS selects the projects (chromium by default; an unknown value fails loudly).
  • ci.yml: schedule (03:30 UTC) and workflow_dispatch. The E2E job runs chromium,firefox,webkit on those events, and only chromium on push and PR.
  • Measured locally in Firefox: 16/17. The failure is the the_content check, a pollora-test defect (its copy of apiary predates theme-apiary#7). WebKit could not run locally (missing system libraries, sudo required); a manual run of this workflow on the branch measures it.

Note: GitHub runs schedule from the default branch (main), so the nightly starts once this reaches main.

…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.
@ogorzalka
ogorzalka merged commit 72426c7 into develop Sep 25, 2026
20 checks passed
@ogorzalka
ogorzalka deleted the test/e2e-i18n-and-nightly-browsers branch September 25, 2026 14:34
This was referenced Sep 25, 2026
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