Index: trunk/extensions/Translate/SpecialLanguageStats.php |
— | — | @@ -162,20 +162,9 @@ |
163 | 163 | return $red . $green . $blue; |
164 | 164 | } |
165 | 165 | |
166 | | - /** |
167 | | - * HTML for language statistics |
168 | | - * Copied and adaped from groupStatistics.php by Nikerabbit |
169 | | - * @param integer $code A language code (default empty, example: 'en'). |
170 | | - * @param bool $suppressComplete If completely translated groups should be suppressed |
171 | | - * @return string HTML |
172 | | - */ |
173 | | - function getGroupStats( $code, $suppressComplete = false ) { |
174 | | - global $wgUser, $wgLang; |
175 | | - |
176 | | - $out = ''; |
177 | | - |
| 166 | + function createHeader( $code ) { |
178 | 167 | # FIXME: provide some sensible header for what is being displayed. |
179 | | - $out .= '<!-- ' . $code . " -->\n"; |
| 168 | + $out = '<!-- ' . $code . " -->\n"; |
180 | 169 | $out .= '<!-- ' . TranslateUtils::getLanguageName( $code, false ) . " -->\n"; |
181 | 170 | |
182 | 171 | # Create table header |
— | — | @@ -188,6 +177,21 @@ |
189 | 178 | $out .= $this->element( wfMsg( 'translate-percentage-fuzzy', true ) ); |
190 | 179 | $out .= $this->blockend(); |
191 | 180 | |
| 181 | + return $out; |
| 182 | + } |
| 183 | + |
| 184 | + /** |
| 185 | + * HTML for language statistics |
| 186 | + * Copied and adaped from groupStatistics.php by Nikerabbit |
| 187 | + * @param integer $code A language code (default empty, example: 'en'). |
| 188 | + * @param bool $suppressComplete If completely translated groups should be suppressed |
| 189 | + * @return string HTML |
| 190 | + */ |
| 191 | + function getGroupStats( $code, $suppressComplete = false ) { |
| 192 | + global $wgUser, $wgLang; |
| 193 | + |
| 194 | + $out = ''; |
| 195 | + |
192 | 196 | # Fetch groups stats have to be displayed for |
193 | 197 | $groups = $this->getGroups(); |
194 | 198 | |
— | — | @@ -237,7 +241,12 @@ |
238 | 242 | $out .= $this->blockend(); |
239 | 243 | } |
240 | 244 | |
241 | | - $out .= $this->footer(); |
| 245 | + if( $out ) { |
| 246 | + $out = $this->createHeader( $code ) . $out; |
| 247 | + $out .= $this->footer(); |
| 248 | + } else { |
| 249 | + $out = wfMsgExt( 'translate-nothing-to-do', 'parse' ); |
| 250 | + } |
242 | 251 | |
243 | 252 | return $out; |
244 | 253 | } |
Index: trunk/extensions/Translate/Translate.i18n.php |
— | — | @@ -192,6 +192,8 @@ |
193 | 193 | 'translate-untranslated' => 'Untranslated', |
194 | 194 | 'translate-percentage-complete' => 'Completion', |
195 | 195 | 'translate-percentage-fuzzy' => 'Outdated', |
| 196 | + 'translate-nothing-to-do' => 'All possible translations appear to have been made. |
| 197 | +You are encouraged to review messages through [[Special:Translate|{{int:translate}}]].', |
196 | 198 | 'translate-languagestats-groups' => ' # Add message group IDs, one per line to restrict the message groups that |
197 | 199 | # are shown on Special:LanguageStats. Non-existing message group IDs will |
198 | 200 | # be ignored.', # do not duplicate this message to other languages |