Changeset 27922 for trunk/src/wp-includes/class-wp-editor.php
- Timestamp:
- 04/03/2014 03:39:21 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-editor.php
r27901 r27922 271 271 if ( empty( self::$first_init ) ) { 272 272 self::$baseurl = includes_url( 'js/tinymce' ); 273 273 274 $mce_locale = get_locale(); 274 275 if ( empty( $mce_locale ) || 'en' == substr( $mce_locale, 0, 2 ) ) { 276 $mce_locale = 'en'; 277 } 278 279 self::$mce_locale = $mce_locale; 275 self::$mce_locale = $mce_locale = empty( $mce_locale ) ? 'en' : strtolower( substr( $mce_locale, 0, 2 ) ); // ISO 639-1 280 276 281 277 /** This filter is documented in wp-admin/includes/media.php */ … … 393 389 $mce_external_plugins[ $name ] = $url; 394 390 $plugurl = dirname( $url ); 395 396 if ( in_array( $name, $loaded_langs ) ) { 397 $ext_plugins .= 'tinyMCEPreInit.load_ext("' . $plugurl . '", "' . $mce_locale . '");' . "\n"; 391 $strings = $str1 = $str2 = ''; 392 393 // Try to load langs/[locale].js and langs/[locale]_dlg.js 394 if ( ! in_array( $name, $loaded_langs, true ) ) { 395 $path = str_replace( content_url(), '', $plugurl ); 396 $path = WP_CONTENT_DIR . $path . '/langs/'; 397 398 if ( function_exists('realpath') ) 399 $path = trailingslashit( realpath($path) ); 400 401 if ( @is_file( $path . $mce_locale . '.js' ) ) 402 $strings .= @file_get_contents( $path . $mce_locale . '.js' ) . "\n"; 403 404 if ( @is_file( $path . $mce_locale . '_dlg.js' ) ) 405 $strings .= @file_get_contents( $path . $mce_locale . '_dlg.js' ) . "\n"; 406 407 if ( 'en' != $mce_locale && empty( $strings ) ) { 408 if ( @is_file( $path . 'en.js' ) ) { 409 $str1 = @file_get_contents( $path . 'en.js' ); 410 $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str1, 1 ) . "\n"; 411 } 412 413 if ( @is_file( $path . 'en_dlg.js' ) ) { 414 $str2 = @file_get_contents( $path . 'en_dlg.js' ); 415 $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str2, 1 ) . "\n"; 416 } 417 } 418 419 if ( ! empty( $strings ) ) 420 $ext_plugins .= "\n" . $strings . "\n"; 398 421 } 422 423 $ext_plugins .= 'tinyMCEPreInit.load_ext("' . $plugurl . '", "' . $mce_locale . '");' . "\n"; 424 $ext_plugins .= 'tinymce.PluginManager.load("' . $name . '", "' . $url . '");' . "\n"; 399 425 } 400 426 }
Note: See TracChangeset
for help on using the changeset viewer.