Index: trunk/extensions/UploadWizard/UploadWizardMessages.php |
— | — | @@ -1,59 +0,0 @@ |
2 | | -<?php |
3 | | -/** |
4 | | - * UploadWizardMessages |
5 | | - * |
6 | | - * Simple class to take messages from a modules' i18n.php and dump them into Javascript. |
7 | | - * |
8 | | - * @file |
9 | | - * @ingroup Upload |
10 | | - */ |
11 | | - |
12 | | -/* This class is temporary, until Resource Loader is available. */ |
13 | | - |
14 | | -class UploadWizardMessages { |
15 | | - |
16 | | - /** |
17 | | - * getMessagesJs generates a javascript addMessages() calls for a given module and language |
18 | | - * |
19 | | - * @param String $moduleName the name of the module |
20 | | - * @param String $langCode Name of scriptText module ( that hosts messages ) |
21 | | - * @return string |
22 | | - */ |
23 | | - public static function getMessagesJs( $moduleName, $language ) { |
24 | | - global $wgOut; |
25 | | - |
26 | | - // TODO this should be cached. Perhaps with Localisation Cache. |
27 | | - global $wgExtensionMessagesFiles; |
28 | | - |
29 | | - // Empty out messages in the current scope |
30 | | - $messages = array(); |
31 | | - require( $wgExtensionMessagesFiles[ $moduleName ] ); |
32 | | - |
33 | | - // iterate over the default messages, and get this wiki's current messages |
34 | | - // presumably this will include local overrides in MediaWiki: space |
35 | | - $messagesForJs = array(); |
36 | | - |
37 | | - // 'en' is the default language, so it will be the most complete |
38 | | - foreach ( array_keys( $messages['en'] ) as $key ) { |
39 | | - $messagesForJs[ $key ] = wfMsgGetKey( $key, /*DB*/true, $language, /*Transform*/false ); |
40 | | - } |
41 | | - |
42 | | - $messagesJson = FormatJson::encode( $messagesForJs ); |
43 | | - return 'window.mediaWiki.addMessages(' . $messagesJson . ');'; |
44 | | - } |
45 | | - |
46 | | - |
47 | | - static function getNormalizedLangCode( $langCode ) { |
48 | | - global $wgLang; |
49 | | - // Check the langCode |
50 | | - if ( !$langCode ) { |
51 | | - if ( $wgLang ) { |
52 | | - $langCode = $wgLang->getCode(); |
53 | | - } else { |
54 | | - $langCode = 'en'; // desperation |
55 | | - } |
56 | | - } |
57 | | - |
58 | | - } |
59 | | - |
60 | | -} |
Index: trunk/extensions/UploadWizard/UploadWizard.php |
— | — | @@ -35,7 +35,6 @@ |
36 | 36 | |
37 | 37 | # Require modules, including the special page |
38 | 38 | foreach ( array( |
39 | | - 'UploadWizardMessages' => $wgUpwizDir, |
40 | 39 | 'UploadWizardHooks' => $wgUpwizDir, |
41 | 40 | 'ApiDeleteUploadCampaign' => $wgUpwizDir . '/api', |
42 | 41 | 'UploadWizardConfig' => $wgUpwizDir . '/includes', |