Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #60554


Ignore:
Timestamp:
02/16/2024 10:31:29 AM (2 years ago)
Author:
swissspidy
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #60554 – Description

    initial v1  
    11In WordPress 6.5 we're adding support for PHP translation files. They still require accompanying `.mo` and `.po` files. However, it doesn't have to be this way!
     2
     3It should be possible for projects (plugins, themes, and core) to only use `.l10n.php` files.
    24
    35A few areas that would need changing:
    46
    5 **`wp_get_installed_translations()`**
     7**wp_get_installed_translations()**
    68
    79`wp_get_installed_translations()` is used for getting the list of installed translations for plugins/themes/core when updating language packs and also when uninstalling plugins/themes (to remove the translations again).
    810
    9 **`Language_Pack_Upgrader`**
     11**Language_Pack_Upgrader**
    1012
    1113`\Language_Pack_Upgrader::check_package()` checks whether there are `.mo` and `.po` in the language pack. It should also support language packs with only a `.l10n.php` file.
     14
     15**load_textdomain() / load_default_textdomain()**
     16
     17Not sure about this one.
     18
     19Right now you can pass an `.mo` file path, even though the file doesn't exist, and WordPress will load the `.l10n.php` counterpart. So technically no change is required. However, what if you want to directly pass an `.l10n.php` file path instead?