Index: trunk/extensions/LiveTranslate/LiveTranslate.php |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | die( 'Not an entry point.' ); |
27 | 27 | } |
28 | 28 | |
29 | | -define( 'LiveTranslate_VERSION', '0.3 alpha' ); |
| 29 | +define( 'LiveTranslate_VERSION', '0.3 rc1' ); |
30 | 30 | |
31 | 31 | $wgExtensionCredits['other'][] = array( |
32 | 32 | 'path' => __FILE__, |
Index: trunk/extensions/LiveTranslate/LiveTranslate.hooks.php |
— | — | @@ -73,7 +73,9 @@ |
74 | 74 | |
75 | 75 | $outputDone = true; |
76 | 76 | } |
77 | | - else if ( $article->exists() |
| 77 | + else if ( |
| 78 | + $egGoogleApiKey != '' |
| 79 | + && $article->exists() |
78 | 80 | && ( count( $egLiveTranslateLanguages ) > 1 || ( count( $egLiveTranslateLanguages ) == 1 && $egLiveTranslateLanguages[0] != $currentLang ) ) ) { |
79 | 81 | $wgOut->addHTML( |
80 | 82 | '<span class="notranslate" id="livetranslatespan">' . |
— | — | @@ -101,18 +103,18 @@ |
102 | 104 | ) . |
103 | 105 | '</span>' |
104 | 106 | ); |
| 107 | + |
| 108 | + $wgOut->addScript( |
| 109 | + Html::linkedScript( 'https://www.google.com/jsapi?key=' . htmlspecialchars( $egGoogleApiKey ) ) . |
| 110 | + Html::inlineScript( |
| 111 | + 'google.load("language", "1");' . |
| 112 | + 'var sourceLang = ' . json_encode( $currentLang ) . ';' |
| 113 | + ) |
| 114 | + ); |
| 115 | + |
| 116 | + LiveTranslateFunctions::loadJs(); |
105 | 117 | } |
106 | 118 | |
107 | | - $wgOut->addScript( |
108 | | - Html::linkedScript( 'https://www.google.com/jsapi?key=' . htmlspecialchars( $egGoogleApiKey ) ) . |
109 | | - Html::inlineScript( |
110 | | - 'google.load("language", "1");' . |
111 | | - 'var sourceLang = ' . json_encode( $currentLang ) . ';' |
112 | | - ) |
113 | | - ); |
114 | | - |
115 | | - LiveTranslateFunctions::loadJs(); |
116 | | - |
117 | 119 | return true; |
118 | 120 | } |
119 | 121 | |
Index: trunk/extensions/LiveTranslate/RELEASE-NOTES |
— | — | @@ -5,9 +5,11 @@ |
6 | 6 | |
7 | 7 | |
8 | 8 | === Version 0.3 === |
9 | | -2011-01-xx |
| 9 | +2011-01-07 |
10 | 10 | |
| 11 | +* Added compatibility with IE8. |
11 | 12 | * Fixed issue with trim-prevention, causing |-signs to semi-randomly get inserted into translated text. |
| 13 | +* Only show the translation control when an API key is provided. |
12 | 14 | |
13 | 15 | === Version 0.2 === |
14 | 16 | 2010-12-24 |