Yaron Koren has submitted this change and it was merged. Change subject: Changed $egAutoTranslate to $egLTAutoTranslate, fix for MW <= 1.6, typo fixes ......................................................................
Changed $egAutoTranslate to $egLTAutoTranslate, fix for MW <= 1.6, typo fixes Change-Id: I5d0ccffcefd1593b869775345d024fd71928a585 --- M LiveTranslate_Settings.php M includes/LiveTranslate_Functions.php M includes/ext.lt.google.js M includes/ext.lt.ms.js 4 files changed, 16 insertions(+), 16 deletions(-) Approvals: Yaron Koren: Verified; Looks good to me, approved diff --git a/LiveTranslate_Settings.php b/LiveTranslate_Settings.php index 6c367bc..dbe067c 100644 --- a/LiveTranslate_Settings.php +++ b/LiveTranslate_Settings.php @@ -80,4 +80,4 @@ $egLiveTranslateLanguages[] = 'de'; # Auto-translation enabled. -$egAutoTranslate = true; +$egLTAutoTranslate = true; diff --git a/includes/LiveTranslate_Functions.php b/includes/LiveTranslate_Functions.php index c60524e..23fd644 100644 --- a/includes/LiveTranslate_Functions.php +++ b/includes/LiveTranslate_Functions.php @@ -82,7 +82,7 @@ case LTS_MS: $wgOut->addScript( Html::inlineScript( - 'var ltMsAppId = ' . FormatJson::encode( $GLOBALS['egLiveTranslateMSAppId'] ) . ';' + 'var ltMsAppId = ' . FormatJson::encode( LTMSHTTPTranslator::getAppId() ) . ';' ) ); $wgOut->addHeadItem( @@ -171,7 +171,7 @@ } /** - * Returns the language that wikitext should be auto-translated to, if $egAutoTranslate is set to true. + * Returns the language that wikitext should be auto-translated to, if $egLTAutoTranslate is set to true. * Auto-translation happens if the query string contains language= or the user preference for language, * or even using a cookie set by Live Translate previously. * @@ -182,9 +182,9 @@ * @return string Language to auto-translate to */ public static function getAutoTranslateLang( $currentLang ) { - global $wgRequest, $wgUser, $egAutoTranslate; + global $wgRequest, $wgUser, $egLTAutoTranslate; - if( !$egAutoTranslate ) { + if( !$egLTAutoTranslate ) { return $currentLang; } diff --git a/includes/ext.lt.google.js b/includes/ext.lt.google.js index 4bb2a22..ddd1d75 100644 --- a/includes/ext.lt.google.js +++ b/includes/ext.lt.google.js @@ -38,7 +38,7 @@ var sentenceCount = 0; var currentLength = 0; - // Find the scentances that can be put in the current chunk. + // Find the sentences that can be put in the current chunk. for ( i in untranslatedsentences ) { sentenceCount++; @@ -47,7 +47,7 @@ } else if ( untranslatedsentences[i].length > 0 ) { if ( currentLength == 0 ) { - // If the first scentance is longer then the max chunk legth, split it. + // If the first sentence is longer then the max chunk length, split it. partToUse = untranslatedsentences[i].substr( 0, currentMaxSize - currentLength ); remainingPart = untranslatedsentences[i].substr( currentMaxSize - currentLength ); } @@ -67,17 +67,17 @@ } } - // If there is a remaining part, re-add it to the scentances to translate list. + // If there is a remaining part, re-add it to the sentences to translate list. if ( remainingPart !== false ) { untranslatedsentences.unshift( remainingPart ); } - // If there is a partial scentance, add it to the chunk. + // If there is a partial sentence, add it to the chunk. if ( partToUse !== false ) { chunk += partToUse; } - // If the lenght is 0, the element has been translated. + // If the length is 0, the element has been translated. if ( chunk.length == 0 ) { this.handleTranslationCompletion(); return; @@ -176,4 +176,4 @@ } } -}; })( jQuery, window.liveTranslate ); \ No newline at end of file +}; })( jQuery, window.liveTranslate ); diff --git a/includes/ext.lt.ms.js b/includes/ext.lt.ms.js index 758586d..8087122 100644 --- a/includes/ext.lt.ms.js +++ b/includes/ext.lt.ms.js @@ -46,7 +46,7 @@ } else if ( untranslatedsentences[i].length > 0 ) { if ( currentLength == 0 ) { - // If the first scentance is longer then the max chunk legth, split it. + // If the first sentence is longer then the max chunk length, split it. partToUse = untranslatedsentences[i].substr( 0, currentMaxSize - currentLength ); remainingPart = untranslatedsentences[i].substr( currentMaxSize - currentLength ); } @@ -66,17 +66,17 @@ } } - // If there is a remaining part, re-add it to the scentances to translate list. + // If there is a remaining part, re-add it to the sentences to translate list. if ( remainingPart !== false ) { untranslatedsentences.unshift( remainingPart ); } - // If there is a partial scentance, add it to the chunk. + // If there is a partial sentence, add it to the chunk. if ( partToUse !== false ) { chunk += partToUse; } - // If the lenght is 0, the element has been translated. + // If the length is 0, the element has been translated. if ( chunk.length == 0 ) { this.handleTranslationCompletion(); return; @@ -230,4 +230,4 @@ } -}; })( jQuery, window.liveTranslate ); \ No newline at end of file +}; })( jQuery, window.liveTranslate ); -- To view, visit https://gerrit.wikimedia.org/r/71544 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5d0ccffcefd1593b869775345d024fd71928a585 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/LiveTranslate Gerrit-Branch: master Gerrit-Owner: Yaron Koren <yaro...@gmail.com> Gerrit-Reviewer: Yaron Koren <yaro...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits