diff --git a/src/wp-includes/l10n.php b/src/wp-includes/l10n.php index 39346c4d0d..1827166b14 100644 --- a/src/wp-includes/l10n.php +++ b/src/wp-includes/l10n.php @@ -859,8 +859,9 @@ function _load_textdomain_just_in_time( $domain ) { ); foreach ( $locations as $location ) { - foreach ( get_available_languages( $location ) as $file ) { - $cached_mofiles[] = "{$location}/{$file}.mo"; + $mofiles = glob( $location . '/*.mo' ); + if ( $mofiles ) { + $cached_mofiles = array_merge( $cached_mofiles, $mofiles ); } } }