Skip to content

Added compatibility with WPML - #3007

Open
girishpanchal30 wants to merge 3 commits into
developmentfrom
feat/2968
Open

Added compatibility with WPML#3007
girishpanchal30 wants to merge 3 commits into
developmentfrom
feat/2968

Conversation

@girishpanchal30

Copy link
Copy Markdown
Contributor

Closes #2968

Summary

Added the wpml-config.xml file to make the blocks translatable with WPML. The file contains the necessary configuration for WPML to recognize the blocks and their translatable attributes.

Test instructions

  • Install and activate the WPML plugin.
  • Add the Otter Accordion block to a page and add some content to it.
  • Verify that the title and content of the Accordion block are translatable in the WPML translation editor.

Checklist before the final review

  • Included E2E or unit tests for the changes in this PR.
  • Visual elements are not affected by independent changes.
  • It is at least compatible with the minimum WordPress version.
  • It loads additional script in frontend only if it is required.
  • Does not impact the Core Web Vitals.
  • In case of deprecation, old blocks are safely migrated.
  • It is usable in Widgets and FSE.
  • Copy/Paste is working if the attributes are modified.
  • PR is following the best practices

Why no test case

As the changes are to make the blocks compatible with WPML, they need to be tested with the WPML plugin installed and activated.

@girishpanchal30 girishpanchal30 added the pr-checklist-skip Allow this Pull Request to skip checklist. label Aug 31, 2026
@pirate-bot

Copy link
Copy Markdown
Contributor

Bundle Size Diff

Package Old Size New Size Diff
Animations 178.33 KB 178.33 KB 0 B (0.00%)
Blocks 1.65 MB 1.65 MB 0 B (0.00%)
CSS 7.83 KB 7.83 KB 0 B (0.00%)
Dashboard 172.49 KB 172.49 KB 0 B (0.00%)
Onboarding 68.14 KB 68.14 KB 0 B (0.00%)
Export Import 4.73 KB 4.73 KB 0 B (0.00%)
Pro 439.82 KB 439.82 KB 0 B (0.00%)

@pirate-bot

pirate-bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Plugin build for 3e548cc is ready 🛎️!

@pirate-bot

pirate-bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

E2E Tests

Playwright Test Status: See serial and parallel matrix jobs

Performance Results serverResponse: {"q25":399.72,"q50":416.53,"q75":431.42,"cnt":10}, firstPaint: {"q25":1364.52,"q50":1447.69,"q75":1518.22,"cnt":10}, domContentLoaded: {"q25":3694.38,"q50":3765.62,"q75":3791.93,"cnt":10}, loaded: {"q25":3697.36,"q50":3768.92,"q75":3795.32,"cnt":10}, firstContentfulPaint: {"q25":2123.78,"q50":2437.45,"q75":2782.7,"cnt":10}, firstBlock: {"q25":17602.79,"q50":17693.52,"q75":17822.59,"cnt":10}, type: {"q25":25.13,"q50":29.92,"q75":33.24,"cnt":10}, typeWithoutInspector: {"q25":26.89,"q50":28.83,"q75":31.44,"cnt":10}, typeWithTopToolbar: {"q25":34.77,"q50":38.52,"q75":41.27,"cnt":10}, typeContainer: {"q25":16.36,"q50":16.82,"q75":18.3,"cnt":10}, focus: {"q25":144.82,"q50":147.67,"q75":154.51,"cnt":10}, inserterOpen: {"q25":44.25,"q50":48.06,"q75":49.79,"cnt":10}, inserterSearch: {"q25":29.59,"q50":31.66,"q75":33.09,"cnt":10}, inserterHover: {"q25":5.48,"q50":5.85,"q75":6.23,"cnt":20}, loadPatterns: {"q25":1857.11,"q50":1895.62,"q75":1924.83,"cnt":10}, listViewOpen: {"q25":229.79,"q50":237.39,"q75":250.76,"cnt":10}

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds WPML translation configuration for Otter Blocks and Otter Pro block attributes.

Changes:

  • Registers translatable attributes and rendered text for free blocks.
  • Adds equivalent configuration for Pro blocks.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
wpml-config.xml Configures WPML translation extraction for free blocks.
plugins/otter-pro/wpml-config.xml Configures translation extraction for Pro blocks.
Suppressed comments (3)

wpml-config.xml:57

  • The textarea's editable defaultValue is stored as the textarea text node (form/textarea/block.json:36-39 and save.js:43-45), but this configuration only extracts its placeholder. As a result, translated forms keep the source-language prefilled value.
			<xpath>//textarea/@placeholder</xpath>

wpml-config.xml:34

  • Image-based icon-list items expose an editable iconAlt and render it as <img alt> (icon-list/item/save.js:32-33), but only the visible item content is registered here. The resulting translated page retains source-language alternative text.
			<key name="content" />
			<xpath>//p[contains(@class, "wp-block-themeisle-blocks-icon-list-item-content")]</xpath>

wpml-config.xml:68

  • The Review block lets authors edit image.alt and the server renderer emits that value (inc/render/class-review-block.php:125-135), but this nested text is not registered. Manual review images will retain source-language alt text after translation.
			<key name="description" />

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

Comment thread wpml-config.xml
Comment thread wpml-config.xml
Comment thread wpml-config.xml
Comment thread wpml-config.xml Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (1)

wpml-config.xml:105

  • WPML normalizes sibling keys into a map keyed by name, so this later options entry overwrites the nested declaration above it. Current multiple-choice values are arrays of { content, isDefault }, which means their labels will not be exposed for translation. Keep only the nested declaration; it already supports extracting content from each option.
			<key name="options" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-checklist-skip Allow this Pull Request to skip checklist.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WPML does not extract Accordion Item titles for translation

5 participants