Index: trunk/extensions/LiveTranslate/LiveTranslate.php |
— | — | @@ -99,8 +99,9 @@ |
100 | 100 | 'scripts' => array( |
101 | 101 | 'includes/jquery.replaceText.js', |
102 | 102 | 'includes/ext.livetranslate.js', |
| 103 | + 'includes/ext.lt.tm.js', |
103 | 104 | 'includes/jquery.liveTranslate.js', |
104 | | - 'includes/ext.lt.tm.js', |
| 105 | + 'includes/ext.lt.load.js', |
105 | 106 | ), |
106 | 107 | 'dependencies' => array( 'jquery'/*, 'jquery.ui.button'*/ ), |
107 | 108 | 'messages' => $egLTJSMessages |
Index: trunk/extensions/LiveTranslate/LiveTranslate_Settings.php |
— | — | @@ -71,3 +71,6 @@ |
72 | 72 | # Microsoft App Id, needed when using the Microsoft Translation service. |
73 | 73 | # http://www.bing.com/developers/createapp.aspx |
74 | 74 | $egLiveTranslateMSAppId = ''; |
| 75 | + |
| 76 | +$egLiveTranslateLanguages[] = 'nl'; |
| 77 | +$egLiveTranslateLanguages[] = 'de'; |
Index: trunk/extensions/LiveTranslate/includes/ext.livetranslate.js |
— | — | @@ -1,43 +1,43 @@ |
2 | 2 | /** |
3 | 3 | * JavasSript for the Live Translate extension. |
4 | | - * @see http://www.mediawiki.org/wiki/Extension:Live_Translate |
| 4 | + * @see https://www.mediawiki.org/wiki/Extension:Live_Translate |
5 | 5 | * |
6 | 6 | * @licence GNU GPL v3 or later |
7 | 7 | * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
8 | 8 | */ |
9 | 9 | |
10 | | -window.liveTranslate = new( function() { |
11 | | - |
12 | | - this.debug = function( message ) { |
13 | | - if ( window.ltDebugMessages ) { |
14 | | - if ( typeof console === 'undefined' ) { |
15 | | - document.title = 'Live Translate: ' + message; |
| 10 | +( function () { |
| 11 | + |
| 12 | + var lt = { |
| 13 | + |
| 14 | + debug: function( message ) { |
| 15 | + if ( window.ltDebugMessages ) { |
| 16 | + if ( typeof console === 'undefined' ) { |
| 17 | + document.title = 'Live Translate: ' + message; |
| 18 | + } |
| 19 | + else { |
| 20 | + console.log( 'Live Translate: ' + message ); |
| 21 | + } |
16 | 22 | } |
| 23 | + }, |
| 24 | + |
| 25 | + msg: function() { |
| 26 | + if ( typeof mediaWiki === 'undefined' ) { |
| 27 | + message = window.wgLTEMessages[arguments[0]]; |
| 28 | + |
| 29 | + for ( var i = arguments.length - 1; i > 0; i-- ) { |
| 30 | + message = message.replace( '$' + i, arguments[i] ); |
| 31 | + } |
| 32 | + |
| 33 | + return message; |
| 34 | + } |
17 | 35 | else { |
18 | | - console.log( 'Live Translate: ' + message ); |
| 36 | + return mediaWiki.msg.apply( this, arguments ); |
19 | 37 | } |
20 | 38 | } |
| 39 | + |
21 | 40 | }; |
22 | | - |
23 | | - this.msg = function() { |
24 | | - if ( typeof mediaWiki === 'undefined' ) { |
25 | | - message = window.wgLTEMessages[arguments[0]]; |
26 | | - |
27 | | - for ( var i = arguments.length - 1; i > 0; i-- ) { |
28 | | - message = message.replace( '$' + i, arguments[i] ); |
29 | | - } |
30 | | - |
31 | | - return message; |
32 | | - } |
33 | | - else { |
34 | | - return mediaWiki.msg.apply( this, arguments ); |
35 | | - } |
36 | | - }; |
37 | | - |
38 | | -} )(); |
39 | 41 | |
40 | | -(function( $ ) { $( document ).ready( function() { |
| 42 | + window.liveTranslate = lt; |
41 | 43 | |
42 | | - $( '#livetranslatediv' ).liveTranslate( {} ); |
43 | | - |
44 | | -} ); })( jQuery ); |
| 44 | +}() ); |
\ No newline at end of file |
Index: trunk/extensions/LiveTranslate/includes/ext.lt.load.js |
— | — | @@ -0,0 +1,13 @@ |
| 2 | +/** |
| 3 | + * JavasSript for the Live Translate extension. |
| 4 | + * @see https://www.mediawiki.org/wiki/Extension:Live_Translate |
| 5 | + * |
| 6 | + * @licence GNU GPL v3 or later |
| 7 | + * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
| 8 | + */ |
| 9 | + |
| 10 | +(function( $ ) { $( document ).ready( function() { |
| 11 | + |
| 12 | + $( '#livetranslatediv' ).liveTranslate( {} ); |
| 13 | + |
| 14 | +} ); })( jQuery ); |
\ No newline at end of file |