Skip to content

Podcast: load the dashboard's JavaScript translations - #53042

Merged
dlind1 merged 5 commits into
trunkfrom
fix/podcast-dashboard-js-translations
Oct 13, 2026
Merged

dlind1 merged 5 commits into
trunkfrom
fix/podcast-dashboard-js-translations

Conversation

@emilyaudela

@emilyaudela emilyaudela commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

This address this issue with the Jetpack Podcasts translations in WordPress.com not loading: I18N-372

Proposed changes

  • The wp-build Podcast dashboard (/wp-admin/admin.php?page=jetpack-podcast, and /settings/podcasting in Calypso) renders in English on non-English sites, even though its strings are already translated. Nothing downloads the dashboard's JS translation catalog at boot. This is the same gap wp-build dashboards: translate JavaScript strings (load catalogs + stamp text domains) #50762 closed for activity-log, publicize, videopress, backup, newsletter, forms and premium-analytics; Podcast wasn't in that list.
  • Applies the wp-build dashboards: translate JavaScript strings (load catalogs + stamp text domains) #50762 approach to projects/packages/podcast:
    • New packages/init boot module that calls loadI18nCatalogs( 'jetpack-podcast', import.meta.url ), registered on the dashboard page via wpPlugin.pages[].init.
    • build:stamp-textdomains after wp-build, which stamps the text domain and writes build/i18n-manifest.json.
    • Admin_Page enqueues wp-jp-i18n-loader (guarded by wp_script_is( ..., 'registered' ), as Newsletter does).
  • Podcast-specific extra, not covered by wp-build dashboards: translate JavaScript strings (load catalogs + stamp text domains) #50762: Admin_Page::load_wp_build() now calls jetpack_podcast_register_script_modules() directly when wp_default_scripts has already fired. Podcast loads its build on admin_menu priority 1, after that hook, so the generated registrar never ran and @jetpack-podcast/init was missing from the import map (console: Failed to resolve module specifier '@jetpack-podcast/init'). Newsletter loads its build earlier, so it isn't affected. The function has a run-once guard, so calling it directly is safe either way.
  • Not in this PR: jetpack-seo and jetpack-scan-page also lack an i18n-manifest.json and may have the same gap; I haven't verified that.

Before
Screenshot 2026-10-01 at 5 15 46 PM

After
Screenshot 2026-10-01 at 5 13 12 PM

Related product discussion/links

Does this pull request change what data or activity we track or use?

No.

Testing instructions

  • On a WordPress.com Simple site (or a site running this build) with the Podcast module active, set the user language to a fully translated locale such as Italian.
  • Open /wp-admin/admin.php?page=jetpack-podcast.
  • Before: the page is in English, and the console shows Failed to run boot init module: @jetpack-podcast/init.
  • After: the Network tab shows i18n-manifest.json, then jetpack-<lang>-<hash>.json, and the page text is translated (e.g. "Il tuo podcast va pubblicato insieme al tuo blog").
  • Verified on a WordPress.com sandbox with the equivalent hand-applied change.
  • Also checked locally: pnpm install (lockfile gains only the link: entry), jp build packages/podcast --deps, ESLint, PHPCS, jp changelog validate. PHP unit tests were not run locally (they need Docker).

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the fix/podcast-dashboard-js-translations branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/podcast-dashboard-js-translations
bin/jetpack-downloader test jetpack-mu-wpcom-plugin fix/podcast-dashboard-js-translations

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • 🔴 Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Jetpack plugin:

No scheduled milestone found for this plugin.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Oct 1, 2026
@emilyaudela
emilyaudela requested a review from dlind1 October 1, 2026 15:23
@jp-launch-control

jp-launch-control Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/podcast/src/class-admin-page.php 91/129 (70.54%) 1.19% 0 💚

Full summary · PHP report · JS report

@dlind1
dlind1 force-pushed the fix/podcast-dashboard-js-translations branch from bdf8c6c to b56fa80 Compare October 12, 2026 23:25
@github-actions github-actions Bot added the [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ label Oct 12, 2026
@dlind1
dlind1 force-pushed the fix/podcast-dashboard-js-translations branch from b56fa80 to 3f1cbdf Compare October 13, 2026 00:00
emilyaudela and others added 5 commits October 13, 2026 12:17
The wp-build Podcast dashboard shipped with its strings in English on
non-English sites: nothing downloads its JS translation catalog at boot.
This applies the same approach #50762 used for the other wp-build dashboards.

- Add a boot `init` package that calls loadI18nCatalogs( 'jetpack-podcast' ).
- Register it on the dashboard page and stamp the text domain / write the i18n
  manifest after wp-build.
- Enqueue wp-jp-i18n-loader on the Podcast page.
- Register the init script module directly when `wp_default_scripts` has
  already fired. The Podcast build is loaded on admin_menu, after that hook, so
  the generated registrar never ran and the init module was missing from the
  import map ("Failed to resolve module specifier").

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d registrar

jetpack_podcast_register_script_modules() is defined by the generated
build/modules.php, which Phan doesn't analyze. The call is already guarded by
function_exists().

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Moves the late script-module registration into a small method that takes the
registrar as a parameter, so it can be tested without the generated build code
(and no longer needs a Phan suppression). Adds tests for the loader enqueue and
the registration.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@dlind1
dlind1 force-pushed the fix/podcast-dashboard-js-translations branch from 3f1cbdf to 8edda1a Compare October 13, 2026 11:26

@dlind1 dlind1 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.

LGTM! I made a small adjustment to match the other places where a similar fix was implemented.

@dlind1
dlind1 merged commit 9da92df into trunk Oct 13, 2026
126 checks passed
@dlind1
dlind1 deleted the fix/podcast-dashboard-js-translations branch October 13, 2026 12:24
@github-actions github-actions Bot added this to the jetpack/16.4 milestone Oct 13, 2026
@github-actions github-actions Bot removed the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Podcast [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants