Index: trunk/extensions/Translate/MessageGroups.php |
— | — | @@ -64,6 +64,11 @@ |
65 | 65 | public function getMangler() { return $this->mangler; } |
66 | 66 | public function setMangler( $value ) { $this->mangler = $value; } |
67 | 67 | |
| 68 | + /** |
| 69 | + * All the messages for this group, by language code. |
| 70 | + */ |
| 71 | + private $messages = array(); |
| 72 | + |
68 | 73 | public static function factory( $label, $id ) { |
69 | 74 | return null; |
70 | 75 | } |
— | — | @@ -106,8 +111,10 @@ |
107 | 112 | * @return Stored translation or null. |
108 | 113 | */ |
109 | 114 | public function getMessage( $key, $code ) { |
110 | | - $cache = $this->load( $code ); |
111 | | - return isset( $cache[$key] ) ? $cache[$key] : null; |
| 115 | + if( !isset( $this->messages[$code] ) ) { |
| 116 | + $this->messages[$code] = $this->load( $code ); |
| 117 | + } |
| 118 | + return isset( $this->messages[$code][$key] ) ? $this->messages[$code][$key] : null; |
112 | 119 | } |
113 | 120 | |
114 | 121 | /** |