Skip to content

Fix: Load wp-dataviews translations on the AI Request Log page#723

Merged
dkotter merged 3 commits into
WordPress:developfrom
i-anubhav-anand:fix/request-log-dataviews-translations
Jun 17, 2026
Merged

Fix: Load wp-dataviews translations on the AI Request Log page#723
dkotter merged 3 commits into
WordPress:developfrom
i-anubhav-anand:fix/request-log-dataviews-translations

Conversation

@i-anubhav-anand

@i-anubhav-anand i-anubhav-anand commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Fixes #721

What

Adds wp_set_script_translations('wp-dataviews', 'default') to AI_Request_Log_Page::enqueue_assets().

Why

The @wordpress/dataviews package ships its own UI strings (column headers, search placeholder, pagination labels, etc.). WordPress only inlines those translations automatically on block-editor pages. On standalone admin pages like the AI Request Log, the wp-dataviews script handle was never registered for translation loading, so all DataViews UI text fell back to English regardless of the site language.

How

wp_set_script_translations() hooks into the script-loader to attach the .po-derived JSON translation files for the wp-dataviews handle — the same pattern used elsewhere in WordPress core for translatable packages.

Testing

  1. Set site language to a non-English locale with DataViews translations available.
  2. Navigate to the AI Request Log admin page.
  3. Verify DataViews UI strings (search, pagination, column headers) appear in the selected language.

Use of AI Tools

GitHub Copilot and/or AI tooling was used to assist in drafting this contribution.

Open WordPress Playground Preview

The @wordpress/dataviews component ships UI strings (filter chips,
pagination, sort and view-options labels) that rely on WordPress
core's default text domain. WordPress inlines those translations
automatically in block-editor contexts, but not on standalone admin
pages. This adds an explicit wp_set_script_translations() call for
the wp-dataviews script so those strings are translated when the
Request Log page is visited.

Fixes WordPress#721
@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: i-anubhav-anand <anubhav24@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>
Co-authored-by: hiroshisatoy <hiroshisato@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@dkotter dkotter added this to the 1.1.0 milestone Jun 17, 2026
@dkotter dkotter merged commit cdee83f into WordPress:develop Jun 17, 2026
22 checks passed
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.

DataViews strings in the Request Log settings panel are not translated

2 participants