Index: trunk/extensions/CategoryTests/CategoryTests.i18n.magic.php |
— | — | @@ -3,22 +3,15 @@ |
4 | 4 | * Magic word localization for the CategoryTests extension |
5 | 5 | */ |
6 | 6 | |
7 | | -$words = array(); |
| 7 | +$magicWords = array(); |
8 | 8 | |
9 | 9 | /** English |
10 | 10 | * @author Ryan Schmidt |
11 | 11 | */ |
12 | | -$words['en'] = array( |
| 12 | +$magicWords['en'] = array( |
13 | 13 | 'ifcategory' => array( 0, 'ifcategory' ), |
14 | 14 | 'ifnocategories' => array( 0, 'ifnocategories' ), |
15 | 15 | 'switchcategory' => array( 0, 'switchcategory' ), |
16 | 16 | 'default' => array( 0, '#default' ), |
17 | 17 | 'page' => array( 0, '#page' ) |
18 | 18 | ); |
19 | | - |
20 | | -/** |
21 | | - * Note for non-English translations |
22 | | - * Unlike the English one above where the array has two values, all translations must have THREE values, like so: |
23 | | - * 'ifcategory' => array( 0, 'translation_goes_here', 'ifcategory' ) |
24 | | - * The third value should be the same as the name of the key string you are translating for |
25 | | - */ |
Index: trunk/extensions/CategoryTests/CategoryTests.i18n.php |
— | — | @@ -3,11 +3,13 @@ |
4 | 4 | * Internationalization file for the CategoryTests extension |
5 | 5 | */ |
6 | 6 | |
| 7 | +require_once( dirname(__FILE__) . '/CategoryTests.i18n.magic.php' ); |
| 8 | + |
7 | 9 | $messages = array(); |
8 | 10 | |
9 | 11 | /** English |
10 | 12 | * @author Ryan Schmidt |
11 | 13 | */ |
12 | 14 | $messages['en'] = array( |
13 | | - 'categorytests' => 'Functions for category testing' |
| 15 | + 'categorytests-desc' => 'Functions for category testing' |
14 | 16 | ); |
Index: trunk/extensions/CategoryTests/CategoryTests.php |
— | — | @@ -15,14 +15,13 @@ |
16 | 16 | $wgExtensionCredits['parserhook'][] = array( |
17 | 17 | 'path' => __FILE__, |
18 | 18 | 'name' => 'Category Tests', |
19 | | - 'version' => '1.2', |
| 19 | + 'version' => '1.3', |
20 | 20 | 'url' => 'http://www.mediawiki.org/wiki/Extension:CategoryTests', |
21 | 21 | 'author' => 'Ryan Schmidt', |
22 | 22 | 'description' => 'Functions for category testing', |
23 | | - 'descriptionmsg' => 'categorytests', |
| 23 | + 'descriptionmsg' => 'categorytests-desc', |
24 | 24 | ); |
25 | 25 | |
26 | | -$wgHooks['LanguageGetMagic'][] = 'wfCategoryTestsLanguageGetMagic'; |
27 | 26 | $wgExtensionMessagesFiles['CategoryTests'] = dirname( __FILE__ ) . '/CategoryTests.i18n.php'; |
28 | 27 | |
29 | 28 | function wfCategoryTests() { |
— | — | @@ -34,19 +33,6 @@ |
35 | 34 | $wgParser->setFunctionHook( 'switchcategory', array( &$wgExtCategoryTests, 'switchcategory' ) ); |
36 | 35 | } |
37 | 36 | |
38 | | -function wfCategoryTestsLanguageGetMagic( &$magicWords, $langCode ) { |
39 | | - require_once( dirname( __FILE__ ) . '/CategoryTests.i18n.magic.php' ); |
40 | | - if ( $langCode == 'en' || !array_key_exists( $langCode, $words ) ) { |
41 | | - $functions = $words['en']; |
42 | | - } else { |
43 | | - $functions = array_merge( $words[$langCode], $words['en'] ); |
44 | | - } |
45 | | - foreach ( $functions as $key => $value ) { |
46 | | - $magicWords[$key] = $value; |
47 | | - } |
48 | | - return true; |
49 | | -} |
50 | | - |
51 | 37 | Class ExtCategoryTests { |
52 | 38 | |
53 | 39 | function ifcategory( &$parser, $category = '', $then = '', $else = '', $pagename = '' ) { |
Index: trunk/extensions/Translate/groups/mediawiki-defines.txt |
— | — | @@ -94,6 +94,9 @@ |
95 | 95 | Category Stepper |
96 | 96 | ignored = categorystepper |
97 | 97 | |
| 98 | +Category Tests |
| 99 | +magicfile = CategoryTests/CategoryTests.i18n.magic.php |
| 100 | + |
98 | 101 | Category Tree |
99 | 102 | aliasfile = CategoryTree/CategoryTree.alias.php |
100 | 103 | ignored = categorytree-collapse-bullet, categorytree-expand-bullet, |