Skip to content

Fixed script translation support for the builder - #529

Merged
pirate-bot merged 4 commits into
developmentfrom
bugfix/527
Oct 1, 2026
Merged

pirate-bot merged 4 commits into
developmentfrom
bugfix/527

Conversation

@girishpanchal30

@girishpanchal30 girishpanchal30 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Ensures that all builder scripts (Gutenberg, Elementor, and Beaver Builder) are properly linked to the plugin's text domain for translations. It also introduces a new test to verify that these scripts load their translations correctly. The most important changes are grouped by theme below.

Check before Pull Request is ready:

Closes #527

@pirate-bot

pirate-bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Plugin build for 2249dac is ready 🛎️!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The new test teardown can fail, and the Beaver translation path remains untested.

Review effort: Balanced
Findings: 2 Medium severity

Open (2)
What changed in this PR

Links builder scripts to the plugin translation catalog, addressing issue #527.

Changes:

  • Registers translations for Gutenberg, Elementor, and Beaver Builder scripts.
  • Adds PHPUnit coverage for Gutenberg and Elementor.
  • Extends the Beaver Builder PHPStan stub.
File Description
includes/​Editor.php Registers Gutenberg script translations.
includes/​Elementor.php Registers Elementor script translations.
includes/​TI_Beaver.php Registers Beaver translations during its enqueue lifecycle.
tests/​script-translations-test.php Adds translation-registration tests.
tests/​php/​static-analysis/​beaver.php Models Beaver’s script registry for PHPStan.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/script-translations-test.php
Comment thread tests/script-translations-test.php Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The translation registrations cover all affected integrations with focused automated tests.

Review effort: Balanced
Findings: None

Resolved since last review (2)

@pirate-bot pirate-bot left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes requested

The translation fix works for all three builders, but the new test bodies repeat cleanup that tear_down already does.

Validation details
  • Files reviewed: 6/6 changed files.
  • Script_Translations_Test ran on PHP 8.3, PHPUnit 9.6 and the WordPress 7.1 test library. All 3 tests pass at HEAD.
  • The same tests ran with the three includes/ files restored from pr-base. Each test failed on its text domain assertion.
  • Beaver Builder Lite 2.11.0.6 calls enqueue_scripts() before it enqueues $module->js on both the layout and builder UI paths. The test stub uses the same order.
  • The security review found no trust boundary change. The tests/ folder is excluded from the release package.
Untested areas
  • Translation loading with a real language pack and generated JSON files was not checked.
  • The Elementor and Beaver Builder screens were not opened in a browser.

🤖 Automated review · run code-review-agent_6abb8fe0464847.36587835.


🤖 Review agent — review posted ✅ on 8fc6172c · changes requested · 1 finding · 8 min

Run code-review-agent_6abb8fe0464847.36587835 · trail

Comment thread tests/script-translations-test.php Outdated

@pirate-bot pirate-bot left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approved

The PR passes because the duplicate test cleanup is removed and all three builder scripts still get the text domain.

Validation details
  • Files reviewed: 6/6 changed files. The only new commit is ee3df6c.
  • Script_Translations_Test ran on PHP 8.3, PHPUnit 9.6.37 and WordPress 7.1.2. All 3 tests pass at HEAD, in default and reverse order.
  • With the includes/ files from pr-base, each test fails on its text domain assertion.
  • The Beaver Builder hook order and the security check come from run code-review-agent_6abb8fe0464847.36587835, not rerun. The new commit does not touch that code.
Untested areas
  • Translation loading with a real language pack and generated JSON files was not checked.
  • The Elementor and Beaver Builder screens were not opened in a browser.

🤖 Automated review · run code-review-agent_6abb9572a293d1.59928062.


🤖 Review agent — review posted ✅ on ee3df6cc · approved · 0 findings · 4 min

Run code-review-agent_6abb9572a293d1.59928062 · trail

@pirate-bot pirate-bot left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Dev review: Check editor/src/plugins/extension.js:215 and :316, because a translated compare string can hide the save-template error message.

Validation details
  • Files reviewed: 7/7 changed files. The only new commit is 2249dac.
  • A GET to the Templates Cloud API returned HTTP 200 with rest_forbidden and an English message for every locale tried.
  • The de and fr plugin catalogs translate the neighbouring extension.js strings.
  • Script_Translations_Test results come from run code-review-agent_6abb9572a293d1.59928062 at ee3df6c, not rerun.
Untested areas
  • Open editor/src/plugins/extension.js:215. Does a refused save POST return an English message with code: rest_forbidden? If yes, a translated compare string breaks the match. Then compare res.code as site-editor-extension.js:184 does. A POST was not sent to production.
  • No test suite reaches the save-template error path.

🤖 Automated review · run code-review-agent_6abcf91f29e233.87658543.


🤖 Review agent — review posted ✅ on 2249daca · commented · 0 findings · 11 min

Run code-review-agent_6abcf91f29e233.87658543 · trail

@pirate-bot
pirate-bot merged commit c11d409 into development Oct 1, 2026
6 checks passed
@pirate-bot
pirate-bot deleted the bugfix/527 branch October 1, 2026 12:14
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.

Builder integration JavaScript strings can remain untranslated

5 participants