I18N: Pass the `$locale` variable to the `load_translation_file` filter.

This avoids the need for the locale to be recalculated by code that hooks into this filter.

Props swissspidy, mukesh27, johnbillion

Fixes #61108

Built from https://develop.svn.wordpress.org/trunk@58095


git-svn-id: http://core.svn.wordpress.org/trunk@57560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2024-05-04 17:27:09 +00:00
parent 6ad45a93a1
commit 900b4b22fa
2 changed files with 4 additions and 2 deletions

View File

@ -833,11 +833,13 @@ function load_textdomain( $domain, $mofile, $locale = null ) {
* the file path could be for an MO or PHP file.
*
* @since 6.5.0
* @since 6.6.0 Added the `$locale` parameter.
*
* @param string $file Path to the translation file to load.
* @param string $domain The text domain.
* @param string $locale The locale.
*/
$file = (string) apply_filters( 'load_translation_file', $file, $domain );
$file = (string) apply_filters( 'load_translation_file', $file, $domain, $locale );
$success = $i18n_controller->load_file( $file, $domain, $locale );

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.6-alpha-58094';
$wp_version = '6.6-alpha-58095';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.