Index: trunk/extensions/Wikilog/Wikilog.i18n.magic.php |
— | — | @@ -4,14 +4,13 @@ |
5 | 5 | * @addtogroup Extensions |
6 | 6 | */ |
7 | 7 | |
8 | | -// FIXME: Use $wgExtensionMessagesFiles[] and $magicWords. See f.e. extension ParserFunctions. |
9 | | -$words = array(); |
| 8 | +$magicWords = array(); |
10 | 9 | |
11 | 10 | /** |
12 | 11 | * English. |
13 | 12 | * @author Juliano F. Ravasi |
14 | 13 | */ |
15 | | -$words['en'] = array( |
| 14 | +$magicWords['en'] = array( |
16 | 15 | 'wl-settings' => array( 0, 'wl-settings' ), |
17 | 16 | 'wl-publish' => array( 0, 'wl-publish' ), |
18 | 17 | 'wl-author' => array( 0, 'wl-author' ), |
— | — | @@ -28,7 +27,7 @@ |
29 | 28 | * Portuguese. |
30 | 29 | * @author Juliano F. Ravasi |
31 | 30 | */ |
32 | | -$words['pt'] = array( |
| 31 | +$magicWords['pt'] = array( |
33 | 32 | 'wl-settings' => array( 0, 'wl-configs', 'wl-settings' ), |
34 | 33 | 'wl-publish' => array( 0, 'wl-publicar', 'wl-publish' ), |
35 | 34 | 'wl-author' => array( 0, 'wl-autor', 'wl-author' ), |
— | — | @@ -45,7 +44,7 @@ |
46 | 45 | * Brazilian Portuguese. |
47 | 46 | * @author Juliano F. Ravasi |
48 | 47 | */ |
49 | | -$words['pt-br'] = array( |
| 48 | +$magicWords['pt-br'] = array( |
50 | 49 | 'wl-settings' => array( 0, 'wl-configs', 'wl-settings' ), |
51 | 50 | 'wl-publish' => array( 0, 'wl-publicar', 'wl-publish' ), |
52 | 51 | 'wl-author' => array( 0, 'wl-autor', 'wl-author' ), |
Index: trunk/extensions/Wikilog/Wikilog.php |
— | — | @@ -50,6 +50,8 @@ |
51 | 51 | */ |
52 | 52 | $dir = dirname( __FILE__ ) . '/'; |
53 | 53 | $wgExtensionMessagesFiles['Wikilog'] = $dir . 'Wikilog.i18n.php'; |
| 54 | +$wgExtensionMessagesFiles['WikilogMagic'] = $dir . 'Wikilog.i18n.magic.php'; |
| 55 | +$wgExtensionMessagesFiles['WikilogAlias'] = $dir . 'Wikilog.i18n.alias.php'; |
54 | 56 | |
55 | 57 | /* |
56 | 58 | * Autoloaded classes. |
— | — | @@ -111,9 +113,6 @@ |
112 | 114 | $wgHooks['ArticleEditUpdates'][] = 'WikilogHooks::ArticleEditUpdates'; |
113 | 115 | $wgHooks['ArticleDeleteComplete'][] = 'WikilogHooks::ArticleDeleteComplete'; |
114 | 116 | $wgHooks['TitleMoveComplete'][] = 'WikilogHooks::TitleMoveComplete'; |
115 | | -$wgHooks['LanguageGetSpecialPageAliases'][] |
116 | | - = 'WikilogHooks::LanguageGetSpecialPageAliases'; |
117 | | -$wgHooks['LanguageGetMagic'][] = 'WikilogHooks::LanguageGetMagic'; |
118 | 117 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'WikilogHooks::ExtensionSchemaUpdates'; |
119 | 118 | $wgHooks['UnknownAction'][] = 'WikilogHooks::UnknownAction'; |
120 | 119 | |
— | — | @@ -128,6 +127,12 @@ |
129 | 128 | $wgHooks['GetLocalURL'][] = 'WikilogParser::GetLocalURL'; |
130 | 129 | $wgHooks['GetFullURL'][] = 'WikilogParser::GetFullURL'; |
131 | 130 | |
| 131 | +if ( !defined( 'MW_SUPPORTS_LOCALISATIONCACHE' ) ) { |
| 132 | + /* pre Mw1.16 compatibility */ |
| 133 | + $wgHooks['LanguageGetMagic'][] = 'WikilogHooks::LanguageGetMagic'; |
| 134 | + $wgHooks['LanguageGetSpecialPageAliases'][] = 'WikilogHooks::LanguageGetSpecialPageAliases'; |
| 135 | +} |
| 136 | + |
132 | 137 | /* |
133 | 138 | * Added rights. |
134 | 139 | */ |
Index: trunk/extensions/Wikilog/WikilogHooks.php |
— | — | @@ -232,6 +232,8 @@ |
233 | 233 | /** |
234 | 234 | * LanguageGetSpecialPageAliases hook handler function. |
235 | 235 | * Adds language aliases for special pages. |
| 236 | + * @note Deprecated in MediaWiki 1.16. |
| 237 | + * @todo Remove this in Wikilog 1.1.0, along with support for Mw < 1.16. |
236 | 238 | */ |
237 | 239 | static function LanguageGetSpecialPageAliases( &$specialPageAliases, $lang ) { |
238 | 240 | wfLoadExtensionMessages( 'Wikilog' ); |
— | — | @@ -243,13 +245,15 @@ |
244 | 246 | /** |
245 | 247 | * LanguageGetMagic hook handler function. |
246 | 248 | * Adds language aliases for magic words. |
| 249 | + * @note Deprecated in MediaWiki 1.16. |
| 250 | + * @todo Remove this in Wikilog 1.1.0, along with support for Mw < 1.16. |
247 | 251 | */ |
248 | | - static function LanguageGetMagic( &$magicWords, $lang ) { |
| 252 | + static function LanguageGetMagic( &$words, $lang ) { |
249 | 253 | require( 'Wikilog.i18n.magic.php' ); |
250 | | - if ( $lang == 'en' || !isset( $words[$lang] ) ) { |
251 | | - $magicWords += $words['en']; |
| 254 | + if ( $lang == 'en' || !isset( $magicWords[$lang] ) ) { |
| 255 | + $words += $magicWords['en']; |
252 | 256 | } else { |
253 | | - $magicWords += array_merge( $words['en'], $words[$lang] ); |
| 257 | + $words += array_merge( $magicWords['en'], $magicWords[$lang] ); |
254 | 258 | } |
255 | 259 | return true; |
256 | 260 | } |
Index: trunk/extensions/Wikilog/Wikilog.i18n.alias.php |
— | — | @@ -0,0 +1,23 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Special page aliases used by Wikilog extension. |
| 5 | + * @addtogroup Extensions |
| 6 | + */ |
| 7 | + |
| 8 | +$specialPageAliases = array(); |
| 9 | + |
| 10 | +/** |
| 11 | + * English. |
| 12 | + * @author Juliano F. Ravasi |
| 13 | + */ |
| 14 | +$specialPageAliases['en'] = array( |
| 15 | + 'Wikilog' => array( 'Wikilog', 'Wikilogs' ), |
| 16 | +); |
| 17 | + |
| 18 | +/** |
| 19 | + * Portuguese (Português) |
| 20 | + * @author Juliano F. Ravasi |
| 21 | + */ |
| 22 | +$specialPageAliases['pt'] = array( |
| 23 | + 'Wikilog' => array( 'Wikilog', 'Wikilogs' ), |
| 24 | +); |
Property changes on: trunk/extensions/Wikilog/Wikilog.i18n.alias.php |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 25 | + native |
Index: trunk/extensions/Wikilog/Wikilog.i18n.php |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | |
21 | 21 | # Special:Wikilog |
22 | 22 | 'wikilog' => 'Wikilogs', # Page title |
23 | | - 'wikilog-specialwikilog' => 'Wikilog', # Special page name |
| 23 | + 'wikilog-specialwikilog' => 'Wikilog', # Special page name (DEPRECATED AFTER MW1.16) |
24 | 24 | |
25 | 25 | # Logs |
26 | 26 | 'wikilog-log-pagename' => 'Wikilog actions log', |
— | — | @@ -103,8 +103,8 @@ |
104 | 104 | 'wikilog-feed-description' => 'Read the most recent posts in this feed.', |
105 | 105 | |
106 | 106 | # Item and comments page titles |
107 | | - 'wikilog-title-item-full' => '$1 - $2', # 1 = article title, $2 wikilog title |
108 | | - 'wikilog-title-comments' => 'Comments - $1', # 1 = article title |
| 107 | + 'wikilog-title-item-full' => '$1 - $2', # $1 = article title, $2 wikilog title |
| 108 | + 'wikilog-title-comments' => 'Comments - $1', # $1 = article title |
109 | 109 | |
110 | 110 | # Warning and error messages |
111 | 111 | 'wikilog-error-msg' => 'Wikilog: $1', |
— | — | @@ -182,7 +182,6 @@ |
183 | 183 | 'right-wl-postcomment' => 'Poste Kommentare zu Wikilog-Beiträgen', |
184 | 184 | 'right-wl-moderation' => 'Moderation von Kommentaren zu wikilog-Beiträgen', |
185 | 185 | 'wikilog' => 'Wikilogs', # Page title |
186 | | - 'wikilog-specialwikilog' => 'Wikilog', # Special page name |
187 | 186 | 'wikilog-tab' => 'Wikilog', |
188 | 187 | 'wikilog-tab-title' => 'Wikilog Aktionen', |
189 | 188 | 'wikilog-information' => 'Wikilog Information', |
— | — | @@ -235,7 +234,7 @@ |
236 | 235 | 'wikilog-newtalk-summary' => 'automatisch erzeugt durch Wikilog', |
237 | 236 | 'wikilog-feed-title' => '{{SITENAME}} - $1 [$2]', # $1 = title, $2 = content language |
238 | 237 | 'wikilog-feed-description' => 'Lese die neuesten Beiträge in diesem Feed.', |
239 | | - 'wikilog-title-item-full' => '$1 - $2', # 1 = article title, $2 wikilog title |
| 238 | + 'wikilog-title-item-full' => '$1 - $2', # $1 = article title, $2 wikilog title |
240 | 239 | 'wikilog-error-msg' => 'Wikilog: $1', |
241 | 240 | 'wikilog-error-title' => 'Wikilog Fehler', |
242 | 241 | 'wikilog-invalid-param' => 'Ungültiger Parameter: $1.', |
— | — | @@ -294,7 +293,6 @@ |
295 | 294 | 'right-wl-postcomment' => 'Postar comentários em artigos wikilog', |
296 | 295 | 'right-wl-moderation' => 'Moderação de comentários de artigos wikilog', |
297 | 296 | 'wikilog' => 'Wikilogs', |
298 | | - 'wikilog-specialwikilog' => 'Wikilog', |
299 | 297 | 'wikilog-log-pagename' => 'Registro de ações wikilog', |
300 | 298 | 'wikilog-log-pagetext' => 'Abaixo está uma lista das ações wikilog.', |
301 | 299 | 'wikilog-log-cmt-approve' => 'aprovou o comentário [[$1]]', |
— | — | @@ -357,8 +355,8 @@ |
358 | 356 | 'wikilog-newtalk-summary' => 'criado automaticamente pelo wikilog', |
359 | 357 | 'wikilog-feed-title' => '{{SITENAME}} - $1 [$2]', # $1 = title, $2 = content language |
360 | 358 | 'wikilog-feed-description' => 'Leia as postagens mais recentes neste feed.', |
361 | | - 'wikilog-title-item-full' => '$1 - $2', # 1 = article title, $2 wikilog title |
362 | | - 'wikilog-title-comments' => 'Comentários - $1', # 1 = article title |
| 359 | + 'wikilog-title-item-full' => '$1 - $2', # $1 = article title, $2 wikilog title |
| 360 | + 'wikilog-title-comments' => 'Comentários - $1', # $1 = article title |
363 | 361 | 'wikilog-error-msg' => 'Wikilog: $1', |
364 | 362 | 'wikilog-invalid-param' => 'Parâmetro inválido: $1.', |
365 | 363 | 'wikilog-invalid-author' => 'Autor inválido: $1.', |