r79852 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79851‎ | r79852 | r79853 >
Date:00:07, 8 January 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added Google branding thinghy and incremented version number
Modified paths:
  • /trunk/extensions/LiveTranslate/LiveTranslate.hooks.php (modified) (history)
  • /trunk/extensions/LiveTranslate/LiveTranslate.php (modified) (history)
  • /trunk/extensions/LiveTranslate/RELEASE-NOTES (modified) (history)

Diff [purge]

Index: trunk/extensions/LiveTranslate/LiveTranslate.php
@@ -25,7 +25,7 @@
2626 die( 'Not an entry point.' );
2727 }
2828
29 -define( 'LiveTranslate_VERSION', '0.3' );
 29+define( 'LiveTranslate_VERSION', '0.4 alpha' );
3030
3131 $wgExtensionCredits['other'][] = array(
3232 'path' => __FILE__,
Index: trunk/extensions/LiveTranslate/LiveTranslate.hooks.php
@@ -78,12 +78,11 @@
7979 && $article->exists()
8080 && ( count( $egLiveTranslateLanguages ) > 1 || ( count( $egLiveTranslateLanguages ) == 1 && $egLiveTranslateLanguages[0] != $currentLang ) ) ) {
8181 $wgOut->addHTML(
82 - '<span class="notranslate" id="livetranslatespan">' .
 82+ '<span class="notranslate" id="livetranslatespan" style="display:inline; float:right">' .
8383 Html::rawElement(
8484 'div',
8585 array(
86 - 'id' => 'livetranslatediv',
87 - 'style' => 'display:inline; float:right',
 86+ 'id' => 'livetranslatediv'
8887 ),
8988 htmlspecialchars( wfMsg( 'livetranslate-translate-to' ) ) .
9089 '&#160;' .
@@ -101,13 +100,14 @@
102101 wfMsg( 'livetranslate-button-revert' )
103102 )
104103 ) .
105 - '</span>'
 104+ '<br /><div id="googlebranding" style="display:inline; float:right"></div></span>'
106105 );
107106
108107 $wgOut->addScript(
109108 Html::linkedScript( 'https://www.google.com/jsapi?key=' . htmlspecialchars( $egGoogleApiKey ) ) .
110109 Html::inlineScript(
111 - 'google.load("language", "1");' .
 110+ 'google.load("language", "1");
 111+ google.setOnLoadCallback(function(){google.language.getBranding("googlebranding");});' .
112112 'var sourceLang = ' . json_encode( $currentLang ) . ';'
113113 )
114114 );
Index: trunk/extensions/LiveTranslate/RELEASE-NOTES
@@ -4,6 +4,12 @@
55 Latest version of the release notes: http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/LiveTranslate/RELEASE-NOTES?view=co
66
77
 8+=== Version 0.4 ===
 9+2011-01-xx
 10+
 11+* Added Google branding, which is required when using the Google Translate API.
 12+: https://code.google.com/apis/language/translate/v1/getting_started.html#getBranding
 13+
814 === Version 0.3 ===
915 2011-01-07
1016

Status & tagging log