Index: trunk/extensions/Translate/utils/MessageIndex.php |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | |
37 | 37 | |
38 | 38 | /** |
39 | | - * @since 2012-01-14 |
| 39 | + * @since 2012-01-04 |
40 | 40 | * @return array |
41 | 41 | */ |
42 | 42 | public static function getGroupIds( MessageHandle $handle ) { |
— | — | @@ -52,7 +52,7 @@ |
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
56 | | - * @since 2012-01-14 |
| 56 | + * @since 2012-01-04 |
57 | 57 | * @return MessageGroup|null |
58 | 58 | */ |
59 | 59 | public static function getPrimaryGroupId( MessageHandle $handle ) { |
Index: trunk/extensions/Translate/utils/TranslationHelpers.php |
— | — | @@ -193,11 +193,11 @@ |
194 | 194 | if ( $suggestions === 'async' ) { |
195 | 195 | $all['translation-memory'] = array( $this, 'getLazySuggestionBox' ); |
196 | 196 | } elseif ( $suggestions === 'only' ) { |
197 | | - return (string) call_user_func( $all['translation-memory'], 'lazy' ); |
| 197 | + return (string) $this->callBox( 'translation-memory', $all['translation-memory'], array( 'lazy' ) ); |
198 | 198 | } elseif ( $suggestions === 'checks' ) { |
199 | 199 | global $wgRequest; |
200 | 200 | $this->translation = $wgRequest->getText( 'translation' ); |
201 | | - return (string) call_user_func( $all['check'] ); |
| 201 | + return (string) $this->callBox( $all['check'], 'check' ); |
202 | 202 | } |
203 | 203 | |
204 | 204 | if ( $this->group instanceof RecentMessageGroup ) { |
— | — | @@ -206,12 +206,7 @@ |
207 | 207 | |
208 | 208 | $boxes = array(); |
209 | 209 | foreach ( $all as $type => $cb ) { |
210 | | - try { |
211 | | - $box = call_user_func( $cb ); |
212 | | - } catch ( TranslationHelperExpection $e ) { |
213 | | - $box = "<!-- Box $type not available: {$e->getMessage()} -->"; |
214 | | - } |
215 | | - |
| 210 | + $box = $this->callBox( $type, $cb ); |
216 | 211 | if ( $box ) { |
217 | 212 | $boxes[$type] = $box; |
218 | 213 | } |
— | — | @@ -224,6 +219,15 @@ |
225 | 220 | } |
226 | 221 | } |
227 | 222 | |
| 223 | + /// @since 2012-01-04 |
| 224 | + protected function callBox( $type, $cb, $params = array() ) { |
| 225 | + try { |
| 226 | + return call_user_func_array( $cb, $params ); |
| 227 | + } catch ( TranslationHelperExpection $e ) { |
| 228 | + return"<!-- Box $type not available: {$e->getMessage()} -->"; |
| 229 | + } |
| 230 | + } |
| 231 | + |
228 | 232 | /** |
229 | 233 | * @return array |
230 | 234 | */ |