Index: trunk/extensions/LiveTranslate/LiveTranslate.php |
— | — | @@ -57,7 +57,8 @@ |
58 | 58 | $wgHooks['OutputPageBeforeHTML'][] = 'LiveTranslateHooks::onOutputPageBeforeHTML'; |
59 | 59 | |
60 | 60 | $egLTJSMessages = array( |
61 | | - |
| 61 | + 'livetranslate-button-translate', |
| 62 | + 'livetranslate-button-translating', |
62 | 63 | ); |
63 | 64 | |
64 | 65 | // For backward compatibility with MW < 1.17. |
Index: trunk/extensions/LiveTranslate/includes/ext.livetranslate.js |
— | — | @@ -11,6 +11,8 @@ |
12 | 12 | |
13 | 13 | var runningJobs = 0; |
14 | 14 | |
| 15 | + var textAreaElement = document.createElement( 'textarea' ); |
| 16 | + |
15 | 17 | // Compatibility with pre-RL code. |
16 | 18 | // Messages will have been loaded into wgPushMessages. |
17 | 19 | if ( typeof mediaWiki === 'undefined' ) { |
— | — | @@ -28,7 +30,7 @@ |
29 | 31 | } |
30 | 32 | |
31 | 33 | $('#livetranslatebutton').click(function() { |
32 | | - $( this ).attr( "disabled", true ); |
| 34 | + $( this ).attr( "disabled", true ).text( mediaWiki.msg( 'livetranslate-button-translating' ) ); |
33 | 35 | |
34 | 36 | var words = getSpecialWords(); |
35 | 37 | var newLang = $( '#livetranslatelang' ).val(); |
— | — | @@ -122,7 +124,8 @@ |
123 | 125 | |
124 | 126 | if ( chunkSize < currentMaxSize ) { |
125 | 127 | // If the current chunk was smaller then the max size, node translation is complete, so update text. |
126 | | - element.replaceWholeText( chunks.join() ); |
| 128 | + textAreaElement.innerHTML = chunks.join(); // This is a hack to decode quotes. |
| 129 | + element.replaceData( 0, element.length, textAreaElement.value ); |
127 | 130 | handleTranslationCompletion( targetLang ); |
128 | 131 | } |
129 | 132 | else { |
— | — | @@ -136,7 +139,7 @@ |
137 | 140 | function handleTranslationCompletion( targetLang ) { |
138 | 141 | if ( !--runningJobs ) { |
139 | 142 | currentLang = targetLang; |
140 | | - $( '#livetranslatebutton' ).attr( "disabled", false ); |
| 143 | + $( '#livetranslatebutton' ).attr( "disabled", false ).text( mediaWiki.msg( 'livetranslate-button-translate' ) ); |
141 | 144 | } |
142 | 145 | } |
143 | 146 | |