Ticket #42574: 42574.2.diff
File 42574.2.diff, 1.9 KB (added by , 7 years ago) |
---|
-
src/wp-includes/l10n.php
1210 1210 selected( '', $parsed_args['selected'], false ) 1211 1211 ); 1212 1212 1213 // List installed languages. 1213 // List installed languages. 1214 1214 foreach ( $languages as $language ) { 1215 1215 $structure[] = sprintf( 1216 1216 '<option value="%s" lang="%s"%s data-installed="1">%s</option>', … … 1332 1332 1333 1333 return $wp_locale_switcher->is_switched(); 1334 1334 } 1335 1336 /** 1337 * Parses a WordPress locale identifier into an ISO 639 locale identifier. 1338 * 1339 * @since 5.0.0 1340 * 1341 * @param string $locale A WordPress locale. 1342 * @return string Parsed ISO locale. 1343 */ 1344 function wp_parse_iso_locale( $locale ) { 1345 $locale = str_replace( '_', '-', $locale ); 1346 1347 if ( substr_count( $locale, '-' ) > 1 ) { 1348 $locale = implode( '-', array_slice( explode( '-', $locale ), 0, 2 ) ); 1349 } 1350 1351 return $locale; 1352 } -
src/wp-includes/script-loader.php
357 357 $scripts->add( 'mediaelement-migrate', "/wp-includes/js/mediaelement/mediaelement-migrate$suffix.js", array(), false, 1); 358 358 359 359 did_action( 'init' ) && $scripts->add_inline_script( 'mediaelement-core', sprintf( 'var mejsL10n = %s;', wp_json_encode( array( 360 'language' => strtolower( str_replace( '_', '-',is_admin() ? get_user_locale() : get_locale() ) ),360 'language' => strtolower( wp_parse_iso_locale( is_admin() ? get_user_locale() : get_locale() ) ), 361 361 'strings' => array( 362 362 'mejs.install-flash' => __( 'You are using a browser that does not have Flash player enabled or installed. Please turn on your Flash player plugin or download the latest version from https://get.adobe.com/flashplayer/' ), 363 363 'mejs.fullscreen-off' => __( 'Turn off Fullscreen' ),