Ticket #23282: 23282.i18n.patch
File 23282.i18n.patch, 4.4 KB (added by , 12 years ago) |
---|
-
wp-includes/js/mediaelement/mediaelement-and-player.js
1645 1645 * @see: i18n.methods.t() 1646 1646 */ 1647 1647 i18n.locale.getLanguage = function () { 1648 return {1648 return mejs.locale || { 1649 1649 "language" : navigator.language 1650 1650 }; 1651 1651 }; … … 1735 1735 * The translated string. 1736 1736 */ 1737 1737 i18n.methods.t = function (str, args, options) { 1738 1739 1738 // Fetch the localized version of the string. 1740 1739 if (i18n.locale.strings && i18n.locale.strings[options.context] && i18n.locale.strings[options.context][str]) { 1741 1740 str = i18n.locale.strings[options.context][str]; … … 1744 1743 if (args) { 1745 1744 str = i18n.methods.formatString(str, args); 1746 1745 } 1746 1747 1747 return str; 1748 1748 }; 1749 1749 … … 1806 1806 1807 1807 }(mejs.i18n.locale.strings)); 1808 1808 1809 ;(function(exports, undefined) { 1810 1811 "use strict"; 1812 1813 if ( mejs.locale.language && mejs.locale.strings ) { 1814 exports[mejs.locale.language] = mejs.locale.strings; 1815 } 1816 1817 }(mejs.i18n.locale.strings)); 1818 1809 1819 /*! 1810 1820 * MediaElementPlayer 1811 1821 * http://mediaelementjs.com/ … … 2898 2908 (function($) { 2899 2909 2900 2910 $.extend(mejs.MepDefaults, { 2901 playpauseText: 'Play/Pause'2911 playpauseText: mejs.i18n.t('Play/Pause') 2902 2912 }); 2903 2913 2904 2914 // PLAY/pause BUTTON … … 3225 3235 (function($) { 3226 3236 3227 3237 $.extend(mejs.MepDefaults, { 3228 muteText: 'Mute Toggle',3238 muteText: mejs.i18n.t('Mute Toggle'), 3229 3239 hideVolumeOnTouchDevices: true, 3230 3240 3231 3241 audioVolume: 'horizontal', … … 3889 3899 // this will automatically turn on a <track> 3890 3900 startLanguage: '', 3891 3901 3892 tracksText: 'Captions/Subtitles'3902 tracksText: mejs.i18n.t('Captions/Subtitles') 3893 3903 }); 3894 3904 3895 3905 $.extend(MediaElementPlayer.prototype, { … … 3919 3929 '<ul>'+ 3920 3930 '<li>'+ 3921 3931 '<input type="radio" name="' + player.id + '_captions" id="' + player.id + '_captions_none" value="none" checked="checked" />' + 3922 '<label for="' + player.id + '_captions_none"> None</label>'+3932 '<label for="' + player.id + '_captions_none">' + mejs.i18n.t('None') +'</label>'+ 3923 3933 '</li>' + 3924 3934 '</ul>'+ 3925 3935 '</div>'+ … … 4437 4447 return null; 4438 4448 4439 4449 if (player.isFullScreen) { 4440 return "Turn off Fullscreen";4450 return mejs.i18n.t("Turn off Fullscreen"); 4441 4451 } else { 4442 return "Go Fullscreen";4452 return mejs.i18n.t("Go Fullscreen"); 4443 4453 } 4444 4454 }, 4445 4455 click: function(player) { … … 4455 4465 { 4456 4466 render: function(player) { 4457 4467 if (player.media.muted) { 4458 return "Unmute";4468 return mejs.i18n.t("Unmute"); 4459 4469 } else { 4460 return "Mute";4470 return mejs.i18n.t("Mute"); 4461 4471 } 4462 4472 }, 4463 4473 click: function(player) { … … 4476 4486 // demo of simple download video 4477 4487 { 4478 4488 render: function(player) { 4479 return "Download Video";4489 return mejs.i18n.t("Download Video"); 4480 4490 }, 4481 4491 click: function(player) { 4482 4492 window.location.href = player.media.currentSrc; -
wp-includes/script-loader.php
278 278 $scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), '0.9.8', 1 ); 279 279 280 280 $scripts->add( 'mediaelement', "/wp-includes/js/mediaelement/mediaelement-and-player$suffix.js", array('jquery'), '2.10.1', 1 ); 281 did_action( 'init' ) && $scripts->localize( 'mediaelement', 'mejs', array( 282 'locale' => array( 283 'language' => get_bloginfo( 'language' ), 284 'strings' => array( 285 'Close' => __( 'Close' ), 286 'Fullscreen' => __( 'Fullscreen' ), 287 'Download File' => __( 'Download File' ), 288 'Play/Pause' => __( 'Play/Pause' ), 289 'Mute Toggle' => __( 'Mute Toggle' ), 290 'None' => __( 'None' ), 291 'Turn off Fullscreen' => __( 'Turn off Fullscreen' ), 292 'Go Fullscreen' => __( 'Go Fullscreen' ), 293 'Unmute' => __( 'Unmute' ), 294 'Mute' => __( 'Mute' ) 295 ) 296 ) 297 ) ); 298 281 299 $scripts->add( 'wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement.js", array('mediaelement'), false, 1 ); 282 300 283 301 $scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array('jquery'), false, 1 );