Make WordPress Core

Changeset 58061

Timestamp:
04/30/2024 08:34:50 AM (12 months ago)
Author:
swissspidy
Message:

I18N: Improve support for using only PHP translation files.

This builds on top of the PHP translation file support added in WordPress 6.5, improving the behavior for projects using solely .l10n.php translation files and no .mo. and .po files.

Updates wp_get_installed_translations(), which is used when updating language packs and when uninstalling plugins/themes (to remove the translations again), to look for PHP translation files and read metadata from them. Additionally, the file lookup is now cached thanks to using WP_Textdomain_Registry.

Updates Language_Pack_Upgrader::check_package() to allow language packs that only contain PHP translation files. While WordPress.org continues to serve .mo and .po files, third-party services might want to only use the PHP file format.

Props swissspidy.
Fixes #60554.

File:
1 added

Note: See TracChangeset for help on using the changeset viewer.