Skip to content

Commit

Permalink
I18N: Pass the $locale variable to the load_translation_file filter.
Browse files Browse the repository at this point in the history
This avoids the need for the locale to be recalculated by code that hooks into this filter.

Props swissspidy, mukesh27, johnbillion

Fixes #61108


git-svn-id: https://develop.svn.wordpress.org/trunk@58095 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
johnbillion committed May 4, 2024
1 parent 9d6cd2d commit 121e5d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/wp-includes/l10n.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down

0 comments on commit 121e5d6

Please sign in to comment.