Index: trunk/extensions/StockCharts/StockCharts_body.php |
— | — | @@ -102,6 +102,7 @@ |
103 | 103 | |
104 | 104 | // ticker is a required param |
105 | 105 | if( !$ticker ) { |
| 106 | + wfLoadExtensionMessages( 'StockCharts' ); |
106 | 107 | $error = '<span style="color: red; font-weight: bold;">' . wfMsg('stockchart_missingticker') . '</span>'; |
107 | 108 | return false; |
108 | 109 | } |
— | — | @@ -171,6 +172,3 @@ |
172 | 173 | return $embedCode; |
173 | 174 | } |
174 | 175 | } |
175 | | - |
176 | | - |
177 | | -?> |
Index: trunk/extensions/StockCharts/StockCharts.i18n.php |
— | — | @@ -5,10 +5,9 @@ |
6 | 6 | * @addtogroup Extensions |
7 | 7 | */ |
8 | 8 | |
9 | | -$wgStockChartsMessages = array(); |
| 9 | +$messages = array(); |
10 | 10 | |
11 | | -$wgStockChartsMessages['en'] = array( |
| 11 | +$messages['en'] = array( |
12 | 12 | 'stockchart_missingticker' => 'To embed a stock chart, you need to at least specify a ticker, like this: <stockchart ticker="AAPL"/>', |
13 | 13 | ); |
14 | 14 | |
15 | | -?> |
Property changes on: trunk/extensions/StockCharts/README |
___________________________________________________________________ |
Name: svn:eol-style |
16 | 15 | + native |
Index: trunk/extensions/StockCharts/StockCharts.php |
— | — | @@ -22,25 +22,18 @@ |
23 | 23 | |
24 | 24 | $wgExtensionCredits['parserhook'][] = array( |
25 | 25 | 'name' => 'StockCharts', |
| 26 | + 'path' => __FILE__, |
26 | 27 | 'author' => 'Brendan Meutzner, Anton Zolotkov, Roger Fong', |
27 | 28 | 'description' => 'Adds <nowiki><stockchart ticker="AAPL"/></nowiki> tag for an interactive financial stock chart.', |
28 | 29 | 'url' => 'http://www.mediawiki.org/wiki/Extension:StockCharts', |
29 | 30 | ); |
30 | 31 | |
31 | 32 | # Internationalisation file |
32 | | -require_once( 'StockCharts.i18n.php' ); |
| 33 | +$wgExtensionMessagesFiles['StockCharts'] = dirname( __FILE__ ) . '/StockCharts.i18n.php'; |
33 | 34 | |
34 | 35 | $wgAutoloadClasses['StockCharts'] = dirname( __FILE__ ) . '/StockCharts_body.php'; |
35 | 36 | |
36 | | - |
37 | | - |
38 | 37 | function efStockCharts() { |
39 | | - # Add messages |
40 | | - global $wgMessageCache, $wgStockChartsMessages; |
41 | | - foreach( $wgStockChartsMessages as $language => $messages ) { |
42 | | - $wgMessageCache->addMessages( $messages, $language ); |
43 | | - } |
44 | | - |
45 | 38 | global $wgParser; |
46 | 39 | $wgParser->setHook('stockchart', array('StockCharts', 'renderTagExtension')); // hook for <stockchart ../> |
47 | 40 | $wgParser->setFunctionHook('stockchart', array('StockCharts', 'renderParserFunction')); // hook for {{#stockchart ..}} |
— | — | @@ -50,6 +43,3 @@ |
51 | 44 | $magicWords['stockchart'] = array( 0, 'stockchart' ); |
52 | 45 | return true; |
53 | 46 | } |
54 | | - |
55 | | - |
56 | | -?> |