Index: trunk/extensions/LiveTranslate/LiveTranslate_Settings.php |
— | — | @@ -63,4 +63,8 @@ |
64 | 64 | # When true, this prevents storange of translations that are the same in the source and target language. |
65 | 65 | $egLTRequireSignificance = false; |
66 | 66 | |
| 67 | +# When true, debugging messages will be logged using console.log(). Do not use on production wikis. |
67 | 68 | $egLiveTranslateDebugJS = false; |
| 69 | + |
| 70 | +# Microsoft App Id, needed when using the Microsoft Translation service. |
| 71 | +$egLiveTranslateMSAppId = ''; |
Index: trunk/extensions/LiveTranslate/includes/ext.lt.ms.js |
— | — | @@ -87,7 +87,7 @@ |
88 | 88 | $.getJSON( |
89 | 89 | 'http://api.microsofttranslator.com/V2/Ajax.svc/Translate?oncomplete=?', |
90 | 90 | { |
91 | | - 'appId': '9B1B396B48BBA6BF483B6C0A83CE2B07EF5D8F8C', // TODO |
| 91 | + 'appId': window.ltMsAppId, |
92 | 92 | 'from': sourceLang, |
93 | 93 | 'to': targetLang, |
94 | 94 | 'text': jQuery.trim( chunk ) // Trim, so the result does not contain preceding or tailing spaces. |
Index: trunk/extensions/LiveTranslate/includes/LiveTranslate_Functions.php |
— | — | @@ -41,6 +41,11 @@ |
42 | 42 | break; |
43 | 43 | case LTS_MS: |
44 | 44 | $modules[] = 'ext.lt.ms'; |
| 45 | + $wgOut->addScript( |
| 46 | + Html::inlineScript( |
| 47 | + 'var ltMsAppId = ' . FormatJson::encode( $GLOBALS['egLiveTranslateMSAppId'] ) . ';' |
| 48 | + ) |
| 49 | + ); |
45 | 50 | break; |
46 | 51 | } |
47 | 52 | |