Index: trunk/extensions/Translate/groups/mediawiki-defines.txt |
— | — | @@ -1041,6 +1041,10 @@ |
1042 | 1042 | file = Translate/PageTranslation.i18n.php |
1043 | 1043 | descmsg = tpt-desc |
1044 | 1044 | |
| 1045 | +Transliterator |
| 1046 | +magicfile = Transliterator/Transliterator.i18n.magic.php |
| 1047 | +optional = transliterator-prefix |
| 1048 | + |
1045 | 1049 | Trusted XFF |
1046 | 1050 | |
1047 | 1051 | TSPoll |
Index: trunk/extensions/Transliterator/Transliterator.i18n.magic.php |
— | — | @@ -0,0 +1,10 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +$magicWords = array(); |
| 5 | + |
| 6 | +/** |
| 7 | + * English |
| 8 | + */ |
| 9 | +$magicWords['en'] = array( |
| 10 | + 'transliterate' => array( 0, 'transliterate' ), |
| 11 | +); |
Property changes on: trunk/extensions/Transliterator/Transliterator.i18n.magic.php |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 12 | + native |
Index: trunk/extensions/Transliterator/Transliterator.i18n.php |
— | — | @@ -2,6 +2,9 @@ |
3 | 3 | /** |
4 | 4 | * Internationalization file for Transliterator |
5 | 5 | */ |
| 6 | + |
| 7 | +require_once( dirname(__FILE__) . '/Transliterator.i18n.magic.php' ); |
| 8 | + |
6 | 9 | $messages = array(); |
7 | 10 | |
8 | 11 | /** |
— | — | @@ -11,7 +14,6 @@ |
12 | 15 | */ |
13 | 16 | $messages['en'] = array( |
14 | 17 | 'transliterator-desc' => "Provides a configurable parser function for transliteration", |
15 | | - 'transliterator-invoke' => 'transliterate', // {{#transliterate:blah}} |
16 | 18 | 'transliterator-prefix' => 'Transliterator:', // [[MediaWiki:Transliterator:blah]] NOTE: changing this requires moving all maps |
17 | 19 | // $1 is the line from the map, 'a => z', $2 is the map-page including prefix. |
18 | 20 | 'transliterator-error-ambiguous' => "Ambiguous rule <code>$1</code> in [[MediaWiki:$2]]", |
— | — | @@ -28,7 +30,6 @@ |
29 | 31 | */ |
30 | 32 | $messages['qqq'] = array( |
31 | 33 | 'transliterator-desc' => 'This is a short description of the extension. It is shown in [[Special:Version]].', |
32 | | - 'transliterator-invoke' => "This is the name of a parserfunction: {<nowiki />{#transliterate:''blah''}}", |
33 | 34 | 'transliterator-prefix' => "This is a prefix for the transliteration maps, used in the MediaWiki namespace like [<nowiki />[MediaWiki:Transliterator:''blah'']]. Changing this requires moving all maps.", |
34 | 35 | 'transliterator-error-ambiguous' => 'Parameters: |
35 | 36 | * $1 is the line from the map, such as: <code>a => z</code> |
— | — | @@ -51,12 +52,10 @@ |
52 | 53 | */ |
53 | 54 | $messages['de'] = array( |
54 | 55 | 'transliterator-desc' => 'Stellt eine konfigurierbare Parserfunktion zur Transliteration bereit.', |
55 | | - 'transliterator-invoke' => 'transliterate', |
56 | | - 'transliterator-prefix' => 'Transliterator:', |
57 | 56 | 'transliterator-error-ambiguous' => 'Mehrdeutige Regel <code>$1</code> in [[MediaWiki:$2]]', |
58 | 57 | 'transliterator-error-syntax' => 'Fehlerhafte Syntax in Regel <code>$1</code> in [[MediaWiki:$2]]', |
59 | 58 | 'transliterator-error-rulecount' => 'Mehr als die {{PLURAL:$1|erlaubte eine Regel|die erlabubten $1 Regeln}} in [[MediaWiki:$2]]', |
60 | | - 'transliterator-error-rulesize' => 'In der Regel <code>$1</code> {{PLURAL:$3|ist|sind}} mehr als $3 Zeichen auf der ligken Seite in [[MediaWiki:$2]]', |
| 59 | + 'transliterator-error-rulesize' => 'In der Regel <code>$1</code> {{PLURAL:$3|ist|sind}} mehr als $3 Zeichen auf der linken Seite in [[MediaWiki:$2]]', |
61 | 60 | ); |
62 | 61 | |
63 | 62 | /** |
— | — | @@ -65,8 +64,6 @@ |
66 | 65 | */ |
67 | 66 | $messages['ksh'] = array( |
68 | 67 | 'transliterator-desc' => 'Deiht en ennstellbaa Paaserfunxjuhn en et Wiki, di Boochshtabe tuusche kann.', |
69 | | - 'transliterator-invoke' => 'transliterate', |
70 | | - 'transliterator-prefix' => 'Transliterator:', |
71 | 68 | 'transliterator-error-ambiguous' => 'En unkloh Rejel <code>$1</code> es en [[MediaWiki:$2]]', |
72 | 69 | 'transliterator-error-syntax' => 'En kappodde Syntax <code>$1</code> es en [[MediaWiki:$2]]', |
73 | 70 | 'transliterator-error-rulecount' => 'Et {{PLURAL:$1|es mieh wi ein Rejel|sinn_er mieh wi $1 Rejelle|es kei Rejel}} en [[MediaWiki:$2]]', |
Index: trunk/extensions/Transliterator/Transliterator.php |
— | — | @@ -22,6 +22,8 @@ |
23 | 23 | * semi-case-sensitive by default, fix bugs with edge-detection and html-entities |
24 | 24 | * @version 1.2.1 |
25 | 25 | * added cache support |
| 26 | + * @version 1.2.2 |
| 27 | + * use new magic word i18n system |
26 | 28 | */ |
27 | 29 | |
28 | 30 | /** |
— | — | @@ -53,7 +55,7 @@ |
54 | 56 | |
55 | 57 | $wgExtensionCredits['parserhook'][] = array( |
56 | 58 | 'name' => 'Transliterator', |
57 | | - 'version' => '1.2.0', |
| 59 | + 'version' => '1.2.2', |
58 | 60 | 'descriptionmsg' => 'transliterator-desc', |
59 | 61 | 'author' => 'Conrad Irwin', |
60 | 62 | 'url' => 'http://www.mediawiki.org/wiki/Extension:Transliterator', |
— | — | @@ -66,7 +68,6 @@ |
67 | 69 | $wgExtensionFunctions[] = 'ExtTransliterator::setup'; |
68 | 70 | } |
69 | 71 | $wgExtensionMessagesFiles['Transliterator'] = dirname(__FILE__).'/Transliterator.i18n.php'; |
70 | | -$wgHooks['LanguageGetMagic'][] = 'ExtTransliterator::getMagic'; |
71 | 72 | $wgHooks['ArticleDeleteComplete'][] = 'ExtTransliterator::purgeMap'; |
72 | 73 | $wgHooks['NewRevisionFromEditComplete'][] = 'ExtTransliterator::purgeMap'; |
73 | 74 | $wgHooks['ArticlePurge'][] = 'ExtTransliterator::purgeMap'; |
— | — | @@ -498,17 +499,7 @@ |
499 | 500 | } |
500 | 501 | return true; |
501 | 502 | } |
502 | | - |
503 | | - /** |
504 | | - * Load the magic words |
505 | | - */ |
506 | | - static function getMagic( &$magicWords, $langCode ) { |
507 | | - wfLoadExtensionMessages('Transliterator'); |
508 | 503 | |
509 | | - $magicWords['transliterate'] = array( 0, 'transliterate', wfMsg( 'transliterator-invoke' ) ); |
510 | | - return true; |
511 | | - } |
512 | | - |
513 | 504 | /** |
514 | 505 | * Called on first use to create singleton |
515 | 506 | */ |