i18n: Fix loading of theme translation files#48016
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
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:
If you have questions about anything, reach out in #jetpack-developers for guidance! Wpcomsh plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
54e4876 to
da2db53
Compare
There was a problem hiding this comment.
Pull request overview
Adjusts WPComSH’s MO-file fallback logic so theme translations continue to load correctly on WPCloud, where symlinked theme directories can cause WordPress to compute theme MO filenames using {textdomain}-{locale}.mo instead of {locale}.mo.
Changes:
- Extends the
load_textdomain_mofilefilter callback to accept the text domain and detect{textdomain}-{locale}theme MO basenames. - Strips the theme textdomain prefix from the computed MO basename (when applicable) before mapping WP.org locales to WP.com slugs.
- Adds a wpcomsh changelog fragment documenting the fix.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| projects/plugins/wpcomsh/i18n.php | Updates MO fallback rewriting to handle theme MO basenames prefixed with the textdomain under theme directories. |
| projects/plugins/wpcomsh/changelog/fix-theme-translation-files-loading | Adds a patch-level changelog entry describing the translation loading fix. |
Code Coverage SummaryCoverage changed in 1 file.
|
Fixes I18N-338
Proposed changes
Does this pull request change what data or activity we track or use?
No.
Testing instructions