Make WordPress Core

Changeset 42251 for trunk


Ignore:
Timestamp:
11/28/2017 02:51:33 PM (6 years ago)
Author:
johnbillion
Message:

Media: Further improvements to the handling of language codes that get passed to MediaElement.

This change means that only the leading portion of a locale code gets passed to MediaElement, removing problems that arise from locales such as de_DE_formal and pt_PT_ao90.

Props erich_k4wp, blobfolio, flixos90, ocean90, joemcgill, SergeyBiryukov.

Fixes #42574

File:
1 edited

Legend:

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

    r42163 r42251  
    358358
    359359    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( strtok( is_admin() ? get_user_locale() : get_locale(), '_-' ) ),
    361361        'strings'  => array(
    362362            '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/' ),
Note: See TracChangeset for help on using the changeset viewer.