[wp-trac] [WordPress Trac] #60554: Add support for using only PHP translation files

WordPress Trac noreply at wordpress.org
Tue Apr 30 08:35:05 UTC 2024


#60554: Add support for using only PHP translation files
---------------------------------------------+-------------------------
 Reporter:  swissspidy                       |       Owner:  swissspidy
     Type:  enhancement                      |      Status:  closed
 Priority:  normal                           |   Milestone:  6.6
Component:  I18N                             |     Version:  6.5
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests commit  |     Focuses:
---------------------------------------------+-------------------------
Changes (by swissspidy):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"58061" 58061]:
 {{{
 #!CommitTicketReference repository="" revision="58061"
 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.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60554#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list