Index: trunk/extensions/Translate/groups/mediawiki-defines.txt |
— | — | @@ -1508,7 +1508,7 @@ |
1509 | 1509 | aliasfile = Translate/Translate.alias.php |
1510 | 1510 | optional = translate-page-paging-links, translate-languagestats-groups, supportedlanguages-portallink, supportedlanguages-portallink-nocldr |
1511 | 1511 | optional = translate-edit-tab-next, translate-edit-tab-prev |
1512 | | -ignored = translate-edit-tag-warning |
| 1512 | +ignored = translate-edit-tag-warning, supportedlanguages-localsummary |
1513 | 1513 | |
1514 | 1514 | Translate - First Steps |
1515 | 1515 | id = ext-translate-firststeps |
Index: trunk/extensions/Translate/README |
— | — | @@ -30,6 +30,9 @@ |
31 | 31 | |
32 | 32 | == Change log == |
33 | 33 | |
| 34 | +* 2011-09-26 |
| 35 | +- Special:SupportedLanguages can now show site specific messages in |
| 36 | + supportedlanguages-localsummary message |
34 | 37 | * 2011-09-23 |
35 | 38 | - Change log up to date |
36 | 39 | * 2011-09-21 |
Index: trunk/extensions/Translate/Translate.i18n.php |
— | — | @@ -255,14 +255,12 @@ |
256 | 256 | |
257 | 257 | # Special:SupportedLanguages |
258 | 258 | 'supportedlanguages' => 'Supported languages', |
259 | | - 'supportedlanguages-summary' => 'This page displays a list of all the languages supported by {{SITENAME}}, together with the names of the translators working on that language. |
260 | | -If you want more information on a particular language, you can click on the link to the portal for that language. |
261 | | -Clicking on a translator name will take you to their user page. |
262 | | - |
263 | | -If a language is not listed, you can find out how to start a localization project for a language at "[[Translating:Process|New Language]]". |
264 | | - |
265 | | -If you translate to a language and your name is not included, please add your name to the list of translators on the [[:Category:Languages|portal]] for that language. |
266 | | -See the menu bar for a link to the portal for the language of your preference.', |
| 259 | + 'supportedlanguages-summary' => 'This page shows a list of all languages supported by {{SITENAME}}, |
| 260 | +together with the names of the translators working on that language. |
| 261 | +A translator\'s name appears larger, the more edits the translator has contributed. |
| 262 | +The colour of an underline indicates how recently a translator has been active here.', |
| 263 | + 'supportedlanguages-colorlegend' => 'Legend for the color: Last translation $1 days ago.', |
| 264 | + 'supportedlanguages-localsummary' => '', |
267 | 265 | 'supportedlanguages-portallink' => '[$1] $2 - $3', |
268 | 266 | 'supportedlanguages-portallink-nocldr' => '[$1] $2', |
269 | 267 | 'supportedlanguages-translators' => '{{PLURAL:$2|Translator|Translators}}: $1', |
Index: trunk/extensions/Translate/specials/SpecialSupportedLanguages.php |
— | — | @@ -20,9 +20,12 @@ |
21 | 21 | * @ingroup SpecialPage TranslateSpecialPage |
22 | 22 | */ |
23 | 23 | class SpecialSupportedLanguages extends SpecialPage { |
24 | | - // Whether to skip and regenerate caches |
| 24 | + /// Whether to skip and regenerate caches |
25 | 25 | protected $purge = false; |
26 | 26 | |
| 27 | + /// Cutoff time for inactivity in days |
| 28 | + protected $period = 180; |
| 29 | + |
27 | 30 | public function __construct() { |
28 | 31 | parent::__construct( 'SupportedLanguages' ); |
29 | 32 | } |
— | — | @@ -44,6 +47,8 @@ |
45 | 48 | } |
46 | 49 | |
47 | 50 | $this->outputHeader(); |
| 51 | + $wgOut->addWikiMsg( 'supportedlanguages-colorlegend', $this->getColorLegend() ); |
| 52 | + $wgOut->addWikiMsg( 'supportedlanguages-localsummary' ); |
48 | 53 | |
49 | 54 | // Check if CLDR extension has been installed. |
50 | 55 | $cldrInstalled = class_exists( 'LanguageNames' ); |
— | — | @@ -154,7 +159,7 @@ |
155 | 160 | $conds = array( |
156 | 161 | 'rc_title' . $dbr->buildLike( $dbr->anyString(), '/', $dbr->anyString() ), |
157 | 162 | 'rc_namespace' => $wgTranslateMessageNamespaces, |
158 | | - 'rc_timestamp > ' . $dbr->timestamp( TS_DB, wfTimeStamp( TS_UNIX ) - 60 * 60 * 24 * 180 ), |
| 163 | + 'rc_timestamp > ' . $dbr->timestamp( TS_DB, wfTimeStamp( TS_UNIX ) - 60 * 60 * 24 * $this->period ), |
159 | 164 | ); |
160 | 165 | $options = array( 'GROUP BY' => 'lang', 'HAVING' => 'count > 20' ); |
161 | 166 | |
— | — | @@ -271,7 +276,7 @@ |
272 | 277 | |
273 | 278 | // Scale of the activity colors, anything |
274 | 279 | // longer than this is just inactive |
275 | | - $period = 180; |
| 280 | + $period = $this->period; |
276 | 281 | |
277 | 282 | $links = array(); |
278 | 283 | |
— | — | @@ -387,4 +392,12 @@ |
388 | 393 | $lb->execute(); |
389 | 394 | } |
390 | 395 | |
| 396 | + protected function getColorLegend() { |
| 397 | + $legend = ''; |
| 398 | + $period = $this->period; |
| 399 | + for ( $i = 0; $i <= $period; $i+=30 ) { |
| 400 | + $legend .= '<span style="background-color:#' . $this->getActivityColour( $period - $i, $period ) . "\"> $i</span>"; |
| 401 | + } |
| 402 | + return $legend; |
| 403 | + } |
391 | 404 | } |