| 388 | | if ( in_array( $name, $loaded_langs ) ) { |
| 389 | | $ext_plugins .= 'tinyMCEPreInit.load_ext("' . $plugurl . '", "' . $mce_locale . '");' . "\n"; |
| | 385 | // Try to load langs/[locale].js and langs/[locale]_dlg.js |
| | 386 | if ( ! in_array( $name, $loaded_langs, true ) ) { |
| | 387 | $path = str_replace( content_url(), '', $plugurl ); |
| | 388 | $path = WP_CONTENT_DIR . $path . '/langs/'; |
| | 389 | |
| | 390 | if ( function_exists('realpath') ) |
| | 391 | $path = trailingslashit( realpath($path) ); |
| | 392 | |
| | 393 | if ( @is_file( $path . $mce_locale . '.js' ) ) |
| | 394 | $strings .= @file_get_contents( $path . $mce_locale . '.js' ) . "\n"; |
| | 395 | |
| | 396 | if ( @is_file( $path . $mce_locale . '_dlg.js' ) ) |
| | 397 | $strings .= @file_get_contents( $path . $mce_locale . '_dlg.js' ) . "\n"; |
| | 398 | |
| | 399 | if ( 'en' != $mce_locale && empty( $strings ) ) { |
| | 400 | if ( @is_file( $path . 'en.js' ) ) { |
| | 401 | $str1 = @file_get_contents( $path . 'en.js' ); |
| | 402 | $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str1, 1 ) . "\n"; |
| | 403 | } |
| | 404 | |
| | 405 | if ( @is_file( $path . 'en_dlg.js' ) ) { |
| | 406 | $str2 = @file_get_contents( $path . 'en_dlg.js' ); |
| | 407 | $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str2, 1 ) . "\n"; |
| | 408 | } |
| | 409 | } |
| | 410 | |
| | 411 | if ( ! empty( $strings ) ) |
| | 412 | $ext_plugins .= "\n" . $strings . "\n"; |