Index: trunk/extensions/MobileFrontend/MobileFrontend.php |
— | — | @@ -103,6 +103,35 @@ |
104 | 104 | public static $disableMobileSiteURL; |
105 | 105 | public static $viewNormalSiteURL; |
106 | 106 | public static $currentURL; |
| 107 | + |
| 108 | + public static $messageKeys = array( 'mobile-frontend-show-button', |
| 109 | + 'mobile-frontend-hide-button', |
| 110 | + 'mobile-frontend-back-to-top-of-section', |
| 111 | + 'mobile-frontend-regular-site', |
| 112 | + 'mobile-frontend-perm-stop-redirect', |
| 113 | + 'mobile-frontend-home-button', |
| 114 | + 'mobile-frontend-random-button', |
| 115 | + 'mobile-frontend-are-you-sure', |
| 116 | + 'mobile-frontend-explain-disable', |
| 117 | + 'mobile-frontend-disable-button', |
| 118 | + 'mobile-frontend-back-button', |
| 119 | + 'mobile-frontend-opt-in-message', |
| 120 | + 'mobile-frontend-opt-in-yes-button', |
| 121 | + 'mobile-frontend-opt-in-no-button', |
| 122 | + 'mobile-frontend-opt-in-title', |
| 123 | + 'mobile-frontend-opt-out-message', |
| 124 | + 'mobile-frontend-opt-out-yes-button', |
| 125 | + 'mobile-frontend-opt-out-no-button', |
| 126 | + 'mobile-frontend-opt-out-title', |
| 127 | + 'mobile-frontend-opt-in-explain', |
| 128 | + 'mobile-frontend-opt-out-explain', |
| 129 | + 'mobile-frontend-disable-images', |
| 130 | + 'mobile-frontend-wml-continue', |
| 131 | + 'mobile-frontend-wml-back', |
| 132 | + 'mobile-frontend-enable-images', |
| 133 | + 'mobile-frontend-featured-article', |
| 134 | + 'mobile-frontend-news-items', |
| 135 | + ); |
107 | 136 | |
108 | 137 | public $itemsToRemove = array( |
109 | 138 | '#contentSub', # redirection notice |
— | — | @@ -164,34 +193,12 @@ |
165 | 194 | $copyright = $skin->getCopyright(); |
166 | 195 | // Need to stash the results of the "wfMsg" call before the Output Buffering handler |
167 | 196 | // because at this point the database connection is shut down, etc. |
168 | | - self::$messages['mobile-frontend-show'] = wfMsg( 'mobile-frontend-show-button' ); |
169 | | - self::$messages['mobile-frontend-hide'] = wfMsg( 'mobile-frontend-hide-button' ); |
170 | | - self::$messages['mobile-frontend-back-to-top'] = wfMsg( 'mobile-frontend-back-to-top-of-section' ); |
171 | | - self::$messages['mobile-frontend-regular-site'] = wfMsg( 'mobile-frontend-regular-site' ); |
172 | | - self::$messages['mobile-frontend-perm-stop-redirect'] = wfMsg( 'mobile-frontend-perm-stop-redirect' ); |
| 197 | + |
173 | 198 | self::$messages['mobile-frontend-copyright'] = $copyright; |
174 | | - self::$messages['mobile-frontend-home-button'] = wfMsg( 'mobile-frontend-home-button' ); |
175 | | - self::$messages['mobile-frontend-random-button'] = wfMsg( 'mobile-frontend-random-button' ); |
176 | | - self::$messages['mobile-frontend-are-you-sure'] = wfMsg( 'mobile-frontend-are-you-sure' ); |
177 | | - self::$messages['mobile-frontend-explain-disable'] = wfMsg( 'mobile-frontend-explain-disable' ); |
178 | | - self::$messages['mobile-frontend-disable-button'] = wfMsg( 'mobile-frontend-disable-button' ); |
179 | | - self::$messages['mobile-frontend-back-button'] = wfMsg( 'mobile-frontend-back-button' ); |
180 | | - self::$messages['mobile-frontend-opt-in-message'] = wfMsg( 'mobile-frontend-opt-in-message' ); |
181 | | - self::$messages['mobile-frontend-opt-in-yes-button'] = wfMsg( 'mobile-frontend-opt-in-yes-button' ); |
182 | | - self::$messages['mobile-frontend-opt-in-no-button'] = wfMsg( 'mobile-frontend-opt-in-no-button' ); |
183 | | - self::$messages['mobile-frontend-opt-in-title'] = wfMsg( 'mobile-frontend-opt-in-title' ); |
184 | | - self::$messages['mobile-frontend-opt-out-message'] = wfMsg( 'mobile-frontend-opt-out-message' ); |
185 | | - self::$messages['mobile-frontend-opt-out-yes-button'] = wfMsg( 'mobile-frontend-opt-out-yes-button' ); |
186 | | - self::$messages['mobile-frontend-opt-out-no-button'] = wfMsg( 'mobile-frontend-opt-out-no-button' ); |
187 | | - self::$messages['mobile-frontend-opt-out-title'] = wfMsg( 'mobile-frontend-opt-out-title' ); |
188 | | - self::$messages['mobile-frontend-opt-in-explain'] = wfMsg( 'mobile-frontend-opt-in-explain' ); |
189 | | - self::$messages['mobile-frontend-opt-out-explain'] = wfMsg( 'mobile-frontend-opt-out-explain' ); |
190 | | - self::$messages['mobile-frontend-disable-images'] = wfMsg( 'mobile-frontend-disable-images' ); |
191 | | - self::$messages['mobile-frontend-wml-continue'] = wfMsg( 'mobile-frontend-wml-continue' ); |
192 | | - self::$messages['mobile-frontend-wml-back'] = wfMsg( 'mobile-frontend-wml-back' ); |
193 | | - self::$messages['mobile-frontend-enable-images'] = wfMsg( 'mobile-frontend-enable-images' ); |
194 | | - self::$messages['mobile-frontend-featured-article'] = wfMsg( 'mobile-frontend-featured-article' ); |
195 | | - self::$messages['mobile-frontend-news-items'] = wfMsg( 'mobile-frontend-news-items' ); |
| 199 | + |
| 200 | + foreach ( self::$messageKeys as $messageKey ) { |
| 201 | + self::$messages[$messageKey] = wfMsg( $messageKey ); |
| 202 | + } |
196 | 203 | |
197 | 204 | self::$dir = $wgContLang->getDir(); |
198 | 205 | self::$code = $wgContLang->getCode(); |
— | — | @@ -509,9 +516,9 @@ |
510 | 517 | $headlineId = ( isset( $headlineMatches[1] ) ) ? $headlineMatches[1] : ''; |
511 | 518 | |
512 | 519 | static $headings = 0; |
513 | | - $show = self::$messages['mobile-frontend-show']; |
514 | | - $hide = self::$messages['mobile-frontend-hide']; |
515 | | - $backToTop = self::$messages['mobile-frontend-back-to-top']; |
| 520 | + $show = self::$messages['mobile-frontend-show-button']; |
| 521 | + $hide = self::$messages['mobile-frontend-hide-button']; |
| 522 | + $backToTop = self::$messages['mobile-frontend-back-to-top-of-section']; |
516 | 523 | ++$headings; |
517 | 524 | // Back to top link |
518 | 525 | $base = "<div class='section_anchors' id='anchor_" . intval( $headings - 1 ) . |