Make WordPress Core


Ignore:
Timestamp:
04/04/2024 01:36:25 PM (8 months ago)
Author:
swissspidy
Message:

I18N: Always search for script translations in wp-content/languages/plugins.

Previously, when WP_PLUGIN_DIR was set to something other than wp-content/plugins, e.g. wp-content/mods, load_script_textdomain was searching for script translations in wp-content/languages/mods. However, that is incorrect, as WP_PLUGIN_DIR does not affect where translations are stored. The location is always wp-content/languages/plugins.

Props coreymckrill, swissspidy.
Fixes #60891.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/l10n.php

    r57639 r57922  
    11901190        $relative = explode( '/', $relative );
    11911191
    1192         $languages_path = WP_LANG_DIR . '/' . $relative[0];
     1192        $languages_path = WP_LANG_DIR . '/plugins';
    11931193
    11941194        $relative = array_slice( $relative, 2 ); // Remove plugins/<plugin name> or themes/<theme name>.
Note: See TracChangeset for help on using the changeset viewer.