Index: trunk/extensions/Translate/Exporters.php |
— | — | @@ -1,155 +0,0 @@ |
2 | | -<?php |
3 | | -if (!defined('MEDIAWIKI')) die(); |
4 | | - |
5 | | -/** |
6 | | - * Classes which faciliate command line exporting of messages to source files. |
7 | | - * |
8 | | - * @author Niklas Laxström |
9 | | - * @copyright Copyright © 2008 Niklas Laxström |
10 | | - * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
11 | | - */ |
12 | | - |
13 | | -interface MessageExporter { |
14 | | - public function __construct( MessageGroup $group ); |
15 | | - public function export( Array $languages, $target ); |
16 | | -} |
17 | | - |
18 | | -class CoreExporter implements MessageExporter { |
19 | | - protected $group = null; |
20 | | - public function __construct( MessageGroup $group ) { |
21 | | - $this->group = $group; |
22 | | - } |
23 | | - |
24 | | - public function export( Array $languages, $target ) { |
25 | | - foreach ( $languages as $code ) { |
26 | | - $taskOptions = new TaskOptions( $code, 0, 0, 0, null ); |
27 | | - $task = TranslateTasks::getTask( 'export-to-file' ); |
28 | | - $task->init( $this->group, $taskOptions ); |
29 | | - file_put_contents( |
30 | | - $target . '/'. $this->group->getMessageFile( $code ), |
31 | | - $task->execute() |
32 | | - ); |
33 | | - } |
34 | | - } |
35 | | - |
36 | | -} |
37 | | - |
38 | | -class StandardExtensionExporter implements MessageExporter { |
39 | | - protected $group = null; |
40 | | - public function __construct( MessageGroup $group ) { |
41 | | - $this->group = $group; |
42 | | - } |
43 | | - |
44 | | - public function export( Array $languages, $target ) { |
45 | | - global $wgTranslateExtensionDirectory; |
46 | | - $filename = $this->group->getMessageFile( '' /* Ignored */ ); |
47 | | - list( $header, $sections ) = $this->parse( $wgTranslateExtensionDirectory . '/' . $filename ); |
48 | | - $output = $header; |
49 | | - $output .= $this->exportLanguage( 'en', $languages, $sections ); |
50 | | - $output .= $this->exportLanguage( 'qqq', $languages, $sections ); |
51 | | - |
52 | | - $__languages = Language::getLanguageNames( false ); |
53 | | - foreach ( array_keys( $__languages ) as $code ) { |
54 | | - if ( $code === 'en' || $code === 'qqq' ) continue; |
55 | | - $output .= $this->exportLanguage( $code, $languages, $sections ); |
56 | | - } |
57 | | - |
58 | | - // The hacks, aka copies of another languages |
59 | | - $output .= implode( '', $sections ); |
60 | | - |
61 | | - $targetFile = $target . '/' . $filename; |
62 | | - wfMkdirParents( dirname( $targetFile ) ); |
63 | | - file_put_contents( $targetFile, $output ); |
64 | | - } |
65 | | - |
66 | | - private function exportLanguage( $code, Array $languages, &$sections ) { |
67 | | - $output = ''; |
68 | | - if ( in_array( $code, $languages ) ) { |
69 | | - $taskOptions = new TaskOptions( $code, 0, 0, 0, null ); |
70 | | - $task = TranslateTasks::getTask( 'export-to-file' ); |
71 | | - $task->init( $this->group, $taskOptions ); |
72 | | - $output = $task->execute() . "\n"; |
73 | | - unset( $sections[$code] ); |
74 | | - } elseif ( isset( $sections[$code] ) ) { |
75 | | - $output = $sections[$code]; |
76 | | - unset( $sections[$code] ); |
77 | | - } |
78 | | - return $output; |
79 | | - } |
80 | | - |
81 | | - protected function parse( $filename ) { |
82 | | - $var = $this->group->getVariableName(); |
83 | | - |
84 | | - $data = file_get_contents( $filename ) . "\n"; |
85 | | - |
86 | | - $headerP = " |
87 | | - .*? # Ungreedily eat header |
88 | | - \\$$var \s* = \s* array\(\);"; |
89 | | - /* |
90 | | - * x to have nice syntax |
91 | | - * u for utf-8 |
92 | | - * s for dot matches newline |
93 | | - */ |
94 | | - $fileStructure = "~^($headerP)(.*)~xsu"; |
95 | | - |
96 | | - $matches = array(); |
97 | | - if ( !preg_match( $fileStructure, $data, $matches ) ) { |
98 | | - throw new MWException( "Unable to parse file structure" ); |
99 | | - } |
100 | | - |
101 | | - list( , $header, $data) = $matches; |
102 | | - |
103 | | - $sectionP = '(?: /\*\* .*? \*/ )? (?: .*? \n\);\n\n )'; |
104 | | - $codeP = "\\$$var\[' (.*?) '\]"; |
105 | | - |
106 | | - $sectionMatches = array(); |
107 | | - if ( !preg_match_all( "~$sectionP~xsu", $data, $sectionMatches, PREG_SET_ORDER ) ) { |
108 | | - throw new MWException( "Unable to parse sections" ); |
109 | | - } |
110 | | - |
111 | | - $sections = array(); |
112 | | - $unknown = array(); |
113 | | - foreach ( $sectionMatches as $index => $data ) { |
114 | | - $code = array(); |
115 | | - if ( !preg_match( "~$codeP~xsu", $data[0], $code ) ) { |
116 | | - echo "Malformed section:\n$data[0]"; |
117 | | - $unknown[] = $data[0]; |
118 | | - } else { |
119 | | - $sections[$code[1]] = $data[0]; |
120 | | - } |
121 | | - } |
122 | | - |
123 | | - #ksort( $sections ); |
124 | | - if ( $unknown ) |
125 | | - $sections[] = implode( "\n", $unknown ); |
126 | | - |
127 | | - return array( $header, $sections ); |
128 | | - } |
129 | | -} |
130 | | - |
131 | | -class MultipleFileExtensionExporter extends StandardExtensionExporter { |
132 | | - protected $header = ''; |
133 | | - |
134 | | - public function export( Array $languages, $target ) { |
135 | | - foreach ( $languages as $code ) { |
136 | | - $output = "<?php\n"; |
137 | | - $output .= $this->header; |
138 | | - $output .= $this->exportLang( $code ); |
139 | | - |
140 | | - $filename = $this->group->getMessageFile( $code ); |
141 | | - $targetFile = $target . '/' . $filename; |
142 | | - wfMkdirParents( dirname( $targetFile ) ); |
143 | | - file_put_contents( $targetFile, $output ); |
144 | | - } |
145 | | - } |
146 | | - |
147 | | - private function exportLang( $code ) { |
148 | | - $output = ''; |
149 | | - $taskOptions = new TaskOptions( $code, 0, 0, 0, null ); |
150 | | - $task = TranslateTasks::getTask( 'export-to-file' ); |
151 | | - $task->init( $this->group, $taskOptions ); |
152 | | - $output = $task->execute() . "\n"; |
153 | | - return $output; |
154 | | - } |
155 | | - |
156 | | -} |
Index: trunk/extensions/Translate/TranslateEditAddons.php |
— | — | @@ -185,7 +185,6 @@ |
186 | 186 | } |
187 | 187 | } |
188 | 188 | |
189 | | - $group->reset(); |
190 | 189 | TranslateUtils::injectCSS(); |
191 | 190 | return Xml::tags( 'div', array( 'class' => 'mw-sp-translate-edit-fields' ), implode("\n\n", $boxes) ); |
192 | 191 | } |
Index: trunk/extensions/Translate/Translate.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
13 | 13 | */ |
14 | 14 | |
15 | | -define( 'TRANSLATE_VERSION', '8.42' ); |
| 15 | +define( 'TRANSLATE_VERSION', '8.43' ); |
16 | 16 | |
17 | 17 | $wgExtensionCredits['specialpage'][] = array( |
18 | 18 | 'name' => 'Translate', |
— | — | @@ -22,33 +22,10 @@ |
23 | 23 | 'url' => 'http://www.mediawiki.org/wiki/Extension:Translate', |
24 | 24 | ); |
25 | 25 | |
| 26 | +// Setup class autoloads |
26 | 27 | $dir = dirname(__FILE__) . '/'; |
27 | | -$wgAutoloadClasses['TranslateTasks'] = $dir . 'TranslateTasks.php'; |
28 | | -$wgAutoloadClasses['TaskOptions'] = $dir . 'TranslateTasks.php'; |
| 28 | +require_once( $dir . '_autoload.php' ); |
29 | 29 | |
30 | | -$wgAutoloadClasses['TranslateUtils'] = $dir . 'TranslateUtils.php'; |
31 | | -$wgAutoloadClasses['HTMLSelector'] = $dir . 'TranslateUtils.php'; |
32 | | -$wgAutoloadClasses['ResourceLoader'] = $dir . 'utils/ResourceLoader.php'; |
33 | | -$wgAutoloadClasses['StringMatcher'] = $dir . 'utils/StringMatcher.php'; |
34 | | - |
35 | | -$wgAutoloadClasses['MessageChecks'] = $dir . 'MessageChecks.php'; |
36 | | -$wgAutoloadClasses['MessageGroups'] = $dir . 'MessageGroups.php'; |
37 | | - |
38 | | -$wgAutoloadClasses['MessageCollection'] = $dir . 'Message.php'; |
39 | | -$wgAutoloadClasses['TMessage'] = $dir . 'Message.php'; |
40 | | - |
41 | | -$wgAutoloadClasses['CoreExporter'] = $dir . 'Exporters.php'; |
42 | | -$wgAutoloadClasses['StandardExtensionExporter'] = $dir . 'Exporters.php'; |
43 | | -$wgAutoloadClasses['MultipleFileExtensionExporter'] = $dir . 'Exporters.php'; |
44 | | - |
45 | | -$wgAutoloadClasses['TranslateEditAddons'] = $dir . 'TranslateEditAddons.php'; |
46 | | -$wgAutoloadClasses['languages'] = $IP . '/maintenance/language/languages.inc'; |
47 | | -$wgAutoloadClasses['MessageWriter'] = $IP . '/maintenance/language/writeMessagesArray.inc'; |
48 | | - |
49 | | -$wgAutoloadClasses['SpecialTranslate'] = $dir . 'TranslatePage.php'; |
50 | | -$wgAutoloadClasses['SpecialMagic'] = $dir . 'SpecialMagic.php'; |
51 | | -$wgAutoloadClasses['SpecialTranslationChanges'] = $dir . 'SpecialTranslationChanges.php'; |
52 | | - |
53 | 30 | $wgExtensionMessagesFiles['Translate'] = $dir . 'Translate.i18n.php'; |
54 | 31 | |
55 | 32 | $wgSpecialPages['Translate'] = 'SpecialTranslate'; |
— | — | @@ -56,8 +33,6 @@ |
57 | 34 | $wgSpecialPages['TranslationChanges'] = 'SpecialTranslationChanges'; |
58 | 35 | |
59 | 36 | $wgHooks['EditPage::showEditForm:initial'][] = 'TranslateEditAddons::addTools'; |
60 | | - |
61 | | -$wgAutoloadClasses['TranslatePreferences'] = $dir . 'TranslateUtils.php'; |
62 | 37 | $wgHooks['UserToggles'][] = 'TranslatePreferences::TranslateUserToggles'; |
63 | 38 | |
64 | 39 | $wgAvailableRights[] = 'translate'; |
— | — | @@ -109,229 +84,16 @@ |
110 | 85 | |
111 | 86 | /** AC = Available classes */ |
112 | 87 | $wgTranslateAC = array( |
113 | | -'core-mostused' => 'CoreMostUsedMessageGroup', |
114 | | -'ext-0-wikimedia' => 'AllWikimediaExtensionsGroup', |
115 | | -'core' => 'CoreMessageGroup', |
116 | | -'ext-0-all' => 'AllMediawikiExtensionsGroup', |
117 | | -'out-word2mediawikiplus' => 'Word2MediaWikiPlusMessageGroup', |
118 | | -'out-freecol' => 'FreeColMessageGroup', |
119 | | -'ext-absenteelandlord' => 'AbsenteeLandlordMessageGroup', |
120 | | -'ext-advancedrandom' => 'AdvancedRandomMessageGroup', |
121 | | -'ext-ajaxquerypages' => 'AjaxQueryPagesMessageGroup', |
122 | | -'ext-ajaxshoweditors' => 'AjaxShowEditorsMessageGroup', |
123 | | -'ext-antibot' => 'AntiBotMessageGroup', |
124 | | -'ext-antispoof' => 'AntiSpoofMessageGroup', |
125 | | -'ext-apc' => 'ApcMessageGroup', |
126 | | -'ext-asksql' => 'AsksqlMessageGroup', |
127 | | -'ext-assertedit' => 'AssertEditMessageGroup', |
128 | | -'ext-authorprotect' => 'AuthorProtectMessageGroup', |
129 | | -'ext-babel' => 'BabelMessageGroup', |
130 | | -'ext-backandforth' => 'BackAndForthMessageGroup', |
131 | | -'ext-badimage' => 'BadImageMessageGroup', |
132 | | -'ext-blahtex' => 'BlahtexMessageGroup', |
133 | | -'ext-blocktitles' => 'BlockTitlesMessageGroup', |
134 | | -'ext-boardvote' => 'BoardVoteMessageGroup', |
135 | | -'ext-bookinformation' => 'BookInformationMessageGroup', |
136 | | -'ext-breadcrumbs' => 'BreadCrumbsMessageGroup', |
137 | | -'ext-call' => 'CallMessageGroup', |
138 | | -'ext-categoryintersection' => 'CategoryIntersectionMessageGroup', |
139 | | -'ext-categorystepper' => 'CategoryStepperMessageGroup', |
140 | | -'ext-categorytree' => 'CategoryTreeMessageGroup', |
141 | | -'ext-catfeed' => 'CatFeedMessageGroup', |
142 | | -'ext-centralauth' => 'CentralAuthMessageGroup', |
143 | | -'ext-centralnotice' => 'CentralNoticeMessageGroup', |
144 | | -'ext-changeauthor' => 'ChangeAuthorMessageGroup', |
145 | | -'ext-charinsert' => 'CharInsertMessageGroup', |
146 | | -'ext-checkuser' => 'CheckUserMessageGroup', |
147 | | -'ext-chemistry' => 'ChemFunctionsMessageGroup', |
148 | | -'ext-cite' => 'CiteMessageGroup', |
149 | | -'ext-citespecial' => 'CiteSpecialMessageGroup', |
150 | | -'ext-cldr' => 'LanguageNamesMessageGroup', |
151 | | -'ext-cleanchanges' => 'CleanChangesMessageGroup', |
152 | | -'ext-collection' => 'CollectionMessageGroup', |
153 | | -'ext-commentpages' => 'CommentPagesMessageGroup', |
154 | | -'ext-commentspammer' => 'CommentSpammerMessageGroup', |
155 | | -'ext-configure' => 'ConfigureMessageGroup', |
156 | | -'ext-confirmaccount' => 'ConfirmAccountMessageGroup', |
157 | | -'ext-confirmedit' => 'ConfirmEditMessageGroup', |
158 | | -'ext-confirmeditfancycaptcha' => 'ConfirmEditFancyCaptchaMessageGroup', |
159 | | -'ext-contactpage' => 'ContactPageMessageGroup', |
160 | | -'ext-contributionscores' => 'ContributionScoresMessageGroup', |
161 | | -'ext-contributionseditcount' => 'ContributionseditcountMessageGroup', |
162 | | -'ext-contributors' => 'ContributorsMessageGroup', |
163 | | -'ext-contributorsaddon' => 'ContributorsAddonMessageGroup', |
164 | | -'ext-countedits' => 'CountEditsMessageGroup', |
165 | | -'ext-crossnamespacelinks' => 'CrossNamespaceLinksMessageGroup', |
166 | | -'ext-crosswikiblock' => 'CrosswikiBlockMessageGroup', |
167 | | -'ext-crowdauthentication' => 'CrowdAuthenticationMessageGroup', |
168 | | -'ext-datatransfer' => 'DataTransferMessageGroup', |
169 | | -'ext-deletedcontribs' => 'DeletedContribsMessageGroup', |
170 | | -'ext-didyoumean' => 'DidYouMeanMessageGroup', |
171 | | -'ext-dismissablesitenotice' => 'DismissableSiteNoticeMessageGroup', |
172 | | -'ext-doublewiki' => 'DoubleWikiMessageGroup', |
173 | | -'ext-dplforum' => 'DPLForumMessageGroup', |
174 | | -'ext-duplicator' => 'DuplicatorMessageGroup', |
175 | | -'ext-editcount' => 'EditcountMessageGroup', |
176 | | -'ext-editmessages' => 'EditMessagesMessageGroup', |
177 | | -'ext-editown' => 'EditOwnMessageGroup', |
178 | | -'ext-editsimilar' => 'EditSimilarMessageGroup', |
179 | | -'ext-editsubpages' => 'EditSubpagesMessageGroup', |
180 | | -'ext-edituser' => 'EditUserMessageGroup', |
181 | | -'ext-emailaddressimage' => 'EmailAddressImageMessageGroup', |
182 | | -'ext-emailarticle' => 'EmailArticleMessageGroup', |
183 | | -'ext-eval' => 'EvalMessageGroup', |
184 | | -'ext-expandtemplates' => 'ExpandTemplatesMessageGroup', |
185 | | -'ext-farmer' => 'FarmerMessageGroup', |
186 | | -'ext-findspam' => 'FindSpamMessageGroup', |
187 | | -'ext-fixedimage' => 'FixedImageMessageGroup', |
188 | | -'ext-fr-depreciationoversight' => 'FRDepreciationOversightMessageGroup', |
189 | | -'ext-fr-flaggedrevs' => 'FRFlaggedRevsMessageGroup', |
190 | | -'ext-fr-flaggedrevsaliases' => 'FRFlaggedRevsAliasesMessageGroup', |
191 | | -'ext-fr-oldreviewedpages' => 'FROldReviewedPagesMessageGroup', |
192 | | -'ext-fr-qualityoversight' => 'FRQualityOversightMessageGroup', |
193 | | -'ext-fr-reviewedpages' => 'FRReviewedPagesMessageGroup', |
194 | | -'ext-fr-stabilization' => 'FRStabilizationMessageGroup', |
195 | | -'ext-fr-stablepages' => 'FRStablePagesMessageGroup', |
196 | | -'ext-fr-stableversions' => 'FRStableVersionsMessageGroup', |
197 | | -'ext-fr-unreviewedpages' => 'FRUnreviewedPagesMessageGroup', |
198 | | -'ext-forcepreview' => 'ForcePreviewMessageGroup', |
199 | | -'ext-formatemail' => 'FormatEmailMessageGroup', |
200 | | -'ext-gadgets' => 'GadgetsMessageGroup', |
201 | | -'ext-globalblocking' => 'GlobalBlockingMessageGroup', |
202 | | -'ext-globalusage' => 'GlobalUsageMessageGroup', |
203 | | -'ext-gnuplot' => 'GnuplotMessageGroup', |
204 | | -'ext-googleanalytics' => 'GoogleAnalyticsMessageGroup', |
205 | | -'ext-googlemaps' => 'GoogleMapsMessageGroup', |
206 | | -'ext-gotocategory' => 'GoToCategoryMessageGroup', |
207 | | -'ext-htmlets' => 'HTMLetsMessageGroup', |
208 | | -'ext-i18ntags' => 'I18nTagsMessageGroup', |
209 | | -'ext-icon' => 'IconMessageGroup', |
210 | | -'ext-imagemap' => 'ImageMapMessageGroup', |
211 | | -'ext-imagetagging' => 'ImageTaggingMessageGroup', |
212 | | -'ext-importfreeimages' => 'ImportFreeImagesMessageGroup', |
213 | | -'ext-importusers' => 'ImportUsersMessageGroup', |
214 | | -'ext-inputbox' => 'InputBoxMessageGroup', |
215 | | -'ext-inspectcache' => 'InspectCacheMessageGroup', |
216 | | -'ext-intersection' => 'IntersectionMessageGroup', |
217 | | -'ext-interwiki' => 'InterwikiMessageGroup', |
218 | | -'ext-invitations' => 'InvitationsMessageGroup', |
219 | | -'ext-labeledsectiontransclusion' => 'LabeledSectionTransclusionMessageGroup', |
220 | | -'ext-languageselector' => 'LanguageSelectorMessageGroup', |
221 | | -'ext-latexdoc' => 'LatexDocMessageGroup', |
222 | | -'ext-linksearch' => 'LinkSearchMessageGroup', |
223 | | -'ext-liquidthreads' => 'LiquidThreadsMessageGroup', |
224 | | -'ext-lookupuser' => 'LookupUserMessageGroup', |
225 | | -'ext-maintenance' => 'MaintenanceMessageGroup', |
226 | | -'ext-mathstat' => 'MathStatMessageGroup', |
227 | | -'ext-mediafunctions' => 'MediaFunctionsMessageGroup', |
228 | | -'ext-metavidwiki' => 'MetavidWikiMessageGroup', |
229 | | -'ext-mibbit' => 'MibbitMessageGroup', |
230 | | -'ext-microid' => 'MicroIDMessageGroup', |
231 | | -'ext-minidonation' => 'MiniDonationMessageGroup', |
232 | | -'ext-minimumnamelength' => 'MinimumNameLengthMessageGroup', |
233 | | -'ext-minipreview' => 'MiniPreviewMessageGroup', |
234 | | -'ext-multiboilerplate' => 'MultiBoilerplateMessageGroup', |
235 | | -'ext-multiupload' => 'MultiUploadMessageGroup', |
236 | | -'ext-mwsearch' => 'MWSearchMessageGroup', |
237 | | -'ext-navigationpopups' => 'NavigationPopupsMessageGroup', |
238 | | -'ext-networkauth' => 'NetworkAuthMessageGroup', |
239 | | -'ext-newestpages' => 'NewestPagesMessageGroup', |
240 | | -'ext-news' => 'NewsMessageGroup', |
241 | | -'ext-newuserlog' => 'NewuserLogMessageGroup', |
242 | | -'ext-newusermessage' => 'NewUserMessageMessageGroup', |
243 | | -'ext-newusernotif' => 'NewUserNotifMessageGroup', |
244 | | -'ext-nuke' => 'NukeMessageGroup', |
245 | | -'ext-oai' => 'OaiMessageGroup', |
246 | | -'ext-ogghandler' => 'OggHandlerMessageGroup', |
247 | | -'ext-onlinestatus' => 'OnlineStatusMessageGroup', |
248 | | -'ext-openid' => 'OpenIDMessageGroup', |
249 | | -'ext-oversight' => 'OversightMessageGroup', |
250 | | -'ext-pageby' => 'PageByMessageGroup', |
251 | | -'ext-parserdifftest' => 'ParserDiffTestMessageGroup', |
252 | | -'ext-parserfunctions' => 'ParserfunctionsMessageGroup', |
253 | | -'ext-passwordreset' => 'PasswordResetMessageGroup', |
254 | | -'ext-patroller' => 'PatrollerMessageGroup', |
255 | | -'ext-pdfhandler' => 'PdfHandlerMessageGroup', |
256 | | -'ext-piwik' => 'PiwikMessageGroup', |
257 | | -'ext-player' => 'PlayerMessageGroup', |
258 | | -'ext-pnghandler' => 'PNGHandlerMessageGroup', |
259 | | -'ext-poem' => 'PoemMessageGroup', |
260 | | -'ext-postcomment' => 'PostCommentMessageGroup', |
261 | | -'ext-povwatch' => 'PovWatchMessageGroup', |
262 | | -'ext-preloader' => 'PreloaderMessageGroup', |
263 | | -'ext-profilemonitor' => 'ProfileMonitorMessageGroup', |
264 | | -'ext-proofreadpage' => 'ProofreadPageMessageGroup', |
265 | | -'ext-protectsection' => 'ProtectSectionMessageGroup', |
266 | | -'ext-psinotocnum' => 'PSINoTocNumMessageGroup', |
267 | | -'ext-purge' => 'PurgeMessageGroup', |
268 | | -'ext-purgecache' => 'PurgeCacheMessageGroup', |
269 | | -'ext-quiz' => 'QuizMessageGroup', |
270 | | -'ext-randomimage' => 'RandomImageMessageGroup', |
271 | | -'ext-randomincategory' => 'RandomInCategoryMessageGroup', |
272 | | -'ext-randomrootpage' => 'RandomRootpageMessageGroup', |
273 | | -'ext-regexblock' => 'RegexBlockMessageGroup', |
274 | | -'ext-renameuser' => 'RenameUserMessageGroup', |
275 | | -'ext-replacetext' => 'ReplaceTextMessageGroup', |
276 | | -'ext-review' => 'ReviewMessageGroup', |
277 | | -'ext-rightfunctions' => 'RightFunctionsMessageGroup', |
278 | | -'ext-scanset' => 'ScanSetMessageGroup', |
279 | | -'ext-seealso' => 'SeealsoMessageGroup', |
280 | | -'ext-selectcategory' => 'SelectCategoryMessageGroup', |
281 | | -'ext-semanticcalendar' => 'SemanticCalendarMessageGroup', |
282 | | -'ext-semanticdrilldown' => 'SemanticDrilldownMessageGroup', |
283 | | -'ext-semanticforms' => 'SemanticFormsMessageGroup', |
284 | | -'ext-semanticmediawiki' => 'SemanticMediaWikiMessageGroup', |
285 | | -'ext-showprocesslist' => 'ShowProcesslistMessageGroup', |
286 | | -'ext-signdocument' => 'SignDocumentMessageGroup', |
287 | | -'ext-signdocumentspecial' => 'SignDocumentSpecialMessageGroup', |
288 | | -'ext-signdocumentspecialcreate' => 'SignDocumentSpecialCreateMessageGroup', |
289 | | -'ext-simpleantispam' => 'SimpleAntiSpamMessageGroup', |
290 | | -'ext-sitematrix' => 'SiteMatrixMessageGroup', |
291 | | -'ext-skinperpage' => 'SkinPerPageMessageGroup', |
292 | | -'ext-smoothgallery' => 'SmoothGalleryMessageGroup', |
293 | | -'ext-socialprofileuserboard' => 'SocialProfileUserBoardMessageGroup', |
294 | | -'ext-socialprofileuserprofile' => 'SocialProfileUserProfileMessageGroup', |
295 | | -'ext-socialprofileuserrelationship' => 'SocialProfileUserRelationshipMessageGroup', |
296 | | -'ext-spamblacklist' => 'SpamBlacklistMessageGroup', |
297 | | -'ext-spamdifftool' => 'SpamDiffToolMessageGroup', |
298 | | -'ext-spamregex' => 'SpamRegexMessageGroup', |
299 | | -'ext-specialfilelist' => 'SpecialFileListMessageGroup', |
300 | | -'ext-specialform' => 'SpecialFormMessageGroup', |
301 | | -'ext-stalepages' => 'StalePagesMessageGroup', |
302 | | -'ext-subpagelist3' => 'SubPageList3MessageGroup', |
303 | | -'ext-syntaxhighlightgeshi' => 'SyntaxHighlight_GeSHiMessageGroup', |
304 | | -'ext-tab0' => 'Tab0MessageGroup', |
305 | | -'ext-talkhere' => 'TalkHereMessageGroup', |
306 | | -'ext-templatelink' => 'TemplateLinkMessageGroup', |
307 | | -'ext-throttle' => 'ThrottleMessageGroup', |
308 | | -'ext-tidytab' => 'TidyTabMessageGroup', |
309 | | -'ext-timeline' => 'TimelineMessageGroup', |
310 | | -'ext-titleblacklist' => 'TitleBlacklistMessageGroup', |
311 | | -'ext-titlekey' => 'TitleKeyMessageGroup', |
312 | | -'ext-todo' => 'TodoMessageGroup', |
313 | | -'ext-todotasks' => 'TodoTasksMessageGroup', |
314 | | -'ext-tooltip' => 'TooltipMessageGroup', |
315 | | -'ext-translate' => 'TranslateMessageGroup', |
316 | | -'ext-torblock' => 'TorBlockMessageGroup', |
317 | | -'ext-usagestatistics' => 'UsageStatisticsMessageGroup', |
318 | | -'ext-usercontactlinks' => 'UserContactLinksMessageGroup', |
319 | | -'ext-userimages' => 'UserImagesMessageGroup', |
320 | | -'ext-usermerge' => 'UserMergeMessageGroup', |
321 | | -'ext-usernameblacklist' => 'UsernameBlacklistMessageGroup', |
322 | | -'ext-userrightsnotif' => 'UserRightsNotifMessageGroup', |
323 | | -'ext-vote' => 'VoteMessageGroup', |
324 | | -'ext-watchers' => 'WatchersMessageGroup', |
325 | | -'ext-watchsubpages' => 'WatchSubpagesMessageGroup', |
326 | | -'ext-webstore' => 'WebStoreMessageGroup', |
327 | | -'ext-whitelist' => 'WhiteListMessageGroup', |
328 | | -'ext-whoiswatching' => 'WhoIsWatchingMessageGroup', |
329 | | -'ext-wikidatalanguagemanager' => 'WikidataLanguageManagerMessageGroup', |
330 | | -'ext-wikihiero' => 'WikihieroMessageGroup', |
331 | | -'ext-woopra' => 'WoopraMessageGroup', |
332 | | -'ext-youtubeauthsub' => 'YouTubeAuthSubMessageGroup', |
333 | | -'ext-yui' => 'YUIMessageGroup', |
| 88 | +'core' => 'CoreMessageGroup', |
| 89 | +'core-mostused' => 'CoreMostUsedMessageGroup', |
| 90 | +'ext-0-all' => 'AllMediawikiExtensionsGroup', |
| 91 | +'ext-0-wikimedia' => 'AllWikimediaExtensionsGroup', |
| 92 | +'out-freecol' => 'FreeColMessageGroup', |
| 93 | +'out-word2mediawikiplus' => 'Word2MediaWikiPlusMessageGroup', |
334 | 94 | ); |
335 | 95 | |
| 96 | +$wgTranslateAddMWExtensionGroups = false; |
| 97 | + |
336 | 98 | /** EC = Enabled classes */ |
337 | 99 | $wgTranslateEC = array(); |
338 | 100 | $wgTranslateEC[] = 'core'; |
Index: trunk/extensions/Translate/TranslateTasks.php |
— | — | @@ -170,7 +170,6 @@ |
171 | 171 | $this->messages->populatePageExistence(); |
172 | 172 | $this->messages->populateTranslationsFromDatabase(); |
173 | 173 | $this->messageGroup->fill( $this->messages ); |
174 | | - $this->messageGroup->reset(); |
175 | 174 | } |
176 | 175 | |
177 | 176 | protected function output() { |
— | — | @@ -310,23 +309,6 @@ |
311 | 310 | ); |
312 | 311 | } |
313 | 312 | |
314 | | - protected function getOutputHeader() { |
315 | | - $name = TranslateUtils::getLanguageName( $this->options->getLanguage() ); |
316 | | - $_authors = $this->getAuthors(); |
317 | | - arsort( $_authors, SORT_NUMERIC ); |
318 | | - $authors = array(); |
319 | | - foreach ( $_authors as $author => $edits ) { |
320 | | - $authors[] = "$author - $edits"; |
321 | | - } |
322 | | - $authors = implode( ', ', $authors ); |
323 | | - $file = $this->messageGroup->getMessageFile( $this->options->getLanguage() ); |
324 | | - |
325 | | - $output = ''; |
326 | | - if ( $file ) { $output .= "# $file\n"; } |
327 | | - $output .= "# $name ($authors)\n"; |
328 | | - return $output; |
329 | | - } |
330 | | - |
331 | 313 | protected function getAuthorsArray() { |
332 | 314 | global $wgTranslateFuzzyBotName; |
333 | 315 | $_authors = $this->getAuthors(); |
— | — | @@ -340,9 +322,12 @@ |
341 | 323 | } |
342 | 324 | |
343 | 325 | public function output() { |
344 | | - return Xml::openElement( 'textarea', array( 'id' => 'wpTextbox1', 'rows' => '50' ) ) . |
345 | | - $this->getOutputHeader() . |
346 | | - $this->messageGroup->export( $this->messages ) . "\n\n\n" . |
| 326 | + $writer = $this->messageGroup->getWriter(); |
| 327 | + $writer->addAuthors( $this->getAuthorsArray() ); |
| 328 | + $data = $writer->webExport( $this->messages ); |
| 329 | + |
| 330 | + return Xml::openElement( 'textarea', array( 'id' => 'wpTextbox1', 'rows' => '50' ) ) . |
| 331 | + $data . |
347 | 332 | "</textarea>"; |
348 | 333 | } |
349 | 334 | } |
— | — | @@ -355,11 +340,9 @@ |
356 | 341 | } |
357 | 342 | |
358 | 343 | public function output() { |
359 | | - return |
360 | | - $this->messageGroup->exportToFile( |
361 | | - $this->messages, |
362 | | - $this->getAuthorsArray() |
363 | | - ); |
| 344 | + $writer = $this->messageGroup->getWriter(); |
| 345 | + $writer->addAuthors( $this->getAuthorsArray() ); |
| 346 | + return $writer->webExport( $this->messages ); |
364 | 347 | } |
365 | 348 | } |
366 | 349 | |
Index: trunk/extensions/Translate/README |
— | — | @@ -43,6 +43,8 @@ |
44 | 44 | * show the group of message when editing |
45 | 45 | * branched core messages should now export properly |
46 | 46 | * $wgTranslateBlacklist added to prevent edits to certain language/group combinations |
| 47 | +* new exporters |
| 48 | +* changed the way of adding MediaWiki extensions |
47 | 49 | |
48 | 50 | == Changes in version 8 == |
49 | 51 | * Released 2008-02-06 |
Index: trunk/extensions/Translate/_autoload.php |
— | — | @@ -0,0 +1,62 @@ |
| 2 | +<?php |
| 3 | +if (!defined('MEDIAWIKI')) die(); |
| 4 | +/** |
| 5 | + * Autoload definitions. |
| 6 | + * |
| 7 | + * @author Niklas Laxström |
| 8 | + * @copyright Copyright © 2008, Niklas Laxström |
| 9 | + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
| 10 | + * @file |
| 11 | + */ |
| 12 | + |
| 13 | +$dir = dirname(__FILE__) . '/'; |
| 14 | + |
| 15 | +$wgAutoloadClasses['TranslateTasks'] = $dir . 'TranslateTasks.php'; |
| 16 | +$wgAutoloadClasses['TaskOptions'] = $dir . 'TranslateTasks.php'; |
| 17 | + |
| 18 | +$wgAutoloadClasses['TranslateUtils'] = $dir . 'TranslateUtils.php'; |
| 19 | +$wgAutoloadClasses['HTMLSelector'] = $dir . 'TranslateUtils.php'; |
| 20 | + |
| 21 | +$wgAutoloadClasses['MessageChecks'] = $dir . 'MessageChecks.php'; |
| 22 | +$wgAutoloadClasses['MessageGroups'] = $dir . 'MessageGroups.php'; |
| 23 | + |
| 24 | +$wgAutoloadClasses['MessageCollection'] = $dir . 'Message.php'; |
| 25 | +$wgAutoloadClasses['TMessage'] = $dir . 'Message.php'; |
| 26 | + |
| 27 | +$wgAutoloadClasses['TranslateEditAddons'] = $dir . 'TranslateEditAddons.php'; |
| 28 | +$wgAutoloadClasses['languages'] = $IP . '/maintenance/language/languages.inc'; |
| 29 | +$wgAutoloadClasses['MessageWriter'] = $IP . '/maintenance/language/writeMessagesArray.inc'; |
| 30 | + |
| 31 | +$wgAutoloadClasses['SpecialTranslate'] = $dir . 'TranslatePage.php'; |
| 32 | +$wgAutoloadClasses['SpecialMagic'] = $dir . 'SpecialMagic.php'; |
| 33 | +$wgAutoloadClasses['SpecialTranslationChanges'] = $dir . 'SpecialTranslationChanges.php'; |
| 34 | + |
| 35 | +$wgAutoloadClasses['TranslatePreferences'] = $dir . 'TranslateUtils.php'; |
| 36 | + |
| 37 | +$wgAutoloadClasses['SimpleFormatReader'] = $dir . 'ffs/Simple.php'; |
| 38 | +$wgAutoloadClasses['SimpleFormatWriter'] = $dir . 'ffs/Simple.php'; |
| 39 | +$wgAutoloadClasses['WikiFormatReader'] = $dir . 'ffs/Wiki.php'; |
| 40 | +$wgAutoloadClasses['WikiFormatWriter'] = $dir . 'ffs/Wiki.php'; |
| 41 | +$wgAutoloadClasses['WikiExtensionFormatReader'] = $dir . 'ffs/WikiExtension.php'; |
| 42 | +$wgAutoloadClasses['WikiExtensionFormatWriter'] = $dir . 'ffs/WikiExtension.php'; |
| 43 | +$wgAutoloadClasses['GettextFormatHandler'] = $dir . 'ffs/Gettext.php'; |
| 44 | +$wgAutoloadClasses['JavaFormatReader'] = $dir . 'ffs/Java.php'; |
| 45 | +$wgAutoloadClasses['JavaFormatWriter'] = $dir . 'ffs/Java.php'; |
| 46 | + |
| 47 | + |
| 48 | +# utils |
| 49 | +$wgAutoloadClasses['ResourceLoader'] = $dir . 'utils/ResourceLoader.php'; |
| 50 | +$wgAutoloadClasses['StringMatcher'] = $dir . 'utils/StringMatcher.php'; |
| 51 | + |
| 52 | + |
| 53 | +$wgAutoloadClasses['StringMangler'] = $dir . 'utils/StringMangler.php'; |
| 54 | +$wgAutoloadClasses['SmItem'] = $dir . 'utils/StringMangler.php'; |
| 55 | +$wgAutoloadClasses['SmRewriter'] = $dir . 'utils/StringMangler.php'; |
| 56 | +$wgAutoloadClasses['SmAffixRewriter'] = $dir . 'utils/StringMangler.php'; |
| 57 | +$wgAutoloadClasses['SmRegexRewriter'] = $dir . 'utils/StringMangler.php'; |
| 58 | + |
| 59 | + |
| 60 | +# predefined group |
| 61 | +$wgAutoloadClasses['PremadeMediawikiExtensionGroups'] = $dir . 'mwextensions/MediaWikiExtensions.php'; |
| 62 | + |
| 63 | + |
Property changes on: trunk/extensions/Translate/_autoload.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 64 | + native |
Index: trunk/extensions/Translate/utils/StringMatcher.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -class StringMatcher { |
| 4 | +class StringMatcher extends StringMangler { |
5 | 5 | protected $sPrefix = ''; |
6 | 6 | protected $aExact = array(); |
7 | 7 | protected $aPrefix = array(); |
— | — | @@ -107,4 +107,4 @@ |
108 | 108 | return $temp; |
109 | 109 | } |
110 | 110 | |
111 | | -} |
| 111 | +} |
\ No newline at end of file |
Index: trunk/extensions/Translate/utils/StringMangler.php |
— | — | @@ -0,0 +1,238 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +class StringMangler { |
| 5 | + protected $manglers; |
| 6 | + |
| 7 | + protected $sPrefix = ''; |
| 8 | + protected $aExact = array(); |
| 9 | + protected $aPrefix = array(); |
| 10 | + protected $aRegex = array(); |
| 11 | + |
| 12 | + public static function EmptyMatcher() { |
| 13 | + return new StringMatcher( '', array() ); |
| 14 | + } |
| 15 | + |
| 16 | + public function __construct( array $manglers ) { |
| 17 | + $this->manglers = $manglers; |
| 18 | + } |
| 19 | + |
| 20 | + public function match( $string ) { |
| 21 | + foreach ( $this->manglers as $mangler ) { |
| 22 | + if ( $mangler->match($string) ) { |
| 23 | + return true; |
| 24 | + } |
| 25 | + } |
| 26 | + |
| 27 | + return false; |
| 28 | + } |
| 29 | + |
| 30 | + public function mangle( $data ) { |
| 31 | + if ( is_array( $data ) ) { |
| 32 | + return $this->mangleArray( $data ); |
| 33 | + } elseif ( is_string( $data ) ) { |
| 34 | + return $this->mangleString( $data ); |
| 35 | + } elseif ( $data === null ) { |
| 36 | + return $data; |
| 37 | + } else { |
| 38 | + throw new MWException( __METHOD__ . ": Unsupported datatype" ); |
| 39 | + } |
| 40 | + } |
| 41 | + |
| 42 | + public function unMangle( $data ) { |
| 43 | + if ( is_array( $data ) ) { |
| 44 | + return $this->mangleArray( $data, true); |
| 45 | + } elseif ( is_string( $data ) ) { |
| 46 | + return $this->mangleString( $data, true ); |
| 47 | + } elseif ( $data === null ) { |
| 48 | + return $data; |
| 49 | + } else { |
| 50 | + throw new MWException( __METHOD__ . ": Unsupported datatype" ); |
| 51 | + } |
| 52 | + } |
| 53 | + |
| 54 | + |
| 55 | + protected function mangleString( $string, $reverse = false ) { |
| 56 | + if ( $reverse ) { |
| 57 | + foreach ( $this->manglers as $mangler ) { |
| 58 | + if ( $mangler->unmatch($string) ) { |
| 59 | + return $mangler->unmangle($string); |
| 60 | + } |
| 61 | + } |
| 62 | + } else { |
| 63 | + foreach ( $this->manglers as $mangler ) { |
| 64 | + if ( $mangler->match($string) ) { |
| 65 | + return $mangler->mangle($string); |
| 66 | + } |
| 67 | + } |
| 68 | + } |
| 69 | + return $string; |
| 70 | + } |
| 71 | + |
| 72 | + protected function mangleArray( Array $array, $reverse = false ) { |
| 73 | + $temp = array(); |
| 74 | + |
| 75 | + # There doesn't seem to be a good way to check wether array is indexed |
| 76 | + # with keys or numerically |
| 77 | + if ( isset($array[0]) ) { |
| 78 | + foreach ( $array as $key => &$value ) { |
| 79 | + $value = $this->mangleString( $value, $reverse ); |
| 80 | + $temp[$key] = $value; // Assign a reference |
| 81 | + } |
| 82 | + } else { |
| 83 | + foreach ( $array as $key => &$value ) { |
| 84 | + $key = $this->mangleString( $key, $reverse ); |
| 85 | + $temp[$key] = $value; // Assign a reference |
| 86 | + } |
| 87 | + } |
| 88 | + |
| 89 | + return $temp; |
| 90 | + } |
| 91 | + |
| 92 | +} |
| 93 | + |
| 94 | +interface SmItem { |
| 95 | + public function match( $string ); |
| 96 | + public function matchBackwards( $string ); |
| 97 | + public function mangle( $string ); |
| 98 | + public function unmangle( $string ); |
| 99 | +} |
| 100 | + |
| 101 | +class SmRewriter implements SmItem { |
| 102 | + protected $from, $to; |
| 103 | + |
| 104 | + public function __construct( $from, $to ) { |
| 105 | + $this->from = $from; |
| 106 | + $this->to = $to; |
| 107 | + } |
| 108 | + |
| 109 | + public function match( $string ) { |
| 110 | + return $string === $this->from; |
| 111 | + } |
| 112 | + |
| 113 | + public function matchBackwards( $string ) { |
| 114 | + return $string === $this->to; |
| 115 | + } |
| 116 | + |
| 117 | + public function mangle( $string ) { |
| 118 | + return $string === $this->from ? $this->to : $string; |
| 119 | + } |
| 120 | + |
| 121 | + public function unmangle( $string ) { |
| 122 | + return $string === $this->from ? $this->to : $string; |
| 123 | + } |
| 124 | +} |
| 125 | + |
| 126 | +class SmAffixRewriter implements SmItem { |
| 127 | + const PREFIX = 1; |
| 128 | + const SUFFIX = 2; |
| 129 | + |
| 130 | + protected $fromAffix, $toAffix; |
| 131 | + protected $fromType, $toType; |
| 132 | + protected $fromLength, $toLength; |
| 133 | + |
| 134 | + public function __construct( array $from, array $to ) { |
| 135 | + if ( !$this->checkInput($from) || $this->checkInput($to) ) { |
| 136 | + throw new MWException( "Invalid input, should be array( affixtype, string )" ); |
| 137 | + } |
| 138 | + |
| 139 | + list( $this->fromType, $this->fromAffix ) = $from; |
| 140 | + $this->fromLength = strlen($this->fromAffix); |
| 141 | + |
| 142 | + list( $this->toType, $this->toAffix ) = $to; |
| 143 | + $this->toLength = strlen($this->toAffix); |
| 144 | + } |
| 145 | + |
| 146 | + public function checkInput( array $input ) { |
| 147 | + $ok = true; |
| 148 | + if ( count($input) !== 2 ) { |
| 149 | + $ok = false; |
| 150 | + } elseif ( $input[0] !== self::PREFIX || $input[0] !== self::SUFFIX ) { |
| 151 | + $ok = false; |
| 152 | + } elseif ( !is_string($input[1]) ) { |
| 153 | + $ok = false; |
| 154 | + } |
| 155 | + return $ok; |
| 156 | + } |
| 157 | + |
| 158 | + public function match( $string ) { |
| 159 | + return $this->_match( $string, false ); |
| 160 | + } |
| 161 | + |
| 162 | + public function matchBackwards( $string ) { |
| 163 | + return $this->_match( $string, true ); |
| 164 | + } |
| 165 | + |
| 166 | + protected function _match( $string, $reverse = false ) { |
| 167 | + if ( !$reverse ) { |
| 168 | + $len = $this->fromLength; |
| 169 | + $type = $this->fromType; |
| 170 | + $affix = $this->fromAffix; |
| 171 | + } else { |
| 172 | + $len = $this->toLength; |
| 173 | + $type = $this->toType; |
| 174 | + $affix = $this->toAffix; |
| 175 | + } |
| 176 | + |
| 177 | + if ( $this-type === self::SUFFIX ) { |
| 178 | + if ( strlen($string) < $len ) { |
| 179 | + return false; |
| 180 | + } |
| 181 | + $string = substr( $string, -$len ); |
| 182 | + } |
| 183 | + return strncmp( $string, $affix, $len ) === 0; |
| 184 | + } |
| 185 | + |
| 186 | + public function mangle( $string ) { |
| 187 | + if ( $this->match($string) ) { |
| 188 | + if ( $this->toType === self::PREFIX ) { |
| 189 | + return $this->toAffix . $string; |
| 190 | + } elseif ( $this->toType === self::SUFFIX ) { |
| 191 | + return $string . $this->toAffix; |
| 192 | + } else { |
| 193 | + throw new MWException( "Error" ); |
| 194 | + } |
| 195 | + } |
| 196 | + return $string; |
| 197 | + } |
| 198 | + |
| 199 | + public function unmangle( $string ) { |
| 200 | + if ( $this->matchBackwards($string) ) { |
| 201 | + if ( $this->fromType === self::PREFIX ) { |
| 202 | + return substr($string, $this->fromLength); |
| 203 | + } elseif ( $this->toType === self::SUFFIX ) { |
| 204 | + return substr($string, 0, -$this->fromLength); |
| 205 | + } else { |
| 206 | + throw new MWException( "Error" ); |
| 207 | + } |
| 208 | + } |
| 209 | + return $string; |
| 210 | + } |
| 211 | +} |
| 212 | + |
| 213 | +class SmRegexRewriter implements SmItem { |
| 214 | + protected $from, $to; |
| 215 | + |
| 216 | + public function __construct( $from, $to ) { |
| 217 | + $this->from = $from; |
| 218 | + $this->to = $to; |
| 219 | + } |
| 220 | + |
| 221 | + public function match( $string ) { |
| 222 | + return preg_match( $this->from[0], $string ); |
| 223 | + } |
| 224 | + |
| 225 | + public function matchBackwards( $string ) { |
| 226 | + return preg_match( $this->from[1], $string ); |
| 227 | + } |
| 228 | + |
| 229 | + public function mangle( $string ) { |
| 230 | + var_dump( $string ); |
| 231 | + $a = preg_replace( $this->from[0], $this->from[1], $string ); |
| 232 | + var_dump( $a ); |
| 233 | + return $a; |
| 234 | + } |
| 235 | + |
| 236 | + public function unmangle( $string ) { |
| 237 | + return preg_replace( $this->to[0], $this->to[1], $string ); |
| 238 | + } |
| 239 | +} |
Property changes on: trunk/extensions/Translate/utils/StringMangler.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 240 | + native |
Index: trunk/extensions/Translate/mwextensions/MediaWikiExtensions.php |
— | — | @@ -0,0 +1,113 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +class PremadeMediawikiExtensionGroups { |
| 5 | + protected $groups; |
| 6 | + |
| 7 | + public function init() { |
| 8 | + if ( $this->groups !== null ) return; |
| 9 | + |
| 10 | + $dir = dirname( __FILE__ ); |
| 11 | + $defines = file_get_contents( $dir . '/defines.txt' ); |
| 12 | + $sections = preg_split( "/\n\n/", $defines, -1, PREG_SPLIT_NO_EMPTY ); |
| 13 | + |
| 14 | + $groups = $fixedGroups = array(); |
| 15 | + |
| 16 | + foreach ( $sections as $section ) { |
| 17 | + $lines = preg_split( "/\n/", $section ); |
| 18 | + $newgroup = array(); |
| 19 | + |
| 20 | + foreach ( $lines as $line ) { |
| 21 | + if ( strpos( $line, '=' ) === false ) { |
| 22 | + if ( empty($newgroup['name']) ) { |
| 23 | + $newgroup['name'] = $line; |
| 24 | + } else { |
| 25 | + throw new MWException( "Trying to define name twice: " . $line ); |
| 26 | + } |
| 27 | + } else { |
| 28 | + list( $key, $value ) = array_map( 'trim', explode( '=', $line, 2 ) ); |
| 29 | + switch ($key) { |
| 30 | + case 'file': |
| 31 | + case 'var': |
| 32 | + case 'id': |
| 33 | + $newgroup[$key] = $value; |
| 34 | + break; |
| 35 | + case 'optional': |
| 36 | + case 'ignored': |
| 37 | + $values = array_map( 'trim', explode( ',', $value ) ); |
| 38 | + if ( !isset($newgroup[$key]) ) { |
| 39 | + $newgroup[$key] = array(); |
| 40 | + } |
| 41 | + $newgroup[$key] = array_merge( $newgroup[$key], $values ); |
| 42 | + break; |
| 43 | + default: |
| 44 | + throw new MWException( "Unknown key:" . $key ); |
| 45 | + } |
| 46 | + } |
| 47 | + } |
| 48 | + |
| 49 | + if ( count($newgroup) ) { |
| 50 | + if ( empty($newgroup['name']) ) { |
| 51 | + throw new MWException( "Name missing\n" . print_r($newgroup, true) ); |
| 52 | + } |
| 53 | + $groups[] = $newgroup; |
| 54 | + } |
| 55 | + } |
| 56 | + |
| 57 | + |
| 58 | + foreach ( $groups as $g ) { |
| 59 | + if ( !is_array($g) ) { |
| 60 | + $g = array($g); |
| 61 | + } |
| 62 | + |
| 63 | + $name = $g['name']; |
| 64 | + |
| 65 | + if ( isset($g['id']) ) { |
| 66 | + $id = $g['id']; |
| 67 | + } else { |
| 68 | + $id = 'ext-' . preg_replace( '/\s+/', '', strtolower( $name ) ); |
| 69 | + } |
| 70 | + |
| 71 | + if ( isset($g['file']) ) { |
| 72 | + $file = $g['file']; |
| 73 | + } else { |
| 74 | + $file = preg_replace( '/\s+/', '', "$name/$name.i18n.php" ); |
| 75 | + } |
| 76 | + |
| 77 | + $newgroup = array( |
| 78 | + 'name' => $name, |
| 79 | + 'file' => $file, |
| 80 | + ); |
| 81 | + |
| 82 | + $copyvars = array( 'ignored', 'optional', 'var' ); |
| 83 | + foreach ( $copyvars as $var ) { |
| 84 | + if ( isset($g[$var]) ) { |
| 85 | + $newgroup[$var] = $g[$var]; |
| 86 | + } |
| 87 | + } |
| 88 | + |
| 89 | + $fixedGroups[$id] = $newgroup; |
| 90 | + } |
| 91 | + |
| 92 | + $this->groups = $fixedGroups; |
| 93 | + } |
| 94 | + |
| 95 | + public function addAll() { |
| 96 | + global $wgTranslateAC, $wgTranslateEC; |
| 97 | + $this->init(); |
| 98 | + foreach ( $this->groups as $id => $g ) { |
| 99 | + $wgTranslateAC[$id] = array( $this, 'factory' ); |
| 100 | + $wgTranslateEC[] = $id; |
| 101 | + } |
| 102 | + } |
| 103 | + |
| 104 | + public function factory( $id ) { |
| 105 | + $info = $this->groups[$id]; |
| 106 | + $group = ExtensionMessageGroup::factory( $info['name'], $id ); |
| 107 | + $group->setMessageFile( $info['file'] ); |
| 108 | + if ( !empty($info['var']) ) $group->setVariableName( $info['var'] ); |
| 109 | + if ( !empty($info['optional']) ) $group->setOptional( $info['optional'] ); |
| 110 | + if ( !empty($info['ignored']) ) $group->setIgnored( $info['ignored'] ); |
| 111 | + return $group; |
| 112 | + } |
| 113 | + |
| 114 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/Translate/mwextensions/MediaWikiExtensions.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 115 | + native |
Index: trunk/extensions/Translate/mwextensions/defines.txt |
— | — | @@ -0,0 +1,600 @@ |
| 2 | +Absentee Landlord |
| 3 | + |
| 4 | +Advanced Random |
| 5 | +file = AdvancedRandom/SpecialAdvancedRandom.i18n.php |
| 6 | + |
| 7 | +Ajax Query Pages |
| 8 | + |
| 9 | +Ajax Show Editors |
| 10 | + |
| 11 | +Anti Bot |
| 12 | + |
| 13 | +Anti Spoof |
| 14 | + |
| 15 | +APC |
| 16 | +file = APC/ViewAPC.i18n.php |
| 17 | + |
| 18 | +Asksql |
| 19 | + |
| 20 | +Assert Edit |
| 21 | + |
| 22 | +Author Protect |
| 23 | + |
| 24 | +Babel |
| 25 | +ignored = babel-box-cellspacing, babel-category-prefix, babel-category-suffix |
| 26 | +ignored = babel-portal-prefix, babel-portal-suffix, babel-template-prefix |
| 27 | +ignored = babel-template-suffix |
| 28 | +optional = babel-0-female, babel-1-female, babel-2-female, babel-3-female |
| 29 | +optional = babel-4-female, babel-5-female, babel-N-female, babel-0-n-female |
| 30 | +optional = babel-1-n-female, babel-2-n-female, babel-3-n-female |
| 31 | +optional = babel-4-n-female, babel-5-n-female, babel-N-n-female, babel-0-male |
| 32 | +optional = babel-1-male, babel-2-male, babel-3-male, babel-4-male, babel-5-male |
| 33 | +optional = babel-N-male, babel-0-n-male, babel-1-n-male, babel-2-n-male |
| 34 | +optional = babel-3-n-male, babel-4-n-male, babel-5-n-male, babel-N-n-male |
| 35 | + |
| 36 | +Back and Forth |
| 37 | +file = BackAndForth/BackAndForth.i18n.php |
| 38 | + |
| 39 | +Bad Image |
| 40 | + |
| 41 | +Blahtex |
| 42 | + |
| 43 | +Block Titles |
| 44 | + |
| 45 | +Board Vote |
| 46 | +ignored = boardvote_footer |
| 47 | + |
| 48 | +Book Information |
| 49 | + |
| 50 | +Breadcrumbs navigation |
| 51 | +file = BreadCrumbs/BreadCrumbs.i18n.php |
| 52 | +id = ext-breadcrumbs |
| 53 | + |
| 54 | +Call |
| 55 | + |
| 56 | +Category Intersection |
| 57 | + |
| 58 | +Category Stepper |
| 59 | +ignored = categorystepper |
| 60 | + |
| 61 | +Category Tree |
| 62 | + |
| 63 | +Category Feed |
| 64 | +file = catfeed/catfeed.i18n.php |
| 65 | +id = ext-catfeed |
| 66 | + |
| 67 | +Central Auth |
| 68 | + |
| 69 | +Central Notice |
| 70 | + |
| 71 | +Change Author |
| 72 | +optional = changeauthor-rev |
| 73 | +ignored = changeauthor-short,changeauthor-logpagetext |
| 74 | + |
| 75 | +CharInsert |
| 76 | + |
| 77 | +Check User |
| 78 | + |
| 79 | +Chemistry |
| 80 | +file = Chemistry/ChemFunctions.i18n.php |
| 81 | +optional = chemFunctions_SearchExplanation |
| 82 | +ignored = chemFunctions_EINECS, chemFunctions_CHEBI, chemFunctions_PubChem, |
| 83 | +ignored = chemFunctions_SMILES, chemFunctions_InChI, chemFunctions_RTECS, |
| 84 | +ignored = chemFunctions_KEGG, chemFunctions_DrugBank |
| 85 | + |
| 86 | +Cite |
| 87 | +optional = cite_reference_link_key_with_num, cite_reference_link_prefix |
| 88 | +optional = cite_reference_link_suffix, cite_references_link_prefix |
| 89 | +optional = cite_references_link_suffix, cite_reference_link |
| 90 | +optional = cite_references_link_one, cite_references_link_many |
| 91 | +optional = cite_references_link_many_format |
| 92 | +optional = cite_references_link_many_format_backlink_labels |
| 93 | +optional = cite_references_link_many_sep, cite_references_link_many_and |
| 94 | +ignored = cite_references_prefix, cite_references_suffix |
| 95 | + |
| 96 | +Cite (special page) |
| 97 | +id = ext-citespecial |
| 98 | +file = Cite/SpecialCite.i18n.php |
| 99 | +ignored = cite_text |
| 100 | + |
| 101 | +Clean Changes |
| 102 | + |
| 103 | +Collection |
| 104 | + |
| 105 | +Comment Pages |
| 106 | +ignored = commenttab-editintro, commenttab-preload |
| 107 | + |
| 108 | +Comment Spammer |
| 109 | + |
| 110 | +Configure |
| 111 | +optional = configure-section-html, configure-section-ajax |
| 112 | +optional = configure-section-djvu, configure-section-imagemagick |
| 113 | +optional = configure-section-interwiki, configure-section-memcached |
| 114 | +optional = configure-section-squid, configure-section-svg, configure-section-tex |
| 115 | +optional = configure-section-tidy |
| 116 | + |
| 117 | +Confirm Account |
| 118 | +optional = requestaccount-info, requestaccount-footer |
| 119 | + |
| 120 | +Confirm Edit |
| 121 | + |
| 122 | +ConfirmEdit Fancy Captcha |
| 123 | +file = ConfirmEdit/FancyCaptcha.i18n.php |
| 124 | + |
| 125 | +Contact Page |
| 126 | + |
| 127 | +Contribution Scores |
| 128 | + |
| 129 | +Contributions Edit Count |
| 130 | +file = Contributionseditcount/Contributionseditcount.i18n.php |
| 131 | + |
| 132 | +Contributors |
| 133 | + |
| 134 | +Contributors Add-on |
| 135 | +id = ext-contributorsaddon |
| 136 | +file = ContributorsAddon/ContributorsAddon.i18n.php |
| 137 | + |
| 138 | +Count Edits |
| 139 | + |
| 140 | +Cross Namespace Links |
| 141 | +file = CrossNamespaceLinks/SpecialCrossNamespaceLinks.i18n.php |
| 142 | + |
| 143 | +Crosswiki Block |
| 144 | +file = Crosswiki/Block/CrosswikiBlock.i18n.php |
| 145 | + |
| 146 | +Crowd Authentication |
| 147 | + |
| 148 | +Data Transfer |
| 149 | +file = DataTransfer/languages/DT_Messages.php |
| 150 | + |
| 151 | +Deleted Contributions |
| 152 | +id = ext-deletedcontribs |
| 153 | + |
| 154 | +Did You Mean |
| 155 | + |
| 156 | +Dismissable SiteNotice |
| 157 | +ignored = sitenotice_id |
| 158 | + |
| 159 | +Double Wiki |
| 160 | + |
| 161 | +DPL Forum |
| 162 | +file = DPLforum/DPLforum.i18n.php |
| 163 | + |
| 164 | +Duplicator |
| 165 | + |
| 166 | +Edit Count |
| 167 | +file = Editcount/SpecialEditcount.i18n.php |
| 168 | + |
| 169 | +Edit Messages |
| 170 | + |
| 171 | +Edit Own |
| 172 | + |
| 173 | +Edit Similar |
| 174 | + |
| 175 | +Edit Subpages |
| 176 | + |
| 177 | +Edit User |
| 178 | + |
| 179 | +Email Address Image |
| 180 | + |
| 181 | +Email Article |
| 182 | + |
| 183 | +Eval |
| 184 | +file = Eval/SpecialEval.i18n.php |
| 185 | + |
| 186 | +Expand Templates |
| 187 | + |
| 188 | +Farmer |
| 189 | +optional = farmercreateurl |
| 190 | +ignored = farmerwikiurl, farmerinterwikiurl |
| 191 | + |
| 192 | +Flagged Revisions - Flagged Revs |
| 193 | +id = ext-fr-flaggedrevs |
| 194 | +file = FlaggedRevs/language/FlaggedRevs.i18n.php |
| 195 | +optional = revreview-toggle |
| 196 | + |
| 197 | +Flagged Revisions - Depreciation Oversight |
| 198 | +id = ext-fr-depreciationoversight |
| 199 | +file = FlaggedRevs/language/DepreciationOversight.i18n.php |
| 200 | + |
| 201 | +Flagged Revisions - Flagged Revs Aliases |
| 202 | +id = ext-fr-flaggedrevsaliases |
| 203 | +file = FlaggedRevs/language/FlaggedRevsAliases.i18n.php |
| 204 | + |
| 205 | +Flagged Revisions - Old Reviewed Pages |
| 206 | +id = ext-fr-oldreviewedpages |
| 207 | +file = FlaggedRevs/language/OldReviewedPages.i18n.php |
| 208 | + |
| 209 | +Flagged Revisions - Quality Oversight |
| 210 | +id = ext-fr-qualityoversight |
| 211 | +file = FlaggedRevs/language/QualityOversight.i18n.php |
| 212 | + |
| 213 | +Flagged Revisions - Reviewed Pages |
| 214 | +id = ext-fr-reviewedpages |
| 215 | +file = FlaggedRevs/language/ReviewedPages.i18n.php |
| 216 | + |
| 217 | +Flagged Revisions - Stabilization |
| 218 | +id = ext-fr-stabilization |
| 219 | +file = FlaggedRevs/language/Stabilization.i18n.php |
| 220 | + |
| 221 | +Flagged Revisions - Stable Pages |
| 222 | +id = ext-fr-stablepages |
| 223 | +file = FlaggedRevs/language/StablePages.i18n.php |
| 224 | + |
| 225 | +Flagged Revisions - Stable Versions |
| 226 | +id = ext-fr-stableversions |
| 227 | +file = FlaggedRevs/language/StableVersions.i18n.php |
| 228 | + |
| 229 | +Flagged Revisions - Unreviewed Pages |
| 230 | +id = ext-fr-unreviewedpages |
| 231 | +file = FlaggedRevs/language/UnreviewedPages.i18n.php |
| 232 | + |
| 233 | +Find Spam |
| 234 | + |
| 235 | +Fixed Image |
| 236 | + |
| 237 | +Force Preview |
| 238 | + |
| 239 | +Format Email |
| 240 | +ignored = email_header |
| 241 | + |
| 242 | +Gadgets |
| 243 | +ignored = gadgets-definition |
| 244 | + |
| 245 | +Global Blocking |
| 246 | +ignored = globalblocking-expiry-options |
| 247 | + |
| 248 | +Global Usage |
| 249 | + |
| 250 | +Gnuplot |
| 251 | + |
| 252 | +Google Analytics |
| 253 | +file = googleAnalytics/googleAnalytics.i18n.php |
| 254 | + |
| 255 | +Google Maps |
| 256 | +var = wgGoogleMapsMessages |
| 257 | + |
| 258 | +Go To Category |
| 259 | + |
| 260 | +HTMLets |
| 261 | + |
| 262 | +Parser i18n tags |
| 263 | +id = ext-i18ntags |
| 264 | +file = I18nTags/I18nTags.i18n.php |
| 265 | + |
| 266 | +Icon |
| 267 | + |
| 268 | +Image Map |
| 269 | +ignored = imagemap_desc_types |
| 270 | + |
| 271 | +Image Tagging |
| 272 | + |
| 273 | +Import Free Images |
| 274 | + |
| 275 | +Import Users |
| 276 | +file = ImportUsers/SpecialImportUsers.i18n.php |
| 277 | + |
| 278 | +Input Box |
| 279 | +file = inputbox/InputBox.i18n.php |
| 280 | + |
| 281 | +Inspect Cache |
| 282 | + |
| 283 | +Intersection |
| 284 | +file = intersection/DynamicPageList.i18n.php |
| 285 | + |
| 286 | +Interwiki Edit Page |
| 287 | +id = ext-interwiki |
| 288 | +file = Interwiki/SpecialInterwiki.i18n.php |
| 289 | +optional = interwiki_defaulturl, interwiki_local, interwiki_trans |
| 290 | +ignored = interwiki_logentry, interwiki_url |
| 291 | + |
| 292 | +Invitations |
| 293 | +ignored = invitations-uninvitedlist-item |
| 294 | + |
| 295 | +Labeled Section Transclusion |
| 296 | +file = LabeledSectionTransclusion/lst.i18n.php |
| 297 | + |
| 298 | +Cldr |
| 299 | +file = cldr/LanguageNames.i18n.php |
| 300 | + |
| 301 | +Language Selector |
| 302 | + |
| 303 | +Latex Doc |
| 304 | + |
| 305 | +Link Search |
| 306 | + |
| 307 | +Liquid Threads |
| 308 | +file = LiquidThreads/Lqt.i18n.php |
| 309 | +ignored = lqt_header_warning_before_big |
| 310 | + |
| 311 | +Lookup User |
| 312 | + |
| 313 | +Maintenance |
| 314 | +ignored = maintenance-initEditCount, maintenance-runJobs, maintenance-showJobs |
| 315 | +ignored = maintenance-stats |
| 316 | + |
| 317 | +Math Stat |
| 318 | +file = MathStatFunctions/MathStatFunctions.i18n.php |
| 319 | + |
| 320 | +Media Functions |
| 321 | + |
| 322 | +Metavid Wiki |
| 323 | +file = MetavidWiki/languages/MV_Messages.php |
| 324 | +optional = ao_file_64Kb_MPEG4, ao_file_256Kb_MPEG4, ao_file_MPEG1, ao_file_MPEG2 |
| 325 | +optional = ao_file_flash_flv |
| 326 | + |
| 327 | +Mibbit |
| 328 | + |
| 329 | +MicroID |
| 330 | + |
| 331 | +Mini Donation |
| 332 | + |
| 333 | +Minimum Name Length |
| 334 | + |
| 335 | +Mini Preview |
| 336 | + |
| 337 | +Multi Boilerplate |
| 338 | +ignored = multiboilerplate, multiboilerplate-label |
| 339 | + |
| 340 | +Multi Upload |
| 341 | +file = MultiUpload/SpecialMultipleUpload.i18n.php |
| 342 | + |
| 343 | +MediaWiki Search |
| 344 | +id = ext-mwsearch |
| 345 | +file = MWSearch/MWSearch.i18n.php |
| 346 | + |
| 347 | +Navigation Popups |
| 348 | +file = NavigationPopups/NavigationPopups.18n.php |
| 349 | + |
| 350 | +Network Auth |
| 351 | +optional = networkauth-name, networkauth-purltext |
| 352 | + |
| 353 | +Newest Pages |
| 354 | + |
| 355 | +News |
| 356 | +optional = newsextension-unknownformat, newsextension-feednotfound |
| 357 | +optional = newsextension-feedrequest, newsextension-checkok |
| 358 | +optional = newsextension-checkok1, newsextension-gotcached, newsextension-purge |
| 359 | +optional = newsextension-loggin, newsextension-outputting, newsextension-stale |
| 360 | +optional = newsextension-nofoundonpage, newsextension-renderedfeed |
| 361 | +optional = newsextension-cachingfeed, newsextension-freshfeed |
| 362 | + |
| 363 | +Newuser Log |
| 364 | +file = Newuserlog/Newuserlog.i18n.php |
| 365 | +ignored = newuserlogentry |
| 366 | + |
| 367 | +New User Message |
| 368 | + |
| 369 | +New User Notification |
| 370 | +file = NewUserNotif/NewUserNotif.i18n.php |
| 371 | + |
| 372 | +Nuke |
| 373 | +file = Nuke/SpecialNuke.i18n.php |
| 374 | + |
| 375 | +OAI-PMH repository |
| 376 | +id = ext-oai |
| 377 | +file = OAI/OAIRepo.i18n.php |
| 378 | + |
| 379 | +Ogg Handler |
| 380 | +optional = ogg-player-cortado, ogg-player-vlc-mozilla, ogg-player-vlc-activex |
| 381 | +optional = ogg-player-quicktime-mozilla, ogg-player-quicktime-activex |
| 382 | + |
| 383 | +Online Status |
| 384 | +ignored = onlinestatus-levels |
| 385 | + |
| 386 | +OpenID |
| 387 | + |
| 388 | +Oversight |
| 389 | +file = Oversight/HideRevision.i18n.php |
| 390 | + |
| 391 | +Page By |
| 392 | + |
| 393 | +Password Reset |
| 394 | + |
| 395 | +Parser Diff Test |
| 396 | + |
| 397 | +Parser Functions |
| 398 | + |
| 399 | +Patroller |
| 400 | + |
| 401 | +Pdf Handler |
| 402 | + |
| 403 | +Piwik |
| 404 | +optional = piwik |
| 405 | + |
| 406 | +Player |
| 407 | +ignored = player-pagetext, player-imagepage-header |
| 408 | + |
| 409 | +PNG Handler |
| 410 | + |
| 411 | +Poem |
| 412 | + |
| 413 | +Post Comment |
| 414 | +file = Postcomment/SpecialPostcomment.i18n.php |
| 415 | + |
| 416 | +POV Watch |
| 417 | +file = PovWatch/PovWatch.i18n.php |
| 418 | + |
| 419 | +Preloader |
| 420 | + |
| 421 | +Profile Monitor |
| 422 | + |
| 423 | +Proofread Page |
| 424 | + |
| 425 | +Protect Section |
| 426 | + |
| 427 | +PSI NoTocNum |
| 428 | + |
| 429 | +Purge |
| 430 | + |
| 431 | +Purge Cache |
| 432 | + |
| 433 | +Quiz |
| 434 | + |
| 435 | +Random Image |
| 436 | + |
| 437 | +Random in Category |
| 438 | +file = RandomInCategory/SpecialRandomincategory.i18n.php |
| 439 | + |
| 440 | +Random Root Page |
| 441 | +file = Randomrootpage/Randomrootpage.i18n.php |
| 442 | + |
| 443 | +Regex Block |
| 444 | +file = regexBlock/regexBlock.i18n.php |
| 445 | + |
| 446 | +Rename User |
| 447 | +file = Renameuser/SpecialRenameuser.i18n.php |
| 448 | + |
| 449 | +Replace Text |
| 450 | + |
| 451 | +Review |
| 452 | + |
| 453 | +Right Functions |
| 454 | + |
| 455 | +See also |
| 456 | + |
| 457 | +Scan Set |
| 458 | + |
| 459 | +Select Category |
| 460 | + |
| 461 | +Semantic Calendar |
| 462 | +file = SemanticCalendar/languages/SC_Messages.php |
| 463 | + |
| 464 | +Semantic Drilldown |
| 465 | +file = SemanticDrilldown/languages/SD_Messages.php |
| 466 | + |
| 467 | +Semantic Forms |
| 468 | +file = SemanticForms/languages/SF_Messages.php |
| 469 | + |
| 470 | +Semantic MediaWiki |
| 471 | +file = SemanticMediaWiki/languages/SMW_Messages.php |
| 472 | +ignored = smw_ask_doculink, smw_service_online_maps, smw_uri_blacklist |
| 473 | +optional = smw_rss_link, smw_decseparator, smw_kiloseparator |
| 474 | +optional = smw_rss_description, smw_browse_more, specialpages-group-smw_group |
| 475 | + |
| 476 | +Show Processlist |
| 477 | + |
| 478 | +Sign Document |
| 479 | + |
| 480 | +Sign Document Special Create |
| 481 | +file = SignDocument/SpecialCreateSignDocument.i18n.php |
| 482 | + |
| 483 | +Sign Document Special |
| 484 | +file = SignDocument/SpecialSignDocument.i18n.php |
| 485 | + |
| 486 | +Simple Anti Spam |
| 487 | + |
| 488 | +Site Matrix |
| 489 | + |
| 490 | +Skin Per Page |
| 491 | + |
| 492 | +Smooth Gallery |
| 493 | +ignored = smoothgallery-pagetext |
| 494 | + |
| 495 | +Social Profile User Board |
| 496 | +file = SocialProfile/UserBoard/UserBoard.i18n.php |
| 497 | + |
| 498 | +Social Profile User Profile |
| 499 | +file = SocialProfile/UserProfile/UserProfile.i18n.php |
| 500 | + |
| 501 | +Social Profile User Relationship |
| 502 | +file = SocialProfile/UserRelationship/UserRelationship.i18n.php |
| 503 | + |
| 504 | +Spam Blacklist |
| 505 | + |
| 506 | +Spam Diff Tool |
| 507 | + |
| 508 | +Spam Regex |
| 509 | + |
| 510 | +Special File List |
| 511 | +file = SpecialFileList/SpecialFilelist.i18n.php |
| 512 | + |
| 513 | +Special Form |
| 514 | +ignored = formtemplatepattern |
| 515 | + |
| 516 | +Sub Page List 3 |
| 517 | + |
| 518 | +Stale Pages |
| 519 | + |
| 520 | +Syntax Highlight GeSHi |
| 521 | +file = SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.i18n.php |
| 522 | + |
| 523 | +Tab0 |
| 524 | + |
| 525 | +Talk Here |
| 526 | +ignored = talkhere-title, talkhere-headtext, talkhere-afterinput |
| 527 | +ignored = talkhere-afterform |
| 528 | + |
| 529 | +Template Link |
| 530 | + |
| 531 | +TidyTab |
| 532 | +file = TidyTab/Tidy.i18n.php |
| 533 | + |
| 534 | +Throttle |
| 535 | +file = Throttle/UserThrottle.i18n.php |
| 536 | + |
| 537 | +Timeline |
| 538 | +file = timeline/Timeline.i18n.php |
| 539 | + |
| 540 | +Title Blacklist |
| 541 | + |
| 542 | +Title Key |
| 543 | + |
| 544 | +Todo |
| 545 | +file = Todo/SpecialTodo.i18n.php |
| 546 | + |
| 547 | +Todo Tasks |
| 548 | +file = TodoTasks/SpecialTaskList.i18n.php |
| 549 | + |
| 550 | +Tooltip |
| 551 | + |
| 552 | +Tor Block |
| 553 | + |
| 554 | +Translate |
| 555 | +optional = translate-page-paging-links |
| 556 | + |
| 557 | +Usage Statistics |
| 558 | +file = UsageStatistics/SpecialUserStats.i18n.php |
| 559 | + |
| 560 | +User Contact Links |
| 561 | +file = UserContactLinks/UserSignature.i18n.php |
| 562 | + |
| 563 | +User Images |
| 564 | + |
| 565 | +User Merge |
| 566 | + |
| 567 | +Username Blacklist |
| 568 | + |
| 569 | +User Rights Notification |
| 570 | +id = ext-userrightsnotif |
| 571 | +file = UserRightsNotif/UserRightsNotif.i18n.php |
| 572 | + |
| 573 | +Vote |
| 574 | + |
| 575 | +Watchers |
| 576 | + |
| 577 | +Watch Subpages |
| 578 | + |
| 579 | +Web Store |
| 580 | + |
| 581 | +White List |
| 582 | +var = allMessages |
| 583 | +file = WhiteList/SpecialWhitelistEdit.i18n.php |
| 584 | + |
| 585 | +Who Is Watching |
| 586 | +file = WhoIsWatching/SpecialWhoIsWatching.i18n.php |
| 587 | + |
| 588 | +Wikidata Language Manager |
| 589 | +var = wdMessages |
| 590 | +file = Wikidata/SpecialLanguages.i18n.php |
| 591 | +ignored = ow_editing_policy_url |
| 592 | + |
| 593 | +Wikihiero |
| 594 | +file = wikihiero/wikihiero.i18n.php |
| 595 | + |
| 596 | +Woopra |
| 597 | + |
| 598 | +YUI |
| 599 | +file = SocialProfile/YUI/yui.i18n.php |
| 600 | + |
| 601 | +YouTube Auth Sub |
\ No newline at end of file |
Property changes on: trunk/extensions/Translate/mwextensions/defines.txt |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 602 | + native |
Index: trunk/extensions/Translate/export.php |
— | — | @@ -51,9 +51,5 @@ |
52 | 52 | exit( 1 ); |
53 | 53 | } |
54 | 54 | |
55 | | -if ( $group->canExportToFile() ) { |
56 | | - $exporter = $group->getFileExporter(); |
57 | | - $exporter->export( $langs, $options['target'] ); |
58 | | -} else { |
59 | | - echo "Cannot export to file\n\n"; |
60 | | -} |
| 55 | +$writer = $group->getWriter(); |
| 56 | +$writer->fileExport( $langs, $options['target'] ); |
Index: trunk/extensions/Translate/MessageGroups.php |
— | — | @@ -5,118 +5,97 @@ |
6 | 6 | * Human-readable name of this group |
7 | 7 | */ |
8 | 8 | protected $label = 'none'; |
| 9 | + public function getLabel() { return $this->label; } |
| 10 | + public function setLabel( $value ) { $this->label = $value; } |
9 | 11 | |
10 | 12 | /** |
11 | 13 | * Group-wide unique id of this group. Used also for sorting. |
12 | 14 | */ |
13 | 15 | protected $id = 'none'; |
| 16 | + public function getId() { return $this->id; } |
| 17 | + public function setId( $value ) { $this->id = $value; } |
14 | 18 | |
15 | 19 | /** |
16 | | - * Cache of loaded messages. |
| 20 | + * List of messages that are hidden by default, but can still be translated if |
| 21 | + * needed. |
17 | 22 | */ |
18 | | - protected $mcache = null; |
| 23 | + protected $optional = array(); |
| 24 | + public function getOptional() { return $this->optional; } |
| 25 | + public function setOptional( $value ) { $this->optional = $value; } |
19 | 26 | |
20 | 27 | /** |
21 | | - * Meta groups consist of multiple groups or parts of other groups. This info |
22 | | - * is used on many places, like when creating message index. |
| 28 | + * List of messages that are always hidden and cannot be translated. |
23 | 29 | */ |
24 | | - protected $meta = false; |
| 30 | + protected $ignored = array(); |
| 31 | + public function getIgnored() { return $this->ignored; } |
| 32 | + public function setIgnored( $value ) { $this->ignored = $value; } |
25 | 33 | |
26 | 34 | /** |
27 | | - * Holds descripton of this group. |
| 35 | + * Returns a list of optional and ignored messages in 2-d array. |
28 | 36 | */ |
29 | | - protected $description = null; |
| 37 | + public function getBools() { |
| 38 | + return array( |
| 39 | + 'optional' => $this->optional, |
| 40 | + 'ignored' => $this->ignored, |
| 41 | + ); |
| 42 | + } |
30 | 43 | |
31 | 44 | /** |
32 | | - * Class name of File exporter. |
| 45 | + * Holds descripton of this group. Description is a wiki text snippet that |
| 46 | + * gives information about this group to translators. |
33 | 47 | */ |
34 | | - protected $fileExporter = null; |
| 48 | + protected $description = null; |
| 49 | + public function getDescription() { return $this->description; } |
| 50 | + public function setDescription( $value ) { $this->description = $value; } |
35 | 51 | |
36 | | - /*******/ |
37 | | - protected $mangler = null; |
38 | | - |
39 | 52 | /** |
40 | | - * Returns a human readable name of this group. |
| 53 | + * Meta groups consist of multiple groups or parts of other groups. This info |
| 54 | + * is used on many places, like when creating message index. |
41 | 55 | */ |
42 | | - public function getLabel() { return $this->label; } |
43 | | - |
44 | | - /** |
45 | | - * Returns a unique id of this group. |
46 | | - */ |
47 | | - public function getId() { return $this->id; } |
48 | | - |
49 | | - /** |
50 | | - * Returns true is this a meta group. |
51 | | - */ |
| 56 | + protected $meta = false; |
52 | 57 | public function isMeta() { return $this->meta; } |
| 58 | + public function setMeta( $value ) { $this->meta = $value; } |
53 | 59 | |
54 | 60 | /** |
55 | | - * Returns description of this group directed to translators. |
| 61 | + * To avoid key conflicts between groups or separated changed messages between |
| 62 | + * brances one can set a message key mangler. |
56 | 63 | */ |
57 | | - public function getDescription() { return $this->description; } |
| 64 | + protected $mangler = null; |
| 65 | + public function getMangler() { return $this->mangler; } |
| 66 | + public function setMangler( $value ) { $this->mangler = $value; } |
58 | 67 | |
59 | | - /** |
60 | | - * Can be used to determine if this group can be exported to a file. |
61 | | - */ |
62 | | - public function canExportToFile() { |
63 | | - return $this->fileExporter !== null; |
| 68 | + public static function factory( $label, $id ) { |
| 69 | + return null; |
64 | 70 | } |
65 | 71 | |
66 | | - /** |
67 | | - * Returns a class name of file exporter. |
68 | | - */ |
69 | | - public function getFileExporter() { |
70 | | - return new $this->fileExporter( $this ); |
| 72 | + public function getReader( $code ) { |
| 73 | + return null; |
71 | 74 | } |
72 | 75 | |
73 | | - /** |
74 | | - * In this function message group should add translations from the stored file |
75 | | - * for language code $code and it's fallback language, if used. |
76 | | - * |
77 | | - * @param $messages MessageCollection |
78 | | - */ |
79 | | - public abstract function fill( MessageCollection $messages ); |
80 | | - |
81 | | - /** |
82 | | - * In this function message group can specify some messages to be optional or |
83 | | - * ignored. |
84 | | - */ |
85 | | - public function getBools() { |
86 | | - return array( |
87 | | - 'optional' => $this->optional, |
88 | | - 'ignored' => $this->ignored, |
89 | | - ); |
| 76 | + public function getWriter() { |
| 77 | + return new SimpleFormatWriter( $this ); |
90 | 78 | } |
91 | | - protected $optional = array(); |
92 | | - protected $ignored = array(); |
93 | 79 | |
94 | | - /** |
95 | | - * In this function message group should export messages in relevant format. |
96 | | - * |
97 | | - * @param $array Reference of MessageArray. |
98 | | - */ |
99 | | - public function export( MessageCollection $messages ) { |
100 | | - return 'Not supported'; |
| 80 | + public function load( $code ) { |
| 81 | + $reader = $this->getReader( $code ); |
| 82 | + if ( $reader ) { |
| 83 | + return $reader->parseMessages( $this->mangler ); |
| 84 | + } |
101 | 85 | } |
102 | 86 | |
103 | 87 | /** |
104 | | - * In this function message group should export messages in whole-file format, |
105 | | - * if applicable. Default implementation just calls $this->export(). |
106 | | - * |
107 | | - * @param $messages MessageCollection |
108 | | - * @param $authors 1-D array of authors that have edited messages in wiki. |
109 | | - */ |
110 | | - public function exportToFile( MessageCollection $messages, $authors ) { |
111 | | - return $this->export( $messages ); |
112 | | - } |
113 | | - |
114 | | - /** |
115 | | - * This function returns array of typoe key => definition of all messages |
| 88 | + * This function returns array of type key => definition of all messages |
116 | 89 | * this message group handles. |
117 | 90 | * |
118 | 91 | * @return Array of messages definitions indexed by key. |
119 | 92 | */ |
120 | | - public abstract function getDefinitions(); |
| 93 | + public function getDefinitions() { |
| 94 | + $defs = $this->load('en'); |
| 95 | + if ( !is_array($defs) ) { |
| 96 | + throw new MWException( "Unable to load definitions for " . $this->getLabel() ); |
| 97 | + } |
| 98 | + return $defs; |
| 99 | + } |
121 | 100 | |
122 | 101 | /** |
123 | 102 | * Returns of stored translation of message specified by the $key in language |
— | — | @@ -126,71 +105,33 @@ |
127 | 106 | * @param $code Language code. |
128 | 107 | * @return Stored translation or null. |
129 | 108 | */ |
130 | | - public abstract function getMessage( $key, $code ); |
131 | | - |
132 | | - /** |
133 | | - * Returns path to the file where translation of language code $code are. |
134 | | - * |
135 | | - * @return Path to the file or false if not applicable. |
136 | | - */ |
137 | | - public function getMessageFile( $code ) { return false; } |
138 | | - |
139 | | - /** |
140 | | - * Resets the cache to free memory. |
141 | | - */ |
142 | | - public function reset() { |
143 | | - $this->mcache = array(); |
| 109 | + public function getMessage( $key, $code ) { |
| 110 | + $cache = $this->load( $code ); |
| 111 | + return isset( $cache[$key] ) ? $cache[$key] : null; |
144 | 112 | } |
145 | 113 | |
146 | 114 | /** |
147 | | - * Preprocesses MessageArray to suitable format and filters things that should |
148 | | - * not be exported. |
| 115 | + * In this function message group should add translations from the stored file |
| 116 | + * for language code $code and it's fallback language, if used. |
149 | 117 | * |
150 | | - * @param $array Reference of MessageArray. |
| 118 | + * @param $messages MessageCollection |
151 | 119 | */ |
152 | | - public function makeExportArray( MessageCollection $messages ) { |
153 | | - // We copy only relevant translations to this new array |
154 | | - $new = array(); |
155 | | - foreach( $messages as $key => $m ) { |
156 | | - $key = $this->mangler->unMangle( $key ); |
157 | | - |
158 | | - # CASE1: ignored |
159 | | - if ( $m->ignored ) continue; |
160 | | - |
161 | | - $translation = $m->translation; |
162 | | - # CASE2: no translation |
163 | | - if ( $translation === null ) continue; |
164 | | - |
165 | | - # Remove fuzzy markings before export |
166 | | - $translation = str_replace( TRANSLATE_FUZZY, '', $translation ); |
167 | | - |
168 | | - # CASE3: optional messages; accept only if different |
169 | | - if ( $m->optional && $translation === $m->definition ) continue; |
170 | | - |
171 | | - # CASE4: don't export non-translations unless translated in wiki |
172 | | - if ( !$m->pageExists && $translation === $m->definition ) continue; |
173 | | - |
174 | | - # Otherwise it's good |
175 | | - $new[$key] = $translation; |
| 120 | + function fill( MessageCollection $messages ) { |
| 121 | + $cache = $this->load( $messages->code ); |
| 122 | + foreach ( $messages->keys() as $key ) { |
| 123 | + if ( isset($cache[$key]) ) { |
| 124 | + $messages[$key]->infile = $cache[$key]; |
| 125 | + } |
176 | 126 | } |
177 | | - |
178 | | - return $new; |
179 | 127 | } |
180 | 128 | |
181 | 129 | /** |
182 | | - * Formats list of authors nicely. |
| 130 | + * Returns path to the file where translation of language code $code are. |
183 | 131 | * |
184 | | - * @param $authors List of authors |
| 132 | + * @return Path to the file or false if not applicable. |
185 | 133 | */ |
186 | | - protected function formatAuthors( $authors ) { |
187 | | - $s = array(); |
188 | | - foreach ( $authors as $a ) { |
189 | | - $s[] = " * @author $a"; |
190 | | - } |
191 | | - return implode( "\n", $s ); |
192 | | - } |
| 134 | + public function getMessageFile( $code ) { return false; } |
193 | 135 | |
194 | | - |
195 | 136 | public function __construct() { |
196 | 137 | $this->mangler = StringMatcher::emptyMatcher(); |
197 | 138 | } |
— | — | @@ -200,123 +141,67 @@ |
201 | 142 | class CoreMessageGroup extends MessageGroup { |
202 | 143 | protected $label = 'MediaWiki messages'; |
203 | 144 | protected $id = 'core'; |
204 | | - protected $fileExporter = 'CoreExporter'; |
205 | 145 | |
| 146 | + public function __construct() { |
| 147 | + parent::__construct(); |
| 148 | + global $IP; |
| 149 | + $this->prefix = $IP . '/languages/messages'; |
| 150 | + $this->metaDataPrefix = $IP . '/maintenance/language'; |
| 151 | + } |
| 152 | + |
| 153 | + |
| 154 | + protected $prefix = ''; |
| 155 | + public function getPrefix() { return $this->prefix; } |
| 156 | + public function setPrefix( $value ) { $this->prefix = $value; } |
| 157 | + |
| 158 | + protected $metaDataPrefix = ''; |
| 159 | + public function getMetaDataPrefix() { return $this->metaDataPrefix; } |
| 160 | + public function setMetaDataPrefix( $value ) { $this->metaDataPrefix = $value; } |
| 161 | + |
| 162 | + public static function factory( $label, $id ) { |
| 163 | + $group = new CoreMessageGroup; |
| 164 | + $group->setLabel( $label ); |
| 165 | + $group->setId( $id ); |
| 166 | + return $group; |
| 167 | + } |
| 168 | + |
206 | 169 | public function getMessageFile( $code ) { |
207 | 170 | $code = ucfirst( str_replace( '-', '_', $code ) ); |
208 | 171 | return "Messages$code.php"; |
209 | 172 | } |
210 | 173 | |
211 | 174 | protected function getFileLocation( $code ) { |
212 | | - return Language::getMessagesFileName( $code ); |
| 175 | + return $this->prefix . '/' . $this->getMessageFile( $code ); |
213 | 176 | } |
214 | 177 | |
215 | | - public function getMessage( $key, $code ) { |
216 | | - $messages = $this->loadMessages( $code ); |
217 | | - return isset( $messages[$key] ) ? $messages[$key] : null; |
| 178 | + public function getReader( $code ) { |
| 179 | + return new WikiFormatReader( $this->getFileLocation( $code ) ); |
218 | 180 | } |
219 | 181 | |
220 | | - function export( MessageCollection $messages ) { |
221 | | - list( $output, ) = MessageWriter::writeMessagesArray( $this->makeExportArray( $messages ), false ); |
222 | | - return $output; |
| 182 | + public function getWriter() { |
| 183 | + return new WikiFormatWriter( $this ); |
223 | 184 | } |
224 | 185 | |
225 | | - public function exportToFile( MessageCollection $messages, $authors ) { |
226 | | - $filename = $this->getFileLocation( $messages->code ); |
227 | | - |
228 | | - $messagesAsString = $this->export( $messages ); |
229 | | - $name = TranslateUtils::getLanguageName( $messages->code ); |
230 | | - $native = TranslateUtils::getLanguageName( $messages->code, true ); |
231 | | - $authors = array_unique( array_merge( $this->getAuthorsFromFile( $filename ), $authors ) ); |
232 | | - $translators = $this->formatAuthors( $authors ); |
233 | | - $other = $this->getOther( $filename ); |
234 | | - return <<<CODE |
235 | | -<?php |
236 | | -/** $name ($native) |
237 | | - * |
238 | | - * @ingroup Language |
239 | | - * @file |
240 | | - * |
241 | | -$translators |
242 | | - */ |
243 | | - |
244 | | -$other |
245 | | - |
246 | | -$messagesAsString |
247 | | -CODE; |
248 | | - } |
249 | | - |
250 | | - function getDefinitions() { |
251 | | - return $this->loadMessages( 'en' ); |
252 | | - } |
253 | | - |
254 | 186 | public function getBools() { |
255 | | - $l = new languages(); |
| 187 | + require( $this->getMetaDataPrefix() . '/messageTypes.inc' ); |
256 | 188 | return array( |
257 | | - 'optional' => $this->mangler->mangle( $l->getOptionalMessages() ), |
258 | | - 'ignored' => $this->mangler->mangle( $l->getIgnoredMessages() ), |
| 189 | + 'optional' => $this->mangler->mangle( $wgOptionalMessages ), |
| 190 | + 'ignored' => $this->mangler->mangle( $wgIgnoredMessages ), |
259 | 191 | ); |
260 | 192 | } |
261 | 193 | |
262 | | - protected function loadMessages( $code ) { |
263 | | - if ( !isset($this->mcache[$code]) ) { |
264 | | - $file = $this->getFileLocation( $code ); |
265 | | - $this->mcache[$code] = $this->mangler->mangle( |
266 | | - ResourceLoader::loadVariableFromPHPFile( $file, 'messages' ) |
267 | | - ); |
268 | | - } |
269 | | - return $this->mcache[$code]; |
| 194 | + public function load( $code ) { |
| 195 | + $file = $this->getFileLocation( $code ); |
| 196 | + return $this->mangler->mangle( |
| 197 | + ResourceLoader::loadVariableFromPHPFile( $file, 'messages' ) |
| 198 | + ); |
270 | 199 | } |
271 | 200 | |
272 | | - public function fill( MessageCollection $messages ) { |
273 | | - $infile = $this->loadMessages( $messages->code ); |
274 | | - $infbfile = null; |
275 | | - if ( Language::getFallbackFor( $messages->code ) ) { |
276 | | - $infbfile = $this->loadMessages( Language::getFallbackFor( $messages->code ) ); |
277 | | - } |
278 | | - |
279 | | - foreach ( $messages->keys() as $key ) { |
280 | | - if ( isset($infile[$key]) ) { |
281 | | - $messages[$key]->infile = $infile[$key]; |
282 | | - } |
283 | | - } |
284 | | - } |
285 | | - |
286 | | - /** |
287 | | - * Reads all \@author tags from the file and returns array of authors. |
288 | | - * |
289 | | - * @param $filename From which file to get the authors. |
290 | | - * @return Array of authors. |
291 | | - */ |
292 | | - private function getAuthorsFromFile( $filename ) { |
293 | | - if ( !file_exists( $filename ) ) { return array(); } |
294 | | - $contents = file_get_contents( $filename ); |
295 | | - $m = array(); |
296 | | - $count = preg_match_all( '/@author (.*)/', $contents, $m ); |
297 | | - return $m[1]; |
298 | | - } |
299 | | - |
300 | | - private function getOther( $filename ) { |
301 | | - if ( !file_exists( $filename ) ) { return ''; } |
302 | | - $contents = file_get_contents( $filename ); |
303 | | - |
304 | | - /** FIXME: handle the case where the first comment is missing */ |
305 | | - $dollarstart = strpos( $contents, '$' ); |
306 | | - |
307 | | - $start = strpos( $contents, '*/' ); |
308 | | - $end = strpos( $contents, '$messages' ); |
309 | | - if ( $start === false ) return ''; |
310 | | - if ( $start === $end ) return ''; |
311 | | - $start += 2; // Get over the comment ending |
312 | | - if ( $end === false ) return trim( substr( $contents, $start ) ); |
313 | | - return trim( substr( $contents, $start, $end-$start ) ); |
314 | | - } |
315 | 201 | } |
316 | 202 | |
317 | 203 | class BranchedCoreMessageGroup extends CoreMessageGroup { |
318 | 204 | protected $label = 'MediaWiki messages ($1)'; |
319 | 205 | protected $id = 'core-$1'; |
320 | | - protected $fileExporter = 'CoreExporter'; |
321 | 206 | protected $path = '__BUG__'; |
322 | 207 | protected $meta = true; |
323 | 208 | protected $metaDataPath = '__BUG__'; |
— | — | @@ -326,261 +211,87 @@ |
327 | 212 | $this->label = str_replace( '$1', $branch, $this->label ); |
328 | 213 | $this->id = Sanitizer::escapeId( str_replace( '$1', $branch, $this->id ) ); |
329 | 214 | $this->mangler = $mangler; |
330 | | - $this->metaDataPath = $path . '/maintenance/language'; |
| 215 | + $this->prefix = $path . '/languages/messages'; |
| 216 | + $this->metaDataPrefix = $path . '/maintenance/language'; |
331 | 217 | } |
332 | 218 | |
333 | | - protected function getFileLocation( $code ) { |
334 | | - return $this->path . '/languages/messages/' . $this->getMessageFile( $code ); |
335 | | - } |
336 | | - |
337 | 219 | public function setMetaDataPath( $path ) { |
338 | | - $this->metaDataPath = $path; |
| 220 | + $this->prefix = $path . '/languages/messages'; |
| 221 | + $this->metaDataPrefix = $path . '/maintenance/language'; |
339 | 222 | } |
340 | | - |
341 | | - public function getBools() { |
342 | | - require( $this->metaDataPath . '/messageTypes.inc' ); |
343 | | - return array( |
344 | | - 'optional' => $this->mangler->mangle( $wgOptionalMessages ), |
345 | | - 'ignored' => $this->mangler->mangle( $wgIgnoredMessages ), |
346 | | - ); |
347 | | - } |
348 | | - |
349 | | - public function export( MessageCollection $messages ) { |
350 | | - list( $output, ) = MessageWriter::writeMessagesArray( $this->makeExportArray( $messages ), false, $this->metaDataPath ); |
351 | | - return $output; |
352 | | - } |
353 | | - |
354 | 223 | } |
355 | 224 | |
356 | | -abstract class ExtensionMessageGroup extends MessageGroup { |
357 | | - protected $fileExporter = 'StandardExtensionExporter'; |
| 225 | +class ExtensionMessageGroup extends MessageGroup { |
358 | 226 | /** |
359 | 227 | * Name of the array where all messages are stored, if applicable. |
360 | 228 | */ |
361 | | - protected $arrName = false; |
| 229 | + protected $arrName = 'messages'; |
| 230 | + public function getVariableName() { return $this->arrName; } |
| 231 | + public function setVariableName( $value ) { $this->arrName = $value; } |
| 232 | + |
362 | 233 | /** |
363 | | - * Name of the function which returns all messages, if applicable. |
364 | | - */ |
365 | | - protected $functionName = false; |
366 | | - /** |
367 | 234 | * Path to the file where array or function is defined, relative to extensions |
368 | | - * root directory. |
| 235 | + * root directory defined by $wgTranslateExtensionDirectory. |
369 | 236 | */ |
370 | 237 | protected $messageFile = null; |
| 238 | + public function getMessageFile( $code ) { return $this->messageFile; } |
| 239 | + public function setMessageFile( $value ) { $this->messageFile = $value; } |
371 | 240 | |
372 | | - /** |
373 | | - * The syntax of array definition. $ARRAY is replaced with $this->arrName and |
374 | | - * $CODE is replaced with exported language. |
375 | | - */ |
376 | | - protected $exportStart = '$$ARRAY[\'$CODE\'] = array('; |
377 | | - /** |
378 | | - * The syntax of array closure. |
379 | | - */ |
380 | | - protected $exportEnd = ');'; |
381 | | - protected $exportPrefix= ''; |
382 | | - protected $exportLineP = "\t"; |
| 241 | + public static function factory( $label, $id ) { |
| 242 | + $group = new ExtensionMessageGroup; |
| 243 | + $group->setLabel( $label ); |
| 244 | + $group->setId( $id ); |
| 245 | + return $group; |
| 246 | + } |
383 | 247 | |
384 | 248 | /* |
385 | 249 | * Append (mw ext) to extension labels. This doesn't break sorting. |
386 | 250 | */ |
387 | 251 | public function getLabel() { return $this->label . " (mw ext)"; } |
388 | 252 | |
389 | | - public function getMessageFile( $code ) { return $this->messageFile; } |
390 | | - |
391 | | - public function getVariableName() { |
392 | | - return $this->arrName ? $this->arrName : 'messages'; |
393 | | - } |
394 | | - |
395 | | - public function getMessage( $key, $code ) { |
396 | | - $this->load( $code ); |
397 | | - return isset( $this->mcache[$code][$key] ) ? $this->mcache[$code][$key] : null; |
398 | | - } |
399 | | - |
400 | 253 | /** |
401 | 254 | * This function loads messages for given language for further use. |
402 | 255 | * |
403 | 256 | * @param $code Language code |
404 | 257 | * @throws MWException If loading fails. |
405 | 258 | */ |
406 | | - protected function load( $code ) { |
407 | | - // Check if we have already loaded all messages |
408 | | - if ( isset($this->mcache['en']) ) return; |
409 | | - |
410 | | - // If not, load them now |
411 | | - $cache = $this->loadMessages( $code ); |
| 259 | + public function load( $code ) { |
| 260 | + $reader = $this->getReader( $code ); |
| 261 | + $cache = $reader->parseMessages( $this->mangler ); |
412 | 262 | if ( $cache === null ) { |
413 | 263 | throw new MWException( "Unable to load messages for $code in {$this->label}" ); |
414 | 264 | } |
415 | | - $this->mcache = $cache; |
| 265 | + if ( isset($cache[$code]) ) { |
| 266 | + return $cache[$code]; |
| 267 | + } else { |
| 268 | + return null; |
| 269 | + } |
416 | 270 | } |
417 | 271 | |
418 | 272 | protected function getPath( $code ) { |
419 | 273 | global $wgTranslateExtensionDirectory; |
420 | | - if ( $this->messageFile ) { |
421 | | - $fullPath = $wgTranslateExtensionDirectory . $this->messageFile; |
| 274 | + if ( $this->getMessageFile( $code ) ) { |
| 275 | + $fullPath = $wgTranslateExtensionDirectory . $this->getMessageFile( $code ); |
422 | 276 | } else { |
423 | 277 | throw new MWException( 'Message file not defined' ); |
424 | 278 | } |
425 | 279 | return $fullPath; |
426 | 280 | } |
427 | 281 | |
428 | | - /** |
429 | | - * This function is a wrapper which calls the real loader depending on which |
430 | | - * kind of structure the messages are in this extension. |
431 | | - * |
432 | | - * @param $code Language code of messages to be loaded. |
433 | | - * @returns Array |
434 | | - */ |
435 | | - protected function loadMessages( $code ) { |
436 | | - $path = $this->getPath( $code ); |
437 | | - |
438 | | - if ( $this->arrName ) { |
439 | | - return $this->loadFromVariable( $path ); |
440 | | - } elseif ( $this->functionName ) { |
441 | | - return $this->loadFromFunction( $path ); |
442 | | - } |
| 282 | + public function getReader( $code ) { |
| 283 | + $reader = new WikiExtensionFormatReader( $this->getPath( $code ) ); |
| 284 | + $reader->variableName = $this->getVariableName(); |
| 285 | + return $reader; |
443 | 286 | } |
444 | 287 | |
445 | | - /** |
446 | | - * This function loads a variable from given php file and returns it. |
447 | | - * |
448 | | - * @param $path Path to php file that is passed to include(). |
449 | | - * @return Contents of the variable or null if it is not set or file does not |
450 | | - * exist. |
451 | | - */ |
452 | | - private function loadFromVariable( $path ) { |
453 | | - if ( file_exists( $path ) ) { |
454 | | - include( $path ); |
455 | | - if ( isset( ${$this->arrName} ) ) { |
456 | | - return ${$this->arrName}; |
457 | | - } |
458 | | - } |
459 | | - |
460 | | - return null; |
| 288 | + public function getWriter() { |
| 289 | + $writer = new WikiExtensionFormatWriter( $this ); |
| 290 | + $writer->variableName = $this->getVariableName(); |
| 291 | + return $writer; |
461 | 292 | } |
462 | 293 | |
463 | | - /** |
464 | | - * This function includes the file given in $path if needed, and calls the |
465 | | - * defined function and returns it return value. |
466 | | - * |
467 | | - * @param $path Path to php file that is passed to include(). |
468 | | - * @return Return value of the function or null if the function is not defined |
469 | | - * or file does not exist. |
470 | | - */ |
471 | | - private function loadFromFunction( $path ) { |
472 | | - // Try first calling it directly |
473 | | - if ( function_exists( $this->functionName ) ) { |
474 | | - return call_user_func( $this->functionName ); |
475 | | - } elseif ( file_exists( $path ) ) { |
476 | | - include( $path ); |
477 | | - if ( function_exists( $this->functionName ) ) { |
478 | | - return call_user_func( $this->functionName ); |
479 | | - } |
480 | | - } |
481 | | - |
482 | | - return null; |
483 | | - } |
484 | | - |
485 | | - function export( MessageCollection $messages ) { |
486 | | - // Replace variables from definition |
487 | | - $txt = $this->exportPrefix . str_replace( |
488 | | - array( '$ARRAY', '$CODE' ), |
489 | | - array( $this->arrName, $messages->code ), |
490 | | - $this->exportStart ) . "\n"; |
491 | | - |
492 | | - // Use the same function that rebuildLanguage.php uses |
493 | | - $txt .= MessageWriter::writeMessagesBlock( false, |
494 | | - $this->makeExportArray( $messages ), array(), $this->exportLineP |
495 | | - ); |
496 | | - |
497 | | - // Remove the last newline, not needed here |
498 | | - $txt = substr( $txt, 0, -1 ); |
499 | | - // But actually needed here |
500 | | - $txt .= $this->exportPrefix . $this->exportEnd . "\n"; |
501 | | - |
502 | | - return $txt; |
503 | | - } |
504 | | - |
505 | | - public function exportToFile( MessageCollection $messages, $authors ) { |
506 | | - $x = $this->export( $messages ); |
507 | | - $name = TranslateUtils::getLanguageName( $messages->code ); |
508 | | - $native = TranslateUtils::getLanguageName( $messages->code, true ); |
509 | | - $translators = $this->formatAuthors( $authors ); |
510 | | - if ( $translators !== '' ) { |
511 | | - $translators = "\n$translators\n"; |
512 | | - } |
513 | | - return <<<CODE |
514 | | -/** $name ($native)$translators */ |
515 | | -$x |
516 | | -CODE; |
517 | | - } |
518 | | - |
519 | | - function getDefinitions() { |
520 | | - $this->load( 'en' ); |
521 | | - return $this->mcache['en']; |
522 | | - } |
523 | | - |
524 | | - public function fill( MessageCollection $messages ) { |
525 | | - $this->load( $messages->code ); |
526 | | - |
527 | | - $fbcode = Language::getFallbackFor( $messages->code ); |
528 | | - if ( $fbcode ) { |
529 | | - $this->load( $fbcode ); |
530 | | - } |
531 | | - |
532 | | - foreach ( $messages->keys() as $key ) { |
533 | | - if ( isset($this->mcache[$messages->code][$key]) ) { |
534 | | - $messages[$key]->infile = $this->mcache[$messages->code][$key]; |
535 | | - } |
536 | | - if ( isset($this->mcache[$fbcode][$key]) ) { |
537 | | - $messages[$key]->fallback = $this->mcache[$fbcode][$key]; |
538 | | - } |
539 | | - } |
540 | | - } |
541 | | - |
542 | 294 | } |
543 | 295 | |
544 | | -class MultipleFileMessageGroup extends ExtensionMessageGroup { |
545 | | - protected $fileExporter = null; |
546 | | - protected $filePattern = false; |
547 | | - |
548 | | - public function getMessageFile( $code ) { |
549 | | - return str_replace( '$CODE', $code, $this->filePattern ); |
550 | | - } |
551 | | - |
552 | | - protected function load( $code ) { |
553 | | - if ( isset($this->mcache[$code]) ) return; |
554 | | - $cache = $this->loadMessages( $code ); |
555 | | - if ( $cache === null ) { |
556 | | - if ( $code === 'en' ) { |
557 | | - throw new MWException( "Unable to load messages for $code in {$this->label}" ); |
558 | | - } else { |
559 | | - $cache = array(); |
560 | | - } |
561 | | - } |
562 | | - $this->mcache[$code] = $cache; |
563 | | - } |
564 | | - |
565 | | - protected function getPath( $code ) { |
566 | | - // Many extensions use non-regular filename for english messages. We use the |
567 | | - // single filename for that. |
568 | | - if ( $code === 'en' ) { |
569 | | - return parent::getPath( 'en' ); |
570 | | - } |
571 | | - |
572 | | - // And for other files we use pattern, where $CODE is replaced with language |
573 | | - // code. |
574 | | - global $wgTranslateExtensionDirectory; |
575 | | - $fullPath = false; |
576 | | - if ( $this->filePattern ) { |
577 | | - $filename = str_replace( '$CODE', $code, $this->filePattern ); |
578 | | - $fullPath = $wgTranslateExtensionDirectory . $filename; |
579 | | - } |
580 | | - return $fullPath; |
581 | | - } |
582 | | - |
583 | | -} |
584 | | - |
585 | 296 | class CoreMostUsedMessageGroup extends CoreMessageGroup { |
586 | 297 | protected $fileExporter = null; |
587 | 298 | protected $label = 'MediaWiki messages (most used)'; |
— | — | @@ -627,15 +338,11 @@ |
628 | 339 | } |
629 | 340 | } |
630 | 341 | |
631 | | - protected function load( $code ) { |
632 | | - $this->init(); |
633 | | - foreach ( $this->classes as $class ) { |
634 | | - $class->load( $code ); |
635 | | - } |
| 342 | + public function load( $code ) { |
| 343 | + return null; // no-op |
636 | 344 | } |
637 | 345 | |
638 | 346 | public function getMessage( $key, $code ) { |
639 | | - $this->load( $code ); |
640 | 347 | $msg = null; |
641 | 348 | foreach ( $this->classes as $class ) { |
642 | 349 | $msg = $class->getMessage( $key, $code ); |
— | — | @@ -653,26 +360,6 @@ |
654 | 361 | return $array; |
655 | 362 | } |
656 | 363 | |
657 | | - function export( MessageCollection $messages ) { |
658 | | - $this->init(); |
659 | | - $ret = ''; |
660 | | - foreach ( $this->classes as $class ) { |
661 | | - $subCollection = $messages->intersect_key( $class->getDefinitions() ); |
662 | | - $ret .= $class->export( $subCollection ) . "\n\n\n"; |
663 | | - } |
664 | | - return $ret; |
665 | | - } |
666 | | - |
667 | | - function exportToFile( MessageCollection $messages, $authors ) { |
668 | | - $this->init(); |
669 | | - $ret = ''; |
670 | | - foreach ( $this->classes as $class ) { |
671 | | - $subCollection = $messages->intersect_key( $class->getDefinitions() ); |
672 | | - $ret .= $class->exportToFile( $subCollection, array() ) . "\n\n\n"; |
673 | | - } |
674 | | - return $ret; |
675 | | - } |
676 | | - |
677 | 364 | function fill( MessageCollection $messages ) { |
678 | 365 | $this->init(); |
679 | 366 | foreach ( $this->classes as $class ) { |
— | — | @@ -684,17 +371,14 @@ |
685 | 372 | $this->init(); |
686 | 373 | $bools = array(); |
687 | 374 | foreach ( $this->classes as $class ) { |
688 | | - $bools = array_merge_recursive( $bools, $class->getBools() ); |
| 375 | + $newbools = ( $class->getBools() ); |
| 376 | + if ( count($newbools['optional']) || count($newbools['ignored']) ) { |
| 377 | + $bools = array_merge_recursive( $bools, $class->getBools() ); |
| 378 | + } |
689 | 379 | } |
690 | 380 | return $bools; |
691 | 381 | } |
692 | 382 | |
693 | | - public function reset() { |
694 | | - foreach ( $this->classes as $class ) { |
695 | | - $class->reset(); |
696 | | - } |
697 | | - } |
698 | | - |
699 | 383 | } |
700 | 384 | |
701 | 385 | class AllWikimediaExtensionsGroup extends AllMediawikiExtensionsGroup { |
— | — | @@ -767,2022 +451,22 @@ |
768 | 452 | |
769 | 453 | protected function init() { |
770 | 454 | if ( $this->classes === null ) { |
771 | | - $this->classes = MessageGroups::singleton()->getGroups(); |
772 | | - $this->classes = array_intersect_key( |
773 | | - $this->classes, |
774 | | - array_flip( $this->wmfextensions ) |
775 | | - ); |
| 455 | + $this->classes = array(); |
| 456 | + $classes = MessageGroups::singleton()->getGroups(); |
| 457 | + foreach ( $this->wmfextensions as $key ) { |
| 458 | + $this->classes[$key] = $classes[$key]; |
| 459 | + } |
776 | 460 | } |
777 | 461 | } |
778 | 462 | } |
779 | 463 | |
780 | | -class AbsenteeLandlordMessageGroup extends ExtensionMessageGroup { |
781 | | - protected $label = 'Absentee Landlord'; |
782 | | - protected $id = 'ext-absenteelandlord'; |
783 | | - |
784 | | - protected $arrName = 'messages'; |
785 | | - protected $messageFile = 'AbsenteeLandlord/AbsenteeLandlord.i18n.php'; |
786 | | -} |
787 | | - |
788 | | -class AdvancedRandomMessageGroup extends ExtensionMessageGroup { |
789 | | - protected $label = 'Advanced Random'; |
790 | | - protected $id = 'ext-advancedrandom'; |
791 | | - |
792 | | - protected $arrName = 'messages'; |
793 | | - protected $messageFile = 'AdvancedRandom/SpecialAdvancedRandom.i18n.php'; |
794 | | -} |
795 | | - |
796 | | -class AjaxQueryPagesMessageGroup extends ExtensionMessageGroup { |
797 | | - protected $label = 'Ajax Query Pages'; |
798 | | - protected $id = 'ext-ajaxquerypages'; |
799 | | - |
800 | | - protected $arrName = 'messages'; |
801 | | - protected $messageFile = 'AjaxQueryPages/AjaxQueryPages.i18n.php'; |
802 | | -} |
803 | | - |
804 | | -class AjaxShowEditorsMessageGroup extends ExtensionMessageGroup { |
805 | | - protected $label = 'Ajax Show Editors'; |
806 | | - protected $id = 'ext-ajaxshoweditors'; |
807 | | - |
808 | | - protected $arrName = 'messages'; |
809 | | - protected $messageFile = 'AjaxShowEditors/AjaxShowEditors.i18n.php'; |
810 | | -} |
811 | | - |
812 | | -class AntiBotMessageGroup extends ExtensionMessageGroup { |
813 | | - protected $label = 'Anti Bot'; |
814 | | - protected $id = 'ext-antibot'; |
815 | | - |
816 | | - protected $arrName = 'messages'; |
817 | | - protected $messageFile = 'AntiBot/AntiBot.i18n.php'; |
818 | | -} |
819 | | - |
820 | | -class AntiSpoofMessageGroup extends ExtensionMessageGroup { |
821 | | - protected $label = 'Anti Spoof'; |
822 | | - protected $id = 'ext-antispoof'; |
823 | | - |
824 | | - protected $arrName = 'messages'; |
825 | | - protected $messageFile = 'AntiSpoof/AntiSpoof.i18n.php'; |
826 | | -} |
827 | | - |
828 | | -class ApcMessageGroup extends ExtensionMessageGroup { |
829 | | - protected $label = 'APC'; |
830 | | - protected $id = 'ext-apc'; |
831 | | - |
832 | | - protected $arrName = 'messages'; |
833 | | - protected $messageFile = 'APC/ViewAPC.i18n.php'; |
834 | | -} |
835 | | - |
836 | | -class AsksqlMessageGroup extends ExtensionMessageGroup { |
837 | | - protected $label = 'Asksql'; |
838 | | - protected $id = 'ext-asksql'; |
839 | | - |
840 | | - protected $arrName = 'messages'; |
841 | | - protected $messageFile = 'Asksql/Asksql.i18n.php'; |
842 | | -} |
843 | | - |
844 | | -class AssertEditMessageGroup extends ExtensionMessageGroup { |
845 | | - protected $label = 'Assert Edit'; |
846 | | - protected $id = 'ext-assertedit'; |
847 | | - |
848 | | - protected $arrName = 'messages'; |
849 | | - protected $messageFile = 'AssertEdit/AssertEdit.i18n.php'; |
850 | | -} |
851 | | - |
852 | | -class AuthorProtectMessageGroup extends ExtensionMessageGroup { |
853 | | - protected $label = 'Author Protect'; |
854 | | - protected $id = 'ext-authorprotect'; |
855 | | - |
856 | | - protected $arrName = 'messages'; |
857 | | - protected $messageFile = 'AuthorProtect/AuthorProtect.i18n.php'; |
858 | | -} |
859 | | - |
860 | | -class BabelMessageGroup extends ExtensionMessageGroup { |
861 | | - protected $label = 'Babel'; |
862 | | - protected $id = 'ext-babel'; |
863 | | - |
864 | | - protected $arrName = 'messages'; |
865 | | - protected $messageFile = 'Babel/Babel.i18n.php'; |
866 | | - |
867 | | - protected $ignored = array( |
868 | | - 'babel-box-cellspacing', |
869 | | - 'babel-category-prefix', |
870 | | - 'babel-category-suffix', |
871 | | - 'babel-portal-prefix', |
872 | | - 'babel-portal-suffix', |
873 | | - 'babel-template-prefix', |
874 | | - 'babel-template-suffix', |
875 | | - ); |
876 | | - protected $optional = array( |
877 | | - 'babel-0-female', |
878 | | - 'babel-1-female', |
879 | | - 'babel-2-female', |
880 | | - 'babel-3-female', |
881 | | - 'babel-4-female', |
882 | | - 'babel-5-female', |
883 | | - 'babel-N-female', |
884 | | - 'babel-0-n-female', |
885 | | - 'babel-1-n-female', |
886 | | - 'babel-2-n-female', |
887 | | - 'babel-3-n-female', |
888 | | - 'babel-4-n-female', |
889 | | - 'babel-5-n-female', |
890 | | - 'babel-N-n-female', |
891 | | - 'babel-0-male', |
892 | | - 'babel-1-male', |
893 | | - 'babel-2-male', |
894 | | - 'babel-3-male', |
895 | | - 'babel-4-male', |
896 | | - 'babel-5-male', |
897 | | - 'babel-N-male', |
898 | | - 'babel-0-n-male', |
899 | | - 'babel-1-n-male', |
900 | | - 'babel-2-n-male', |
901 | | - 'babel-3-n-male', |
902 | | - 'babel-4-n-male', |
903 | | - 'babel-5-n-male', |
904 | | - 'babel-N-n-male', |
905 | | - ); |
906 | | -} |
907 | | - |
908 | | -class BackAndForthMessageGroup extends ExtensionMessageGroup { |
909 | | - protected $label = 'Back and Forth'; |
910 | | - protected $id = 'ext-backandforth'; |
911 | | - |
912 | | - protected $arrName = 'messages'; |
913 | | - protected $messageFile = 'BackAndForth/BackAndForth.i18n.php'; |
914 | | -} |
915 | | - |
916 | | -class BadImageMessageGroup extends ExtensionMessageGroup { |
917 | | - protected $label = 'Bad Image'; |
918 | | - protected $id = 'ext-badimage'; |
919 | | - |
920 | | - protected $arrName = 'messages'; |
921 | | - protected $messageFile = 'BadImage/BadImage.i18n.php'; |
922 | | -} |
923 | | - |
924 | | -class BlahtexMessageGroup extends ExtensionMessageGroup { |
925 | | - protected $label = 'Blahtex'; |
926 | | - protected $id = 'ext-blahtex'; |
927 | | - |
928 | | - protected $arrName = 'messages'; |
929 | | - protected $messageFile = 'Blahtex/Blahtex.i18n.php'; |
930 | | -} |
931 | | - |
932 | | -class BlockTitlesMessageGroup extends ExtensionMessageGroup { |
933 | | - protected $label = 'Block Titles'; |
934 | | - protected $id = 'ext-blocktitles'; |
935 | | - |
936 | | - protected $arrName = 'messages'; |
937 | | - protected $messageFile = 'BlockTitles/BlockTitles.i18n.php'; |
938 | | -} |
939 | | - |
940 | | -class BoardVoteMessageGroup extends ExtensionMessageGroup { |
941 | | - protected $label = 'Board Vote'; |
942 | | - protected $id = 'ext-boardvote'; |
943 | | - |
944 | | - protected $arrName = 'messages'; |
945 | | - protected $messageFile = 'BoardVote/BoardVote.i18n.php'; |
946 | | - |
947 | | - protected $ignored = array( 'boardvote_footer' ); |
948 | | -} |
949 | | - |
950 | | -class BookInformationMessageGroup extends ExtensionMessageGroup { |
951 | | - protected $label = 'Book Information'; |
952 | | - protected $id = 'ext-bookinformation'; |
953 | | - |
954 | | - protected $arrName = 'messages'; |
955 | | - protected $messageFile = 'BookInformation/BookInformation.i18n.php'; |
956 | | -} |
957 | | - |
958 | | -class BreadCrumbsMessageGroup extends ExtensionMessageGroup { |
959 | | - protected $label = 'Breadcrumbs navigation'; |
960 | | - protected $id = 'ext-breadcrumbs'; |
961 | | - |
962 | | - protected $arrName = 'messages'; |
963 | | - protected $messageFile = 'BreadCrumbs/BreadCrumbs.i18n.php'; |
964 | | -} |
965 | | - |
966 | | -class CallMessageGroup extends ExtensionMessageGroup { |
967 | | - protected $label = 'Call'; |
968 | | - protected $id = 'ext-call'; |
969 | | - |
970 | | - protected $arrName = 'messages'; |
971 | | - protected $messageFile = 'Call/Call.i18n.php'; |
972 | | -} |
973 | | - |
974 | | -class CategoryIntersectionMessageGroup extends ExtensionMessageGroup { |
975 | | - protected $label = 'Category Intersection'; |
976 | | - protected $id = 'ext-categoryintersection'; |
977 | | - |
978 | | - protected $arrName = 'messages'; |
979 | | - protected $messageFile = 'CategoryIntersection/CategoryIntersection.i18n.php'; |
980 | | -} |
981 | | - |
982 | | -class CategoryStepperMessageGroup extends ExtensionMessageGroup { |
983 | | - protected $label = 'Category Stepper'; |
984 | | - protected $id = 'ext-categorystepper'; |
985 | | - |
986 | | - protected $arrName = 'messages'; |
987 | | - protected $messageFile = 'CategoryStepper/CategoryStepper.i18n.php'; |
988 | | - |
989 | | - protected $ignored = array( 'categorystepper' ); |
990 | | -} |
991 | | - |
992 | | -class CategoryTreeMessageGroup extends ExtensionMessageGroup { |
993 | | - protected $label = 'Category Tree'; |
994 | | - protected $id = 'ext-categorytree'; |
995 | | - |
996 | | - protected $arrName = 'messages'; |
997 | | - protected $messageFile = 'CategoryTree/CategoryTree.i18n.php'; |
998 | | -} |
999 | | - |
1000 | | -class CatFeedMessageGroup extends ExtensionMessageGroup { |
1001 | | - protected $label = 'Category Feed'; |
1002 | | - protected $id = 'ext-catfeed'; |
1003 | | - |
1004 | | - protected $arrName = 'messages'; |
1005 | | - protected $messageFile = 'catfeed/catfeed.i18n.php'; |
1006 | | -} |
1007 | | - |
1008 | | -class CentralAuthMessageGroup extends ExtensionMessageGroup { |
1009 | | - protected $label = 'Central Auth'; |
1010 | | - protected $id = 'ext-centralauth'; |
1011 | | - |
1012 | | - protected $arrName = 'messages'; |
1013 | | - protected $messageFile = 'CentralAuth/CentralAuth.i18n.php'; |
1014 | | -} |
1015 | | - |
1016 | | -class CentralNoticeMessageGroup extends ExtensionMessageGroup { |
1017 | | - protected $label = 'Central Notice'; |
1018 | | - protected $id = 'ext-centralnotice'; |
1019 | | - |
1020 | | - protected $arrName = 'messages'; |
1021 | | - protected $messageFile = 'CentralNotice/CentralNotice.i18n.php'; |
1022 | | -} |
1023 | | - |
1024 | | -class ChangeAuthorMessageGroup extends ExtensionMessageGroup { |
1025 | | - protected $label = 'Change Author'; |
1026 | | - protected $id = 'ext-changeauthor'; |
1027 | | - |
1028 | | - protected $arrName = 'messages'; |
1029 | | - protected $messageFile = 'ChangeAuthor/ChangeAuthor.i18n.php'; |
1030 | | - |
1031 | | - protected $optional = array( |
1032 | | - 'changeauthor-rev', |
1033 | | - ); |
1034 | | - protected $ignored = array( |
1035 | | - 'changeauthor-short', |
1036 | | - 'changeauthor-logpagetext' |
1037 | | - ); |
1038 | | -} |
1039 | | - |
1040 | | -class CharInsertMessageGroup extends ExtensionMessageGroup { |
1041 | | - protected $label = 'CharInsert'; |
1042 | | - protected $id = 'ext-charinsert'; |
1043 | | - |
1044 | | - protected $arrName = 'messages'; |
1045 | | - protected $messageFile = 'CharInsert/CharInsert.i18n.php'; |
1046 | | -} |
1047 | | - |
1048 | | -class CheckUserMessageGroup extends ExtensionMessageGroup { |
1049 | | - protected $label = 'Check User'; |
1050 | | - protected $id = 'ext-checkuser'; |
1051 | | - |
1052 | | - protected $arrName = 'messages'; |
1053 | | - protected $messageFile = 'CheckUser/CheckUser.i18n.php'; |
1054 | | -} |
1055 | | - |
1056 | | -class ChemFunctionsMessageGroup extends ExtensionMessageGroup { |
1057 | | - protected $label = 'Chemistry'; |
1058 | | - protected $id = 'ext-chemistry'; |
1059 | | - |
1060 | | - protected $arrName = 'messages'; |
1061 | | - protected $messageFile = 'Chemistry/ChemFunctions.i18n.php'; |
1062 | | - |
1063 | | - protected $ignored = array( 'chemFunctions_SearchExplanation' ); |
1064 | | - protected $optional = array( |
1065 | | - 'chemFunctions_EINECS', |
1066 | | - 'chemFunctions_CHEBI', |
1067 | | - 'chemFunctions_PubChem', |
1068 | | - 'chemFunctions_SMILES', |
1069 | | - 'chemFunctions_InChI', |
1070 | | - 'chemFunctions_RTECS', |
1071 | | - 'chemFunctions_KEGG', |
1072 | | - 'chemFunctions_DrugBank', |
1073 | | - ); |
1074 | | -} |
1075 | | - |
1076 | | -class CiteMessageGroup extends ExtensionMessageGroup { |
1077 | | - protected $label = 'Cite'; |
1078 | | - protected $id = 'ext-cite'; |
1079 | | - |
1080 | | - protected $arrName = 'messages'; |
1081 | | - protected $messageFile = 'Cite/Cite.i18n.php'; |
1082 | | - |
1083 | | - protected $optional = array( |
1084 | | - 'cite_reference_link_key_with_num', |
1085 | | - 'cite_reference_link_prefix', |
1086 | | - 'cite_reference_link_suffix', |
1087 | | - 'cite_references_link_prefix', |
1088 | | - 'cite_references_link_suffix', |
1089 | | - 'cite_reference_link', |
1090 | | - 'cite_references_link_one', |
1091 | | - 'cite_references_link_many', |
1092 | | - 'cite_references_link_many_format', |
1093 | | - 'cite_references_link_many_format_backlink_labels', |
1094 | | - 'cite_references_link_many_sep', |
1095 | | - 'cite_references_link_many_and', |
1096 | | - ); |
1097 | | - protected $ignored = array( |
1098 | | - 'cite_references_prefix', |
1099 | | - 'cite_references_suffix', |
1100 | | - ); |
1101 | | -} |
1102 | | - |
1103 | | -class CiteSpecialMessageGroup extends ExtensionMessageGroup { |
1104 | | - protected $label = 'Cite (special page)'; |
1105 | | - protected $id = 'ext-citespecial'; |
1106 | | - |
1107 | | - protected $arrName = 'messages'; |
1108 | | - protected $messageFile = 'Cite/SpecialCite.i18n.php'; |
1109 | | - |
1110 | | - protected $ignored = array( |
1111 | | - 'cite_text', |
1112 | | - ); |
1113 | | -} |
1114 | | - |
1115 | | -class CleanChangesMessageGroup extends ExtensionMessageGroup { |
1116 | | - protected $label = 'Clean changes'; |
1117 | | - protected $id = 'ext-cleanchanges'; |
1118 | | - |
1119 | | - protected $arrName = 'messages'; |
1120 | | - protected $messageFile = 'CleanChanges/CleanChanges.i18n.php'; |
1121 | | -} |
1122 | | - |
1123 | | -class CollectionMessageGroup extends ExtensionMessageGroup { |
1124 | | - protected $label = 'Collection'; |
1125 | | - protected $id = 'ext-collection'; |
1126 | | - |
1127 | | - protected $arrName = 'messages'; |
1128 | | - protected $messageFile = 'Collection/Collection.i18n.php'; |
1129 | | -} |
1130 | | - |
1131 | | -class CommentPagesMessageGroup extends ExtensionMessageGroup { |
1132 | | - protected $label = 'Comment Pages'; |
1133 | | - protected $id = 'ext-commentpages'; |
1134 | | - |
1135 | | - protected $arrName = 'messages'; |
1136 | | - protected $messageFile = 'CommentPages/CommentPages.i18n.php'; |
1137 | | - |
1138 | | - protected $ignored = array( |
1139 | | - 'commenttab-editintro', |
1140 | | - 'commenttab-preload', |
1141 | | - ); |
1142 | | -} |
1143 | | - |
1144 | | -class CommentSpammerMessageGroup extends ExtensionMessageGroup { |
1145 | | - protected $label = 'Comment Spammer'; |
1146 | | - protected $id = 'ext-commentspammer'; |
1147 | | - |
1148 | | - protected $arrName = 'messages'; |
1149 | | - protected $messageFile = 'CommentSpammer/CommentSpammer.i18n.php'; |
1150 | | -} |
1151 | | - |
1152 | | -class ConfigureMessageGroup extends ExtensionMessageGroup { |
1153 | | - protected $label = 'Configure'; |
1154 | | - protected $id = 'ext-configure'; |
1155 | | - |
1156 | | - protected $arrName = 'messages'; |
1157 | | - protected $messageFile = 'Configure/Configure.i18n.php'; |
1158 | | - |
1159 | | - protected $optional = array( |
1160 | | - 'configure-section-html', |
1161 | | - 'configure-section-ajax', |
1162 | | - 'configure-section-djvu', |
1163 | | - 'configure-section-imagemagick', |
1164 | | - 'configure-section-interwiki', |
1165 | | - 'configure-section-memcached', |
1166 | | - 'configure-section-squid', |
1167 | | - 'configure-section-svg', |
1168 | | - 'configure-section-tex', |
1169 | | - 'configure-section-tidy', |
1170 | | - ); |
1171 | | -} |
1172 | | - |
1173 | | -class ConfirmAccountMessageGroup extends ExtensionMessageGroup { |
1174 | | - protected $label = 'Confirm Account'; |
1175 | | - protected $id = 'ext-confirmaccount'; |
1176 | | - |
1177 | | - protected $arrName = 'messages'; |
1178 | | - protected $messageFile = 'ConfirmAccount/ConfirmAccount.i18n.php'; |
1179 | | - |
1180 | | - protected $optional = array( |
1181 | | - 'requestaccount-info', |
1182 | | - 'requestaccount-footer' |
1183 | | - ); |
1184 | | -} |
1185 | | - |
1186 | | -class ConfirmEditMessageGroup extends ExtensionMessageGroup { |
1187 | | - protected $label = 'Confirm Edit'; |
1188 | | - protected $id = 'ext-confirmedit'; |
1189 | | - |
1190 | | - protected $arrName = 'messages'; |
1191 | | - protected $messageFile = 'ConfirmEdit/ConfirmEdit.i18n.php'; |
1192 | | -} |
1193 | | - |
1194 | | -class ConfirmEditFancyCaptchaMessageGroup extends ExtensionMessageGroup { |
1195 | | - protected $label = 'ConfirmEdit Fancy Captcha'; |
1196 | | - protected $id = 'ext-confirmeditfancycaptcha'; |
1197 | | - |
1198 | | - protected $arrName = 'messages'; |
1199 | | - protected $messageFile = 'ConfirmEdit/FancyCaptcha.i18n.php'; |
1200 | | -} |
1201 | | - |
1202 | | -class ContactPageMessageGroup extends ExtensionMessageGroup { |
1203 | | - protected $label = 'Contact Page'; |
1204 | | - protected $id = 'ext-contactpage'; |
1205 | | - |
1206 | | - protected $arrName = 'messages'; |
1207 | | - protected $messageFile = 'ContactPage/ContactPage.i18n.php'; |
1208 | | -} |
1209 | | - |
1210 | | -class ContributionScoresMessageGroup extends ExtensionMessageGroup { |
1211 | | - protected $label = 'Contribution Scores'; |
1212 | | - protected $id = 'ext-contributionscores'; |
1213 | | - |
1214 | | - protected $arrName = 'messages'; |
1215 | | - protected $messageFile = 'ContributionScores/ContributionScores.i18n.php'; |
1216 | | -} |
1217 | | - |
1218 | | -class ContributionseditcountMessageGroup extends ExtensionMessageGroup { |
1219 | | - protected $label = 'Contributions Edit Count'; |
1220 | | - protected $id = 'ext-contributionseditcount'; |
1221 | | - |
1222 | | - protected $arrName = 'messages'; |
1223 | | - protected $messageFile = 'Contributionseditcount/Contributionseditcount.i18n.php'; |
1224 | | -} |
1225 | | - |
1226 | | -class ContributorsMessageGroup extends ExtensionMessageGroup { |
1227 | | - protected $label = 'Contributors'; |
1228 | | - protected $id = 'ext-contributors'; |
1229 | | - |
1230 | | - protected $arrName = 'messages'; |
1231 | | - protected $messageFile = 'Contributors/Contributors.i18n.php'; |
1232 | | -} |
1233 | | - |
1234 | | -class ContributorsAddonMessageGroup extends ExtensionMessageGroup { |
1235 | | - protected $label = 'Contributors Add-on'; |
1236 | | - protected $id = 'ext-contributorsaddon'; |
1237 | | - |
1238 | | - protected $arrName = 'messages'; |
1239 | | - protected $messageFile = 'ContributorsAddon/ContributorsAddon.i18n.php'; |
1240 | | -} |
1241 | | - |
1242 | | -class CountEditsMessageGroup extends ExtensionMessageGroup { |
1243 | | - protected $label = 'Count Edits'; |
1244 | | - protected $id = 'ext-countedits'; |
1245 | | - |
1246 | | - protected $arrName = 'messages'; |
1247 | | - protected $messageFile = 'CountEdits/CountEdits.i18n.php'; |
1248 | | -} |
1249 | | - |
1250 | | -class CrossNamespaceLinksMessageGroup extends ExtensionMessageGroup { |
1251 | | - protected $label = 'Cross Namespace Links'; |
1252 | | - protected $id = 'ext-crossnamespacelinks'; |
1253 | | - |
1254 | | - protected $arrName = 'messages'; |
1255 | | - protected $messageFile = 'CrossNamespaceLinks/SpecialCrossNamespaceLinks.i18n.php'; |
1256 | | -} |
1257 | | - |
1258 | | -class CrosswikiBlockMessageGroup extends ExtensionMessageGroup { |
1259 | | - protected $label = 'Crosswiki Block'; |
1260 | | - protected $id = 'ext-crosswikiblock'; |
1261 | | - |
1262 | | - protected $arrName = 'messages'; |
1263 | | - protected $messageFile = 'Crosswiki/Block/CrosswikiBlock.i18n.php'; |
1264 | | -} |
1265 | | - |
1266 | | -class CrowdAuthenticationMessageGroup extends ExtensionMessageGroup { |
1267 | | - protected $label = 'Crowd Authentication'; |
1268 | | - protected $id = 'ext-crowdauthentication'; |
1269 | | - |
1270 | | - protected $arrName = 'messages'; |
1271 | | - protected $messageFile = 'CrowdAuthentication/CrowdAuthentication.i18n.php'; |
1272 | | -} |
1273 | | - |
1274 | | -class DataTransferMessageGroup extends ExtensionMessageGroup { |
1275 | | - protected $label = 'Data Transfer'; |
1276 | | - protected $id = 'ext-datatransfer'; |
1277 | | - |
1278 | | - protected $arrName = 'messages'; |
1279 | | - protected $messageFile = 'DataTransfer/languages/DT_Messages.php'; |
1280 | | -} |
1281 | | - |
1282 | | -class DeletedContribsMessageGroup extends ExtensionMessageGroup { |
1283 | | - protected $label = 'Deleted Contributions'; |
1284 | | - protected $id = 'ext-deletedcontribs'; |
1285 | | - |
1286 | | - protected $arrName = 'messages'; |
1287 | | - protected $messageFile = 'DeletedContributions/DeletedContributions.i18n.php'; |
1288 | | -} |
1289 | | - |
1290 | | -class DidYouMeanMessageGroup extends ExtensionMessageGroup { |
1291 | | - protected $label = 'Did You Mean'; |
1292 | | - protected $id = 'ext-didyoumean'; |
1293 | | - |
1294 | | - protected $arrName = 'messages'; |
1295 | | - protected $messageFile = 'DidYouMean/DidYouMean.i18n.php'; |
1296 | | -} |
1297 | | - |
1298 | | -class DismissableSiteNoticeMessageGroup extends ExtensionMessageGroup { |
1299 | | - protected $label = 'Dismissable SiteNotice'; |
1300 | | - protected $id = 'ext-dismissablesitenotice'; |
1301 | | - |
1302 | | - protected $arrName = 'messages'; |
1303 | | - protected $messageFile = 'DismissableSiteNotice/DismissableSiteNotice.i18n.php'; |
1304 | | - |
1305 | | - protected $ignored = array( |
1306 | | - 'sitenotice_id', |
1307 | | - ); |
1308 | | -} |
1309 | | - |
1310 | | -class DoubleWikiMessageGroup extends ExtensionMessageGroup { |
1311 | | - protected $label = 'Double Wiki'; |
1312 | | - protected $id = 'ext-doublewiki'; |
1313 | | - |
1314 | | - protected $arrName = 'messages'; |
1315 | | - protected $messageFile = 'DoubleWiki/DoubleWiki.i18n.php'; |
1316 | | -} |
1317 | | - |
1318 | | -class DPLForumMessageGroup extends ExtensionMessageGroup { |
1319 | | - protected $label = 'DPL Forum'; |
1320 | | - protected $id = 'ext-dplforum'; |
1321 | | - |
1322 | | - protected $arrName = 'messages'; |
1323 | | - protected $messageFile = 'DPLforum/DPLforum.i18n.php'; |
1324 | | -} |
1325 | | - |
1326 | | -class DuplicatorMessageGroup extends ExtensionMessageGroup { |
1327 | | - protected $label = 'Duplicator'; |
1328 | | - protected $id = 'ext-duplicator'; |
1329 | | - |
1330 | | - protected $arrName = 'messages'; |
1331 | | - protected $messageFile = 'Duplicator/Duplicator.i18n.php'; |
1332 | | -} |
1333 | | - |
1334 | | -class EditcountMessageGroup extends ExtensionMessageGroup { |
1335 | | - protected $label = 'Edit Count'; |
1336 | | - protected $id = 'ext-editcount'; |
1337 | | - |
1338 | | - protected $arrName = 'messages'; |
1339 | | - protected $messageFile = 'Editcount/SpecialEditcount.i18n.php'; |
1340 | | -} |
1341 | | - |
1342 | | -class EditMessagesMessageGroup extends ExtensionMessageGroup { |
1343 | | - protected $label = 'Edit Messages'; |
1344 | | - protected $id = 'ext-editmessages'; |
1345 | | - |
1346 | | - protected $arrName = 'messages'; |
1347 | | - protected $messageFile = 'EditMessages/EditMessages.i18n.php'; |
1348 | | -} |
1349 | | - |
1350 | | -class EditOwnMessageGroup extends ExtensionMessageGroup { |
1351 | | - protected $label = 'Edit Own'; |
1352 | | - protected $id = 'ext-editown'; |
1353 | | - |
1354 | | - protected $arrName = 'messages'; |
1355 | | - protected $messageFile = 'EditOwn/EditOwn.i18n.php'; |
1356 | | -} |
1357 | | - |
1358 | | -class EditSubpagesMessageGroup extends ExtensionMessageGroup { |
1359 | | - protected $label = 'Edit Subpages'; |
1360 | | - protected $id = 'ext-editsubpages'; |
1361 | | - |
1362 | | - protected $arrName = 'messages'; |
1363 | | - protected $messageFile = 'EditSubpages/EditSubpages.i18n.php'; |
1364 | | -} |
1365 | | - |
1366 | | -class EditSimilarMessageGroup extends ExtensionMessageGroup { |
1367 | | - protected $label = 'Edit Similar'; |
1368 | | - protected $id = 'ext-editsimilar'; |
1369 | | - |
1370 | | - protected $arrName = 'messages'; |
1371 | | - protected $messageFile = 'EditSimilar/EditSimilar.i18n.php'; |
1372 | | -} |
1373 | | - |
1374 | | -class EditUserMessageGroup extends ExtensionMessageGroup { |
1375 | | - protected $label = 'Edit User'; |
1376 | | - protected $id = 'ext-edituser'; |
1377 | | - |
1378 | | - protected $arrName = 'messages'; |
1379 | | - protected $messageFile = 'EditUser/EditUser.i18n.php'; |
1380 | | -} |
1381 | | - |
1382 | | -class EmailAddressImageMessageGroup extends ExtensionMessageGroup { |
1383 | | - protected $label = 'Email Address Image'; |
1384 | | - protected $id = 'ext-emailaddressimage'; |
1385 | | - |
1386 | | - protected $arrName = 'messages'; |
1387 | | - protected $messageFile = 'EmailAddressImage/EmailAddressImage.i18n.php'; |
1388 | | -} |
1389 | | - |
1390 | | -class EmailArticleMessageGroup extends ExtensionMessageGroup { |
1391 | | - protected $label = 'Email Article'; |
1392 | | - protected $id = 'ext-emailarticle'; |
1393 | | - |
1394 | | - protected $arrName = 'messages'; |
1395 | | - protected $messageFile = 'EmailArticle/EmailArticle.i18n.php'; |
1396 | | -} |
1397 | | - |
1398 | | -class EvalMessageGroup extends ExtensionMessageGroup { |
1399 | | - protected $label = 'Eval'; |
1400 | | - protected $id = 'ext-eval'; |
1401 | | - |
1402 | | - protected $arrName = 'messages'; |
1403 | | - protected $messageFile = 'Eval/SpecialEval.i18n.php'; |
1404 | | -} |
1405 | | - |
1406 | | -class ExpandTemplatesMessageGroup extends ExtensionMessageGroup { |
1407 | | - protected $label = 'Expand Templates'; |
1408 | | - protected $id = 'ext-expandtemplates'; |
1409 | | - |
1410 | | - protected $arrName = 'messages'; |
1411 | | - protected $messageFile = 'ExpandTemplates/ExpandTemplates.i18n.php'; |
1412 | | -} |
1413 | | - |
1414 | | -class FarmerMessageGroup extends ExtensionMessageGroup { |
1415 | | - protected $label = 'Farmer'; |
1416 | | - protected $id = 'ext-farmer'; |
1417 | | - |
1418 | | - protected $arrName = 'messages'; |
1419 | | - protected $messageFile = 'Farmer/Farmer.i18n.php'; |
1420 | | - |
1421 | | - protected $optional = array( |
1422 | | - 'farmercreateurl', |
1423 | | - ); |
1424 | | - protected $ignored = array( |
1425 | | - 'farmerwikiurl', |
1426 | | - 'farmerinterwikiurl', |
1427 | | - ); |
1428 | | -} |
1429 | | - |
1430 | | -class FCKeditorMessageGroup extends ExtensionMessageGroup { |
1431 | | - protected $label = 'FCKeditor'; |
1432 | | - protected $id = 'ext-fckeditor'; |
1433 | | - |
1434 | | - protected $arrName = 'messages'; |
1435 | | - protected $messageFile = 'FCKeditor/FCKeditor.i18n.php'; |
1436 | | -} |
1437 | | - |
1438 | | -class FRDepreciationOversightMessageGroup extends ExtensionMessageGroup { |
1439 | | - protected $label = 'Flagged Revisions - Depreciation Oversight'; |
1440 | | - protected $id = 'ext-fr-depreciationoversight'; |
1441 | | - |
1442 | | - protected $arrName = 'messages'; |
1443 | | - protected $messageFile = 'FlaggedRevs/language/DepreciationOversight.i18n.php'; |
1444 | | - |
1445 | | -} |
1446 | | - |
1447 | | -class FRFlaggedRevsMessageGroup extends ExtensionMessageGroup { |
1448 | | - protected $label = 'Flagged Revisions - Flagged Revs'; |
1449 | | - protected $id = 'ext-fr-flaggedrevs'; |
1450 | | - |
1451 | | - protected $arrName = 'messages'; |
1452 | | - protected $messageFile = 'FlaggedRevs/language/FlaggedRevs.i18n.php'; |
1453 | | - |
1454 | | - protected $optional = array( |
1455 | | - 'revreview-toggle', |
1456 | | - ); |
1457 | | -} |
1458 | | - |
1459 | | -class FRFlaggedRevsAliasesMessageGroup extends ExtensionMessageGroup { |
1460 | | - protected $label = 'Flagged Revisions - Flagged Revs Aliases'; |
1461 | | - protected $id = 'ext-fr-flaggedrevsaliases'; |
1462 | | - |
1463 | | - protected $arrName = 'messages'; |
1464 | | - protected $messageFile = 'FlaggedRevs/language/FlaggedRevsAliases.i18n.php'; |
1465 | | - |
1466 | | -} |
1467 | | - |
1468 | | -class FROldReviewedPagesMessageGroup extends ExtensionMessageGroup { |
1469 | | - protected $label = 'Flagged Revisions - Old Reviewed Pages'; |
1470 | | - protected $id = 'ext-fr-oldreviewedpages'; |
1471 | | - |
1472 | | - protected $arrName = 'messages'; |
1473 | | - protected $messageFile = 'FlaggedRevs/language/OldReviewedPages.i18n.php'; |
1474 | | - |
1475 | | -} |
1476 | | - |
1477 | | -class FRQualityOversightMessageGroup extends ExtensionMessageGroup { |
1478 | | - protected $label = 'Flagged Revisions - Quality Oversight'; |
1479 | | - protected $id = 'ext-fr-qualityoversight'; |
1480 | | - |
1481 | | - protected $arrName = 'messages'; |
1482 | | - protected $messageFile = 'FlaggedRevs/language/QualityOversight.i18n.php'; |
1483 | | - |
1484 | | -} |
1485 | | - |
1486 | | -class FRReviewedPagesMessageGroup extends ExtensionMessageGroup { |
1487 | | - protected $label = 'Flagged Revisions - Reviewed Pages'; |
1488 | | - protected $id = 'ext-fr-reviewedpages'; |
1489 | | - |
1490 | | - protected $arrName = 'messages'; |
1491 | | - protected $messageFile = 'FlaggedRevs/language/ReviewedPages.i18n.php'; |
1492 | | - |
1493 | | -} |
1494 | | - |
1495 | | -class FRStabilizationMessageGroup extends ExtensionMessageGroup { |
1496 | | - protected $label = 'Flagged Revisions - Stabilization'; |
1497 | | - protected $id = 'ext-fr-stabilization'; |
1498 | | - |
1499 | | - protected $arrName = 'messages'; |
1500 | | - protected $messageFile = 'FlaggedRevs/language/Stabilization.i18n.php'; |
1501 | | - |
1502 | | -} |
1503 | | - |
1504 | | -class FRStablePagesMessageGroup extends ExtensionMessageGroup { |
1505 | | - protected $label = 'Flagged Revisions - Stable Pages'; |
1506 | | - protected $id = 'ext-fr-stablepages'; |
1507 | | - |
1508 | | - protected $arrName = 'messages'; |
1509 | | - protected $messageFile = 'FlaggedRevs/language/StablePages.i18n.php'; |
1510 | | - |
1511 | | -} |
1512 | | - |
1513 | | -class FRStableVersionsMessageGroup extends ExtensionMessageGroup { |
1514 | | - protected $label = 'Flagged Revisions - Stable Versions'; |
1515 | | - protected $id = 'ext-fr-stableversions'; |
1516 | | - |
1517 | | - protected $arrName = 'messages'; |
1518 | | - protected $messageFile = 'FlaggedRevs/language/StableVersions.i18n.php'; |
1519 | | - |
1520 | | -} |
1521 | | - |
1522 | | -class FRUnreviewedPagesMessageGroup extends ExtensionMessageGroup { |
1523 | | - protected $label = 'Flagged Revisions - Unreviewed Pages'; |
1524 | | - protected $id = 'ext-fr-unreviewedpages'; |
1525 | | - |
1526 | | - protected $arrName = 'messages'; |
1527 | | - protected $messageFile = 'FlaggedRevs/language/UnreviewedPages.i18n.php'; |
1528 | | - |
1529 | | -} |
1530 | | - |
1531 | | -class FindSpamMessageGroup extends ExtensionMessageGroup { |
1532 | | - protected $label = 'Find Spam'; |
1533 | | - protected $id = 'ext-findspam'; |
1534 | | - |
1535 | | - protected $arrName = 'messages'; |
1536 | | - protected $messageFile = 'FindSpam/FindSpam.i18n.php'; |
1537 | | -} |
1538 | | - |
1539 | | -class FixedImageMessageGroup extends ExtensionMessageGroup { |
1540 | | - protected $label = 'Fixed Image'; |
1541 | | - protected $id = 'ext-fixedimage'; |
1542 | | - |
1543 | | - protected $arrName = 'messages'; |
1544 | | - protected $messageFile = 'FixedImage/FixedImage.i18n.php'; |
1545 | | -} |
1546 | | - |
1547 | | -class ForcePreviewMessageGroup extends ExtensionMessageGroup { |
1548 | | - protected $label = 'Force Preview'; |
1549 | | - protected $id = 'ext-forcepreview'; |
1550 | | - |
1551 | | - protected $arrName = 'messages'; |
1552 | | - protected $messageFile = 'ForcePreview/ForcePreview.i18n.php'; |
1553 | | -} |
1554 | | - |
1555 | | -class FormatEmailMessageGroup extends ExtensionMessageGroup { |
1556 | | - protected $label = 'Format Email'; |
1557 | | - protected $id = 'ext-formatemail'; |
1558 | | - |
1559 | | - protected $arrName = 'messages'; |
1560 | | - protected $messageFile = 'FormatEmail/FormatEmail.i18n.php'; |
1561 | | - |
1562 | | - protected $ignored = array( |
1563 | | - 'email_header', |
1564 | | - ); |
1565 | | -} |
1566 | | - |
1567 | | -class GadgetsMessageGroup extends ExtensionMessageGroup { |
1568 | | - protected $label = 'Gadgets'; |
1569 | | - protected $id = 'ext-gadgets'; |
1570 | | - |
1571 | | - protected $arrName = 'messages'; |
1572 | | - protected $messageFile = 'Gadgets/Gadgets.i18n.php'; |
1573 | | - |
1574 | | - protected $ignored = array( |
1575 | | - 'gadgets-definition', |
1576 | | - ); |
1577 | | -} |
1578 | | - |
1579 | | -class GlobalBlockingMessageGroup extends ExtensionMessageGroup { |
1580 | | - protected $label = 'Global Blocking'; |
1581 | | - protected $id = 'ext-globalblocking'; |
1582 | | - |
1583 | | - protected $arrName = 'messages'; |
1584 | | - protected $messageFile = 'GlobalBlocking/GlobalBlocking.i18n.php'; |
1585 | | - |
1586 | | - protected $ignored = array( 'globalblocking-expiry-options' ); |
1587 | | - |
1588 | | -} |
1589 | | - |
1590 | | -class GlobalUsageMessageGroup extends ExtensionMessageGroup { |
1591 | | - protected $label = 'Global Usage'; |
1592 | | - protected $id = 'ext-globalusage'; |
1593 | | - |
1594 | | - protected $arrName = 'messages'; |
1595 | | - protected $messageFile = 'GlobalUsage/GlobalUsage.i18n.php'; |
1596 | | -} |
1597 | | - |
1598 | | -class GnuplotMessageGroup extends ExtensionMessageGroup { |
1599 | | - protected $label = 'Gnuplot'; |
1600 | | - protected $id = 'ext-gnuplot'; |
1601 | | - |
1602 | | - protected $arrName = 'messages'; |
1603 | | - protected $messageFile = 'Gnuplot/Gnuplot.i18n.php'; |
1604 | | -} |
1605 | | - |
1606 | | -class GoogleAnalyticsMessageGroup extends ExtensionMessageGroup { |
1607 | | - protected $label = 'Google Analytics'; |
1608 | | - protected $id = 'ext-googleanalytics'; |
1609 | | - |
1610 | | - protected $arrName = 'messages'; |
1611 | | - protected $messageFile = 'googleAnalytics/googleAnalytics.i18n.php'; |
1612 | | -} |
1613 | | - |
1614 | | -class GoogleMapsMessageGroup extends ExtensionMessageGroup { |
1615 | | - protected $label = 'Google Maps'; |
1616 | | - protected $id = 'ext-googlemaps'; |
1617 | | - |
1618 | | - protected $arrName = 'wgGoogleMapsMessages'; |
1619 | | - protected $messageFile = 'GoogleMaps/GoogleMaps.i18n.php'; |
1620 | | -} |
1621 | | - |
1622 | | -class GoToCategoryMessageGroup extends ExtensionMessageGroup { |
1623 | | - protected $label = 'Go To Category'; |
1624 | | - protected $id = 'ext-gotocategory'; |
1625 | | - |
1626 | | - protected $arrName = 'messages'; |
1627 | | - protected $messageFile = 'GoToCategory/GoToCategory.i18n.php'; |
1628 | | -} |
1629 | | - |
1630 | | -class HTMLetsMessageGroup extends ExtensionMessageGroup { |
1631 | | - protected $label = 'HTMLets'; |
1632 | | - protected $id = 'ext-htmlets'; |
1633 | | - |
1634 | | - protected $arrName = 'messages'; |
1635 | | - protected $messageFile = 'HTMLets/HTMLets.i18n.php'; |
1636 | | -} |
1637 | | - |
1638 | | -class I18nTagsMessageGroup extends ExtensionMessageGroup { |
1639 | | - protected $label = 'Parser i18n tags'; |
1640 | | - protected $id = 'ext-i18ntags'; |
1641 | | - |
1642 | | - protected $arrName = 'messages'; |
1643 | | - protected $messageFile = 'I18nTags/I18nTags.i18n.php'; |
1644 | | -} |
1645 | | - |
1646 | | -class IconMessageGroup extends ExtensionMessageGroup { |
1647 | | - protected $label = 'Icon'; |
1648 | | - protected $id = 'ext-icon'; |
1649 | | - |
1650 | | - protected $arrName = 'messages'; |
1651 | | - protected $messageFile = 'Icon/Icon.i18n.php'; |
1652 | | -} |
1653 | | - |
1654 | | -class ImageMapMessageGroup extends ExtensionMessageGroup { |
1655 | | - protected $label = 'Image Map'; |
1656 | | - protected $id = 'ext-imagemap'; |
1657 | | - |
1658 | | - protected $arrName = 'messages'; |
1659 | | - protected $messageFile = 'ImageMap/ImageMap.i18n.php'; |
1660 | | - |
1661 | | - protected $ignored = array( |
1662 | | - 'imagemap_desc_types', |
1663 | | - ); |
1664 | | -} |
1665 | | - |
1666 | | -class ImageTaggingMessageGroup extends ExtensionMessageGroup { |
1667 | | - protected $label = 'Image Tagging'; |
1668 | | - protected $id = 'ext-imagetagging'; |
1669 | | - |
1670 | | - protected $arrName = 'messages'; |
1671 | | - protected $messageFile = 'ImageTagging/ImageTagging.i18n.php'; |
1672 | | -} |
1673 | | - |
1674 | | -class ImportFreeImagesMessageGroup extends ExtensionMessageGroup { |
1675 | | - protected $label = 'Import Free Images'; |
1676 | | - protected $id = 'ext-importfreeimages'; |
1677 | | - |
1678 | | - protected $arrName = 'messages'; |
1679 | | - protected $messageFile = 'ImportFreeImages/ImportFreeImages.i18n.php'; |
1680 | | -} |
1681 | | - |
1682 | | -class ImportUsersMessageGroup extends ExtensionMessageGroup { |
1683 | | - protected $label = 'Import Users'; |
1684 | | - protected $id = 'ext-importusers'; |
1685 | | - |
1686 | | - protected $arrName = 'messages'; |
1687 | | - protected $messageFile = 'ImportUsers/SpecialImportUsers.i18n.php'; |
1688 | | -} |
1689 | | - |
1690 | | -class InputBoxMessageGroup extends ExtensionMessageGroup { |
1691 | | - protected $label = 'Input Box'; |
1692 | | - protected $id = 'ext-inputbox'; |
1693 | | - |
1694 | | - protected $arrName = 'messages'; |
1695 | | - protected $messageFile = 'inputbox/InputBox.i18n.php'; |
1696 | | -} |
1697 | | - |
1698 | | -class InspectCacheMessageGroup extends ExtensionMessageGroup { |
1699 | | - protected $label = 'Inspect Cache'; |
1700 | | - protected $id = 'ext-inspectcache'; |
1701 | | - |
1702 | | - protected $arrName = 'messages'; |
1703 | | - protected $messageFile = 'InspectCache/InspectCache.i18n.php'; |
1704 | | -} |
1705 | | - |
1706 | | -class IntersectionMessageGroup extends ExtensionMessageGroup { |
1707 | | - protected $label = 'Intersection'; |
1708 | | - protected $id = 'ext-intersection'; |
1709 | | - |
1710 | | - protected $arrName = 'messages'; |
1711 | | - protected $messageFile = 'intersection/DynamicPageList.i18n.php'; |
1712 | | -} |
1713 | | - |
1714 | | -class InterwikiMessageGroup extends ExtensionMessageGroup { |
1715 | | - protected $label = 'Interwiki Edit Page'; |
1716 | | - protected $id = 'ext-interwiki'; |
1717 | | - |
1718 | | - protected $arrName = 'messages'; |
1719 | | - protected $messageFile = 'Interwiki/SpecialInterwiki.i18n.php'; |
1720 | | - |
1721 | | - protected $optional = array( |
1722 | | - 'interwiki_defaulturl', |
1723 | | - 'interwiki_local', |
1724 | | - 'interwiki_trans', |
1725 | | - ); |
1726 | | - protected $ignored = array( |
1727 | | - 'interwiki_logentry', |
1728 | | - 'interwiki_url', |
1729 | | - ); |
1730 | | -} |
1731 | | - |
1732 | | -class InvitationsMessageGroup extends ExtensionMessageGroup { |
1733 | | - protected $label = 'Invitations'; |
1734 | | - protected $id = 'ext-invitations'; |
1735 | | - |
1736 | | - protected $arrName = 'messages'; |
1737 | | - protected $messageFile = 'Invitations/Invitations.i18n.php'; |
1738 | | - |
1739 | | - protected $ignored = array( |
1740 | | - 'invitations-uninvitedlist-item', |
1741 | | - ); |
1742 | | -} |
1743 | | - |
1744 | | -class LabeledSectionTransclusionMessageGroup extends ExtensionMessageGroup { |
1745 | | - protected $label = 'Labeled Section Transclusion'; |
1746 | | - protected $id = 'ext-labeledsectiontransclusion'; |
1747 | | - |
1748 | | - protected $arrName = 'messages'; |
1749 | | - protected $messageFile = 'LabeledSectionTransclusion/lst.i18n.php'; |
1750 | | -} |
1751 | | - |
1752 | | -class LanguageNamesMessageGroup extends ExtensionMessageGroup { |
1753 | | - protected $label = 'Cldr'; |
1754 | | - protected $id = 'ext-cldr'; |
1755 | | - |
1756 | | - protected $arrName = 'messages'; |
1757 | | - protected $messageFile = 'cldr/LanguageNames.i18n.php'; |
1758 | | -} |
1759 | | - |
1760 | | -class LanguageSelectorMessageGroup extends ExtensionMessageGroup { |
1761 | | - protected $label = 'Language Selector'; |
1762 | | - protected $id = 'ext-languageselector'; |
1763 | | - |
1764 | | - protected $arrName = 'messages'; |
1765 | | - protected $messageFile = 'LanguageSelector/LanguageSelector.i18n.php'; |
1766 | | -} |
1767 | | - |
1768 | | -class LatexDocMessageGroup extends ExtensionMessageGroup { |
1769 | | - protected $label = 'Latex Doc'; |
1770 | | - protected $id = 'ext-latexdoc'; |
1771 | | - |
1772 | | - protected $arrName = 'messages'; |
1773 | | - protected $messageFile = 'LatexDoc/LatexDoc.i18n.php'; |
1774 | | -} |
1775 | | - |
1776 | | -class LinkSearchMessageGroup extends ExtensionMessageGroup { |
1777 | | - protected $label = 'Link Search'; |
1778 | | - protected $id = 'ext-linksearch'; |
1779 | | - |
1780 | | - protected $arrName = 'messages'; |
1781 | | - protected $messageFile = 'LinkSearch/LinkSearch.i18n.php'; |
1782 | | -} |
1783 | | - |
1784 | | -class LiquidThreadsMessageGroup extends ExtensionMessageGroup { |
1785 | | - protected $label = 'Liquid Threads'; |
1786 | | - protected $id = 'ext-liquidthreads'; |
1787 | | - |
1788 | | - protected $arrName = 'messages'; |
1789 | | - protected $messageFile = 'LiquidThreads/Lqt.i18n.php'; |
1790 | | - |
1791 | | - protected $ignored = array( |
1792 | | - 'lqt_header_warning_before_big', |
1793 | | - ); |
1794 | | -} |
1795 | | - |
1796 | | -class LookupUserMessageGroup extends ExtensionMessageGroup { |
1797 | | - protected $label = 'Lookup User'; |
1798 | | - protected $id = 'ext-lookupuser'; |
1799 | | - |
1800 | | - protected $arrName = 'messages'; |
1801 | | - protected $messageFile = 'LookupUser/LookupUser.i18n.php'; |
1802 | | -} |
1803 | | - |
1804 | | - |
1805 | | -class MaintenanceMessageGroup extends ExtensionMessageGroup { |
1806 | | - protected $label = 'Maintenance'; |
1807 | | - protected $id = 'ext-maintenance'; |
1808 | | - |
1809 | | - protected $arrName = 'messages'; |
1810 | | - protected $messageFile = 'Maintenance/Maintenance.i18n.php'; |
1811 | | - |
1812 | | - protected $ignored = array( |
1813 | | - 'maintenance-initEditCount', |
1814 | | - 'maintenance-runJobs', |
1815 | | - 'maintenance-showJobs', |
1816 | | - 'maintenance-stats', |
1817 | | - ); |
1818 | | -} |
1819 | | - |
1820 | | -class MathStatMessageGroup extends ExtensionMessageGroup { |
1821 | | - protected $label = 'Math Stat'; |
1822 | | - protected $id = 'ext-mathstat'; |
1823 | | - |
1824 | | - protected $arrName = 'messages'; |
1825 | | - protected $messageFile = 'MathStatFunctions/MathStatFunctions.i18n.php'; |
1826 | | -} |
1827 | | - |
1828 | | -class MediaFunctionsMessageGroup extends ExtensionMessageGroup { |
1829 | | - protected $label = 'Media Functions'; |
1830 | | - protected $id = 'ext-mediafunctions'; |
1831 | | - |
1832 | | - protected $arrName = 'messages'; |
1833 | | - protected $messageFile = 'MediaFunctions/MediaFunctions.i18n.php'; |
1834 | | -} |
1835 | | - |
1836 | | -class MetavidWikiMessageGroup extends ExtensionMessageGroup { |
1837 | | - protected $label = 'Metavid Wiki'; |
1838 | | - protected $id = 'ext-metavidwiki'; |
1839 | | - |
1840 | | - protected $arrName = 'messages'; |
1841 | | - protected $messageFile = 'MetavidWiki/languages/MV_Messages.php'; |
1842 | | - |
1843 | | - protected $optional = array( |
1844 | | - 'ao_file_64Kb_MPEG4', |
1845 | | - 'ao_file_256Kb_MPEG4', |
1846 | | - 'ao_file_MPEG1', |
1847 | | - 'ao_file_MPEG2', |
1848 | | - 'ao_file_flash_flv', |
1849 | | - ); |
1850 | | -} |
1851 | | - |
1852 | | -class MibbitMessageGroup extends ExtensionMessageGroup { |
1853 | | - protected $label = 'Mibbit'; |
1854 | | - protected $id = 'ext-mibbit'; |
1855 | | - |
1856 | | - protected $arrName = 'messages'; |
1857 | | - protected $messageFile = 'Mibbit/Mibbit.i18n.php'; |
1858 | | -} |
1859 | | - |
1860 | | -class MicroIDMessageGroup extends ExtensionMessageGroup { |
1861 | | - protected $label = 'MicroID'; |
1862 | | - protected $id = 'ext-microid'; |
1863 | | - |
1864 | | - protected $arrName = 'messages'; |
1865 | | - protected $messageFile = 'MicroID/MicroID.i18n.php'; |
1866 | | -} |
1867 | | - |
1868 | | -class MiniDonationMessageGroup extends ExtensionMessageGroup { |
1869 | | - protected $label = 'Mini Donation'; |
1870 | | - protected $id = 'ext-minidonation'; |
1871 | | - |
1872 | | - protected $arrName = 'messages'; |
1873 | | - protected $messageFile = 'MiniDonation/MiniDonation.i18n.php'; |
1874 | | -} |
1875 | | - |
1876 | | -class MinimumNameLengthMessageGroup extends ExtensionMessageGroup { |
1877 | | - protected $label = 'Minimum Name Length'; |
1878 | | - protected $id = 'ext-minimumnamelength'; |
1879 | | - |
1880 | | - protected $arrName = 'messages'; |
1881 | | - protected $messageFile = 'MinimumNameLength/MinimumNameLength.i18n.php'; |
1882 | | -} |
1883 | | - |
1884 | | -class MiniPreviewMessageGroup extends ExtensionMessageGroup { |
1885 | | - protected $label = 'Mini Preview'; |
1886 | | - protected $id = 'ext-minipreview'; |
1887 | | - |
1888 | | - protected $arrName = 'messages'; |
1889 | | - protected $messageFile = 'MiniPreview/MiniPreview.i18n.php'; |
1890 | | -} |
1891 | | - |
1892 | | -class MultiBoilerplateMessageGroup extends ExtensionMessageGroup { |
1893 | | - protected $label = 'Multi Boilerplate'; |
1894 | | - protected $id = 'ext-multiboilerplate'; |
1895 | | - |
1896 | | - protected $arrName = 'messages'; |
1897 | | - protected $messageFile = 'MultiBoilerplate/MultiBoilerplate.i18n.php'; |
1898 | | - |
1899 | | - protected $ignored = array( 'multiboilerplate', 'multiboilerplate-label' ); |
1900 | | -} |
1901 | | - |
1902 | | -class MultiUploadMessageGroup extends ExtensionMessageGroup { |
1903 | | - protected $label = 'Multi Upload'; |
1904 | | - protected $id = 'ext-multiupload'; |
1905 | | - |
1906 | | - protected $arrName = 'messages'; |
1907 | | - protected $messageFile = 'MultiUpload/SpecialMultipleUpload.i18n.php'; |
1908 | | -} |
1909 | | - |
1910 | | -class MWSearchMessageGroup extends ExtensionMessageGroup { |
1911 | | - protected $label = 'MediaWiki Search'; |
1912 | | - protected $id = 'ext-mwsearch'; |
1913 | | - |
1914 | | - protected $arrName = 'messages'; |
1915 | | - protected $messageFile = 'MWSearch/MWSearch.i18n.php'; |
1916 | | -} |
1917 | | - |
1918 | | -class NavigationPopupsMessageGroup extends ExtensionMessageGroup { |
1919 | | - protected $label = 'Navigation Popups'; |
1920 | | - protected $id = 'ext-navigationpopups'; |
1921 | | - |
1922 | | - protected $arrName = 'messages'; |
1923 | | - protected $messageFile = 'NavigationPopups/NavigationPopups.18n.php'; |
1924 | | -} |
1925 | | - |
1926 | | -class NetworkAuthMessageGroup extends ExtensionMessageGroup { |
1927 | | - protected $label = 'Network Auth'; |
1928 | | - protected $id = 'ext-networkauth'; |
1929 | | - |
1930 | | - protected $arrName = 'messages'; |
1931 | | - protected $messageFile = 'NetworkAuth/NetworkAuth.i18n.php'; |
1932 | | - |
1933 | | - protected $optional = array( |
1934 | | - 'networkauth-name', |
1935 | | - 'networkauth-purltext', |
1936 | | - ); |
1937 | | -} |
1938 | | - |
1939 | | -class NewestPagesMessageGroup extends ExtensionMessageGroup { |
1940 | | - protected $label = 'Newest Pages'; |
1941 | | - protected $id = 'ext-newestpages'; |
1942 | | - |
1943 | | - protected $arrName = 'messages'; |
1944 | | - protected $messageFile = 'NewestPages/NewestPages.i18n.php'; |
1945 | | -} |
1946 | | - |
1947 | | -class NewsMessageGroup extends ExtensionMessageGroup { |
1948 | | - protected $label = 'News'; |
1949 | | - protected $id = 'ext-news'; |
1950 | | - |
1951 | | - protected $arrName = 'messages'; |
1952 | | - protected $messageFile = 'News/News.i18n.php'; |
1953 | | - |
1954 | | - protected $optional = array( |
1955 | | - 'newsextension-unknownformat', |
1956 | | - 'newsextension-feednotfound', |
1957 | | - 'newsextension-feedrequest', |
1958 | | - 'newsextension-checkok', |
1959 | | - 'newsextension-checkok1', |
1960 | | - 'newsextension-gotcached', |
1961 | | - 'newsextension-purge', |
1962 | | - 'newsextension-loggin', |
1963 | | - 'newsextension-outputting', |
1964 | | - 'newsextension-stale', |
1965 | | - 'newsextension-nofoundonpage', |
1966 | | - 'newsextension-renderedfeed', |
1967 | | - 'newsextension-cachingfeed', |
1968 | | - 'newsextension-freshfeed', |
1969 | | - ); |
1970 | | -} |
1971 | | - |
1972 | | -class NewuserLogMessageGroup extends ExtensionMessageGroup { |
1973 | | - protected $label = 'Newuser Log'; |
1974 | | - protected $id = 'ext-newuserlog'; |
1975 | | - |
1976 | | - protected $arrName = 'messages'; |
1977 | | - protected $messageFile = 'Newuserlog/Newuserlog.i18n.php'; |
1978 | | - |
1979 | | - protected $ignored = array( |
1980 | | - 'newuserlogentry', |
1981 | | - ); |
1982 | | -} |
1983 | | - |
1984 | | -class NewUserMessageMessageGroup extends ExtensionMessageGroup { |
1985 | | - protected $label = 'New User Message'; |
1986 | | - protected $id = 'ext-newusermessage'; |
1987 | | - |
1988 | | - protected $arrName = 'messages'; |
1989 | | - protected $messageFile = 'NewUserMessage/NewUserMessage.i18n.php'; |
1990 | | -} |
1991 | | - |
1992 | | -class NewUserNotifMessageGroup extends ExtensionMessageGroup { |
1993 | | - protected $label = 'New User Notification'; |
1994 | | - protected $id = 'ext-newusernotif'; |
1995 | | - |
1996 | | - protected $arrName = 'messages'; |
1997 | | - protected $messageFile = 'NewUserNotif/NewUserNotif.i18n.php'; |
1998 | | -} |
1999 | | - |
2000 | | -class NukeMessageGroup extends ExtensionMessageGroup { |
2001 | | - protected $label = 'Nuke'; |
2002 | | - protected $id = 'ext-nuke'; |
2003 | | - |
2004 | | - protected $arrName = 'messages'; |
2005 | | - protected $messageFile = 'Nuke/SpecialNuke.i18n.php'; |
2006 | | -} |
2007 | | - |
2008 | | -class OaiMessageGroup extends ExtensionMessageGroup { |
2009 | | - protected $label = 'OAI-PMH repository'; |
2010 | | - protected $id = 'ext-oai'; |
2011 | | - |
2012 | | - protected $arrName = 'messages'; |
2013 | | - protected $messageFile = 'OAI/OAIRepo.i18n.php'; |
2014 | | -} |
2015 | | - |
2016 | | -class OggHandlerMessageGroup extends ExtensionMessageGroup { |
2017 | | - protected $label = 'Ogg Handler'; |
2018 | | - protected $id = 'ext-ogghandler'; |
2019 | | - |
2020 | | - protected $arrName = 'messages'; |
2021 | | - protected $messageFile = 'OggHandler/OggHandler.i18n.php'; |
2022 | | - |
2023 | | - protected $optional = array( |
2024 | | - 'ogg-player-cortado', |
2025 | | - 'ogg-player-vlc-mozilla', |
2026 | | - 'ogg-player-vlc-activex', |
2027 | | - 'ogg-player-quicktime-mozilla', |
2028 | | - 'ogg-player-quicktime-activex', |
2029 | | - ); |
2030 | | -} |
2031 | | - |
2032 | | -class OnlineStatusMessageGroup extends ExtensionMessageGroup { |
2033 | | - protected $label = 'Online Status'; |
2034 | | - protected $id = 'ext-onlinestatus'; |
2035 | | - |
2036 | | - protected $arrName = 'messages'; |
2037 | | - protected $messageFile = 'OnlineStatus/OnlineStatus.i18n.php'; |
2038 | | - |
2039 | | - protected $ignored = array( 'onlinestatus-levels' ); |
2040 | | -} |
2041 | | - |
2042 | | -class OpenIDMessageGroup extends ExtensionMessageGroup { |
2043 | | - protected $label = 'OpenID'; |
2044 | | - protected $id = 'ext-openid'; |
2045 | | - |
2046 | | - protected $arrName = 'messages'; |
2047 | | - protected $messageFile = 'OpenID/OpenID.i18n.php'; |
2048 | | -} |
2049 | | - |
2050 | | -class OversightMessageGroup extends ExtensionMessageGroup { |
2051 | | - protected $label = 'Oversight'; |
2052 | | - protected $id = 'ext-oversight'; |
2053 | | - |
2054 | | - protected $arrName = 'messages'; |
2055 | | - protected $messageFile = 'Oversight/HideRevision.i18n.php'; |
2056 | | -} |
2057 | | - |
2058 | | -class PageByMessageGroup extends ExtensionMessageGroup { |
2059 | | - protected $label = 'Page By'; |
2060 | | - protected $id = 'ext-pageby'; |
2061 | | - |
2062 | | - protected $arrName = 'messages'; |
2063 | | - protected $messageFile = 'PageBy/PageBy.i18n.php'; |
2064 | | -} |
2065 | | - |
2066 | | -class PasswordResetMessageGroup extends ExtensionMessageGroup { |
2067 | | - protected $label = 'Password Reset'; |
2068 | | - protected $id = 'ext-passwordreset'; |
2069 | | - |
2070 | | - protected $arrName = 'messages'; |
2071 | | - protected $messageFile = 'PasswordReset/PasswordReset.i18n.php'; |
2072 | | - |
2073 | | -} |
2074 | | - |
2075 | | -class ParserDiffTestMessageGroup extends ExtensionMessageGroup { |
2076 | | - protected $label = 'Parser Diff Test'; |
2077 | | - protected $id = 'ext-parserdifftest'; |
2078 | | - |
2079 | | - protected $arrName = 'messages'; |
2080 | | - protected $messageFile = 'ParserDiffTest/ParserDiffTest.i18n.php'; |
2081 | | -} |
2082 | | - |
2083 | | -class ParserFunctionsMessageGroup extends ExtensionMessageGroup { |
2084 | | - protected $label = 'Parser Functions'; |
2085 | | - protected $id = 'ext-parserfunctions'; |
2086 | | - |
2087 | | - protected $arrName = 'messages'; |
2088 | | - protected $messageFile = 'ParserFunctions/ParserFunctions.i18n.php'; |
2089 | | -} |
2090 | | - |
2091 | | -class PatrollerMessageGroup extends ExtensionMessageGroup { |
2092 | | - protected $label = 'Patroller'; |
2093 | | - protected $id = 'ext-patroller'; |
2094 | | - |
2095 | | - protected $arrName = 'messages'; |
2096 | | - protected $messageFile = 'Patroller/Patroller.i18n.php'; |
2097 | | -} |
2098 | | - |
2099 | | -class PdfHandlerMessageGroup extends ExtensionMessageGroup { |
2100 | | - protected $label = 'Pdf Handler'; |
2101 | | - protected $id = 'ext-pdfhandler'; |
2102 | | - |
2103 | | - protected $arrName = 'messages'; |
2104 | | - protected $messageFile = 'PdfHandler/PdfHandler.i18n.php'; |
2105 | | -} |
2106 | | - |
2107 | | -class PiwikMessageGroup extends ExtensionMessageGroup { |
2108 | | - protected $label = 'Piwik'; |
2109 | | - protected $id = 'ext-piwik'; |
2110 | | - |
2111 | | - protected $arrName = 'messages'; |
2112 | | - protected $messageFile = 'Piwik/Piwik.i18n.php'; |
2113 | | - |
2114 | | - protected $optional = array( |
2115 | | - 'piwik', |
2116 | | - ); |
2117 | | -} |
2118 | | - |
2119 | | -class PlayerMessageGroup extends ExtensionMessageGroup { |
2120 | | - protected $label = 'Player'; |
2121 | | - protected $id = 'ext-player'; |
2122 | | - |
2123 | | - protected $arrName = 'messages'; |
2124 | | - protected $messageFile = 'Player/Player.i18n.php'; |
2125 | | - |
2126 | | - protected $ignored = array( |
2127 | | - 'player-pagetext', |
2128 | | - 'player-imagepage-header', |
2129 | | - ); |
2130 | | -} |
2131 | | - |
2132 | | -class PNGHandlerMessageGroup extends ExtensionMessageGroup { |
2133 | | - protected $label = 'PNG Handler'; |
2134 | | - protected $id = 'ext-pnghandler'; |
2135 | | - |
2136 | | - protected $arrName = 'messages'; |
2137 | | - protected $messageFile = 'PNGHandler/PNGHandler.i18n.php'; |
2138 | | -} |
2139 | | - |
2140 | | -class PoemMessageGroup extends ExtensionMessageGroup { |
2141 | | - protected $label = 'Poem'; |
2142 | | - protected $id = 'ext-poem'; |
2143 | | - |
2144 | | - protected $arrName = 'messages'; |
2145 | | - protected $messageFile = 'Poem/Poem.i18n.php'; |
2146 | | -} |
2147 | | - |
2148 | | -class PostCommentMessageGroup extends ExtensionMessageGroup { |
2149 | | - protected $label = 'Post Comment'; |
2150 | | - protected $id = 'ext-postcomment'; |
2151 | | - |
2152 | | - protected $arrName = 'messages'; |
2153 | | - protected $messageFile = 'Postcomment/SpecialPostcomment.i18n.php'; |
2154 | | -} |
2155 | | - |
2156 | | -class PovWatchMessageGroup extends ExtensionMessageGroup { |
2157 | | - protected $label = 'POV Watch'; |
2158 | | - protected $id = 'ext-povwatch'; |
2159 | | - |
2160 | | - protected $arrName = 'messages'; |
2161 | | - protected $messageFile = 'PovWatch/PovWatch.i18n.php'; |
2162 | | -} |
2163 | | - |
2164 | | -class PreloaderMessageGroup extends ExtensionMessageGroup { |
2165 | | - protected $label = 'Preloader'; |
2166 | | - protected $id = 'ext-preloader'; |
2167 | | - |
2168 | | - protected $arrName = 'messages'; |
2169 | | - protected $messageFile = 'Preloader/Preloader.i18n.php'; |
2170 | | -} |
2171 | | - |
2172 | | -class ProfileMonitorMessageGroup extends ExtensionMessageGroup { |
2173 | | - protected $label = 'Profile Monitor'; |
2174 | | - protected $id = 'ext-profilemonitor'; |
2175 | | - |
2176 | | - protected $arrName = 'messages'; |
2177 | | - protected $messageFile = 'ProfileMonitor/ProfileMonitor.i18n.php'; |
2178 | | -} |
2179 | | - |
2180 | | -class ProofreadPageMessageGroup extends ExtensionMessageGroup { |
2181 | | - protected $label = 'Proofread Page'; |
2182 | | - protected $id = 'ext-proofreadpage'; |
2183 | | - |
2184 | | - protected $arrName = 'messages'; |
2185 | | - protected $messageFile = 'ProofreadPage/ProofreadPage.i18n.php'; |
2186 | | -} |
2187 | | - |
2188 | | -class ProtectSectionMessageGroup extends ExtensionMessageGroup { |
2189 | | - protected $label = 'Protect Section'; |
2190 | | - protected $id = 'ext-protectsection'; |
2191 | | - |
2192 | | - protected $arrName = 'messages'; |
2193 | | - protected $messageFile = 'ProtectSection/ProtectSection.i18n.php'; |
2194 | | -} |
2195 | | - |
2196 | | -class PSINoTocNumMessageGroup extends ExtensionMessageGroup { |
2197 | | - protected $label = 'PSI NoTocNum'; |
2198 | | - protected $id = 'ext-psinotocnum'; |
2199 | | - |
2200 | | - protected $arrName = 'messages'; |
2201 | | - protected $messageFile = 'PSINoTocNum/PSINoTocNum.i18n.php'; |
2202 | | -} |
2203 | | - |
2204 | | -class PurgeMessageGroup extends ExtensionMessageGroup { |
2205 | | - protected $label = 'Purge'; |
2206 | | - protected $id = 'ext-purge'; |
2207 | | - |
2208 | | - protected $arrName = 'messages'; |
2209 | | - protected $messageFile = 'Purge/Purge.i18n.php'; |
2210 | | -} |
2211 | | - |
2212 | | -class PurgeCacheMessageGroup extends ExtensionMessageGroup { |
2213 | | - |
2214 | | - protected $label = 'Purge cache'; |
2215 | | - protected $id = 'ext-purgecache'; |
2216 | | - |
2217 | | - protected $arrName = 'messages'; |
2218 | | - protected $messageFile = 'PurgeCache/PurgeCache.i18n.php'; |
2219 | | -} |
2220 | | - |
2221 | | -class QuizMessageGroup extends ExtensionMessageGroup { |
2222 | | - protected $label = 'Quiz'; |
2223 | | - protected $id = 'ext-quiz'; |
2224 | | - |
2225 | | - protected $arrName = 'messages'; |
2226 | | - protected $messageFile = 'Quiz/Quiz.i18n.php'; |
2227 | | -} |
2228 | | - |
2229 | | -class RandomImageMessageGroup extends ExtensionMessageGroup { |
2230 | | - protected $label = 'Random Image'; |
2231 | | - protected $id = 'ext-randomimage'; |
2232 | | - |
2233 | | - protected $arrName = 'messages'; |
2234 | | - protected $messageFile = 'RandomImage/RandomImage.i18n.php'; |
2235 | | -} |
2236 | | - |
2237 | | -class RandomInCategoryMessageGroup extends ExtensionMessageGroup { |
2238 | | - protected $label = 'Random in Category'; |
2239 | | - protected $id = 'ext-randomincategory'; |
2240 | | - |
2241 | | - protected $arrName = 'messages'; |
2242 | | - protected $messageFile = 'RandomInCategory/SpecialRandomincategory.i18n.php'; |
2243 | | -} |
2244 | | - |
2245 | | -class RandomRootpageMessageGroup extends ExtensionMessageGroup { |
2246 | | - protected $label = 'Random Root Page'; |
2247 | | - protected $id = 'ext-randomrootpage'; |
2248 | | - |
2249 | | - protected $arrName = 'messages'; |
2250 | | - protected $messageFile = 'Randomrootpage/Randomrootpage.i18n.php'; |
2251 | | -} |
2252 | | - |
2253 | | -class RegexBlockMessageGroup extends ExtensionMessageGroup { |
2254 | | - protected $label = 'Regex Block'; |
2255 | | - protected $id = 'ext-regexblock'; |
2256 | | - |
2257 | | - protected $arrName = 'messages'; |
2258 | | - protected $messageFile = 'regexBlock/regexBlock.i18n.php'; |
2259 | | -} |
2260 | | - |
2261 | | -class RenameUserMessageGroup extends ExtensionMessageGroup { |
2262 | | - protected $label = 'Rename User'; |
2263 | | - protected $id = 'ext-renameuser'; |
2264 | | - |
2265 | | - protected $arrName = 'messages'; |
2266 | | - protected $messageFile = 'Renameuser/SpecialRenameuser.i18n.php'; |
2267 | | -} |
2268 | | - |
2269 | | -class ReplaceTextMessageGroup extends ExtensionMessageGroup { |
2270 | | - protected $label = 'Replace Text'; |
2271 | | - protected $id = 'ext-replacetext'; |
2272 | | - |
2273 | | - protected $arrName = 'messages'; |
2274 | | - protected $messageFile = 'ReplaceText/ReplaceText.i18n.php'; |
2275 | | -} |
2276 | | - |
2277 | | -class ReviewMessageGroup extends ExtensionMessageGroup { |
2278 | | - protected $label = 'Review'; |
2279 | | - protected $id = 'ext-review'; |
2280 | | - |
2281 | | - protected $arrName = 'messages'; |
2282 | | - protected $messageFile = 'Review/Review.i18n.php'; |
2283 | | -} |
2284 | | - |
2285 | | -class RightFunctionsMessageGroup extends ExtensionMessageGroup { |
2286 | | - protected $label = 'Right Functions'; |
2287 | | - protected $id = 'ext-rightfunctions'; |
2288 | | - |
2289 | | - protected $arrName = 'messages'; |
2290 | | - protected $messageFile = 'RightFunctions/RightFunctions.i18n.php'; |
2291 | | -} |
2292 | | - |
2293 | | -class SeealsoMessageGroup extends ExtensionMessageGroup { |
2294 | | - protected $label = 'See also'; |
2295 | | - protected $id = 'ext-seealso'; |
2296 | | - |
2297 | | - protected $arrName = 'messages'; |
2298 | | - protected $messageFile = 'Seealso/Seealso.i18n.php'; |
2299 | | -} |
2300 | | - |
2301 | | -class ScanSetMessageGroup extends ExtensionMessageGroup { |
2302 | | - protected $label = 'Scan Set'; |
2303 | | - protected $id = 'ext-scanset'; |
2304 | | - |
2305 | | - protected $arrName = 'messages'; |
2306 | | - protected $messageFile = 'ScanSet/ScanSet.i18n.php'; |
2307 | | -} |
2308 | | - |
2309 | | -class SelectCategoryMessageGroup extends ExtensionMessageGroup { |
2310 | | - protected $label = 'Select Category'; |
2311 | | - protected $id = 'ext-selectcategory'; |
2312 | | - |
2313 | | - protected $arrName = 'messages'; |
2314 | | - protected $messageFile = 'SelectCategory/SelectCategory.i18n.php'; |
2315 | | -} |
2316 | | - |
2317 | | -class SemanticCalendarMessageGroup extends ExtensionMessageGroup { |
2318 | | - protected $label = 'Semantic Calendar'; |
2319 | | - protected $id = 'ext-semanticcalendar'; |
2320 | | - |
2321 | | - protected $arrName = 'messages'; |
2322 | | - protected $messageFile = 'SemanticCalendar/languages/SC_Messages.php'; |
2323 | | -} |
2324 | | - |
2325 | | -class SemanticDrilldownMessageGroup extends ExtensionMessageGroup { |
2326 | | - protected $label = 'Semantic Drilldown'; |
2327 | | - protected $id = 'ext-semanticdrilldown'; |
2328 | | - |
2329 | | - protected $arrName = 'messages'; |
2330 | | - protected $messageFile = 'SemanticDrilldown/languages/SD_Messages.php'; |
2331 | | -} |
2332 | | - |
2333 | | -class SemanticFormsMessageGroup extends ExtensionMessageGroup { |
2334 | | - protected $label = 'Semantic Forms'; |
2335 | | - protected $id = 'ext-semanticforms'; |
2336 | | - |
2337 | | - protected $arrName = 'messages'; |
2338 | | - protected $messageFile = 'SemanticForms/languages/SF_Messages.php'; |
2339 | | -} |
2340 | | - |
2341 | | -class SemanticMediaWikiMessageGroup extends ExtensionMessageGroup { |
2342 | | - protected $label = 'Semantic MediaWiki'; |
2343 | | - protected $id = 'ext-semanticmediawiki'; |
2344 | | - |
2345 | | - protected $arrName = 'messages'; |
2346 | | - protected $messageFile = 'SemanticMediaWiki/languages/SMW_Messages.php'; |
2347 | | - |
2348 | | - protected $ignored = array( |
2349 | | - 'smw_ask_doculink', |
2350 | | - 'smw_service_online_maps', |
2351 | | - 'smw_uri_blacklist', |
2352 | | - ); |
2353 | | - |
2354 | | - protected $optional = array( |
2355 | | - 'smw_rss_link', |
2356 | | - 'smw_decseparator', |
2357 | | - 'smw_kiloseparator', |
2358 | | - 'smw_rss_description', |
2359 | | - 'smw_browse_more', |
2360 | | - 'specialpages-group-smw_group', |
2361 | | - ); |
2362 | | -} |
2363 | | - |
2364 | | -class ShowProcesslistMessageGroup extends ExtensionMessageGroup { |
2365 | | - protected $label = 'Show Processlist'; |
2366 | | - protected $id = 'ext-showprocesslist'; |
2367 | | - |
2368 | | - protected $arrName = 'messages'; |
2369 | | - protected $messageFile = 'ShowProcesslist/ShowProcesslist.i18n.php'; |
2370 | | -} |
2371 | | - |
2372 | | -class SignDocumentMessageGroup extends ExtensionMessageGroup { |
2373 | | - protected $label = 'Sign Document'; |
2374 | | - protected $id = 'ext-signdocument'; |
2375 | | - |
2376 | | - protected $arrName = 'messages'; |
2377 | | - protected $messageFile = 'SignDocument/SignDocument.i18n.php'; |
2378 | | -} |
2379 | | - |
2380 | | -class SignDocumentSpecialCreateMessageGroup extends ExtensionMessageGroup { |
2381 | | - protected $label = 'Sign Document Special Create'; |
2382 | | - protected $id = 'ext-signdocumentspecialcreate'; |
2383 | | - |
2384 | | - protected $arrName = 'messages'; |
2385 | | - protected $messageFile = 'SignDocument/SpecialCreateSignDocument.i18n.php'; |
2386 | | -} |
2387 | | - |
2388 | | -class SignDocumentSpecialMessageGroup extends ExtensionMessageGroup { |
2389 | | - protected $label = 'Sign Document Special'; |
2390 | | - protected $id = 'ext-signdocumentspecial'; |
2391 | | - |
2392 | | - protected $arrName = 'messages'; |
2393 | | - protected $messageFile = 'SignDocument/SpecialSignDocument.i18n.php'; |
2394 | | -} |
2395 | | - |
2396 | | -class SimpleAntiSpamMessageGroup extends ExtensionMessageGroup { |
2397 | | - protected $label = 'Simple Anti Spam'; |
2398 | | - protected $id = 'ext-simpleantispam'; |
2399 | | - |
2400 | | - protected $arrName = 'messages'; |
2401 | | - protected $messageFile = 'SimpleAntiSpam/SimpleAntiSpam.i18n.php'; |
2402 | | -} |
2403 | | - |
2404 | | -class SiteMatrixMessageGroup extends ExtensionMessageGroup { |
2405 | | - protected $label = 'Site Matrix'; |
2406 | | - protected $id = 'ext-sitematrix'; |
2407 | | - |
2408 | | - protected $arrName = 'messages'; |
2409 | | - protected $messageFile = 'SiteMatrix/SiteMatrix.i18n.php'; |
2410 | | -} |
2411 | | - |
2412 | | -class SkinPerPageMessageGroup extends ExtensionMessageGroup { |
2413 | | - protected $label = 'Skin Per Page'; |
2414 | | - protected $id = 'ext-skinperpage'; |
2415 | | - |
2416 | | - protected $arrName = 'messages'; |
2417 | | - protected $messageFile = 'SkinPerPage/SkinPerPage.i18n.php'; |
2418 | | -} |
2419 | | - |
2420 | | -class SmoothGalleryMessageGroup extends ExtensionMessageGroup { |
2421 | | - protected $label = 'Smooth Gallery'; |
2422 | | - protected $id = 'ext-smoothgallery'; |
2423 | | - |
2424 | | - protected $arrName = 'messages'; |
2425 | | - protected $messageFile = 'SmoothGallery/SmoothGallery.i18n.php'; |
2426 | | - |
2427 | | - protected $ignored = array( |
2428 | | - 'smoothgallery-pagetext', |
2429 | | - ); |
2430 | | -} |
2431 | | - |
2432 | | -class SocialProfileUserBoardMessageGroup extends ExtensionMessageGroup { |
2433 | | - protected $label = 'Social Profile User Board'; |
2434 | | - protected $id = 'ext-socialprofileuserboard'; |
2435 | | - |
2436 | | - protected $arrName = 'messages'; |
2437 | | - protected $messageFile = 'SocialProfile/UserBoard/UserBoard.i18n.php'; |
2438 | | -} |
2439 | | - |
2440 | | -class SocialProfileUserProfileMessageGroup extends ExtensionMessageGroup { |
2441 | | - protected $label = 'Social Profile User Profile'; |
2442 | | - protected $id = 'ext-socialprofileuserprofile'; |
2443 | | - |
2444 | | - protected $arrName = 'messages'; |
2445 | | - protected $messageFile = 'SocialProfile/UserProfile/UserProfile.i18n.php'; |
2446 | | -} |
2447 | | - |
2448 | | -class SocialProfileUserRelationshipMessageGroup extends ExtensionMessageGroup { |
2449 | | - protected $label = 'Social Profile User Relationship'; |
2450 | | - protected $id = 'ext-socialprofileuserrelationship'; |
2451 | | - |
2452 | | - protected $arrName = 'messages'; |
2453 | | - protected $messageFile = 'SocialProfile/UserRelationship/UserRelationship.i18n.php'; |
2454 | | -} |
2455 | | - |
2456 | | -class SpamBlacklistMessageGroup extends ExtensionMessageGroup { |
2457 | | - protected $label = 'Spam Blacklist'; |
2458 | | - protected $id = 'ext-spamblacklist'; |
2459 | | - |
2460 | | - protected $arrName = 'messages'; |
2461 | | - protected $messageFile = 'SpamBlacklist/SpamBlacklist.i18n.php'; |
2462 | | -} |
2463 | | - |
2464 | | -class SpamDiffToolMessageGroup extends ExtensionMessageGroup { |
2465 | | - protected $label = 'Spam Diff Tool'; |
2466 | | - protected $id = 'ext-spamdifftool'; |
2467 | | - |
2468 | | - protected $arrName = 'messages'; |
2469 | | - protected $messageFile = 'SpamDiffTool/SpamDiffTool.i18n.php'; |
2470 | | -} |
2471 | | - |
2472 | | -class SpamRegExMessageGroup extends ExtensionMessageGroup { |
2473 | | - protected $label = 'Spam Regex'; |
2474 | | - protected $id = 'ext-spamregex'; |
2475 | | - |
2476 | | - protected $arrName = 'messages'; |
2477 | | - protected $messageFile = 'SpamRegex/SpamRegex.i18n.php'; |
2478 | | -} |
2479 | | - |
2480 | | -class SpecialFileListMessageGroup extends ExtensionMessageGroup { |
2481 | | - protected $label = 'Special File List'; |
2482 | | - protected $id = 'ext-specialfilelist'; |
2483 | | - |
2484 | | - protected $arrName = 'messages'; |
2485 | | - protected $messageFile = 'SpecialFileList/SpecialFilelist.i18n.php'; |
2486 | | -} |
2487 | | - |
2488 | | -class SpecialFormMessageGroup extends ExtensionMessageGroup { |
2489 | | - protected $label = 'Special Form'; |
2490 | | - protected $id = 'ext-specialform'; |
2491 | | - |
2492 | | - protected $arrName = 'messages'; |
2493 | | - protected $messageFile = 'SpecialForm/SpecialForm.i18n.php'; |
2494 | | - |
2495 | | - protected $ignored = array( |
2496 | | - 'formtemplatepattern', |
2497 | | - ); |
2498 | | -} |
2499 | | - |
2500 | | -class SubPageList3MessageGroup extends ExtensionMessageGroup { |
2501 | | - protected $label = 'Sub Page List 3'; |
2502 | | - protected $id = 'ext-subpagelist3'; |
2503 | | - |
2504 | | - protected $arrName = 'messages'; |
2505 | | - protected $messageFile = 'SubPageList3/SubPageList3.i18n.php'; |
2506 | | -} |
2507 | | - |
2508 | | -class StalePagesMessageGroup extends ExtensionMessageGroup { |
2509 | | - protected $label = 'Stale Pages'; |
2510 | | - protected $id = 'ext-stalepages'; |
2511 | | - |
2512 | | - protected $arrName = 'messages'; |
2513 | | - protected $messageFile = 'StalePages/StalePages.i18n.php'; |
2514 | | -} |
2515 | | - |
2516 | | -class SyntaxHighlight_GeSHiMessageGroup extends ExtensionMessageGroup { |
2517 | | - protected $label = 'Syntax Highlight GeSHi'; |
2518 | | - protected $id = 'ext-syntaxhighlightgeshi'; |
2519 | | - |
2520 | | - protected $arrName = 'messages'; |
2521 | | - protected $messageFile = 'SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.i18n.php'; |
2522 | | -} |
2523 | | - |
2524 | | -class Tab0MessageGroup extends ExtensionMessageGroup { |
2525 | | - protected $label = 'Tab 0'; |
2526 | | - protected $id = 'ext-tab0'; |
2527 | | - |
2528 | | - protected $arrName = 'messages'; |
2529 | | - protected $messageFile = 'Tab0/Tab0.i18n.php'; |
2530 | | -} |
2531 | | - |
2532 | | -class TalkHereMessageGroup extends ExtensionMessageGroup { |
2533 | | - protected $label = 'Talk Here'; |
2534 | | - protected $id = 'ext-talkhere'; |
2535 | | - |
2536 | | - protected $arrName = 'messages'; |
2537 | | - protected $messageFile = 'TalkHere/TalkHere.i18n.php'; |
2538 | | - |
2539 | | - protected $ignored = array( |
2540 | | - 'talkhere-title', |
2541 | | - 'talkhere-headtext', |
2542 | | - 'talkhere-afterinput', |
2543 | | - 'talkhere-afterform', |
2544 | | - ); |
2545 | | -} |
2546 | | - |
2547 | | -class TemplateLinkMessageGroup extends ExtensionMessageGroup { |
2548 | | - protected $label = 'Template Link'; |
2549 | | - protected $id = 'ext-templatelink'; |
2550 | | - |
2551 | | - protected $arrName = 'messages'; |
2552 | | - protected $messageFile = 'TemplateLink/TemplateLink.i18n.php'; |
2553 | | -} |
2554 | | - |
2555 | | -class TidyTabMessageGroup extends ExtensionMessageGroup { |
2556 | | - protected $label = 'TidyTab'; |
2557 | | - protected $id = 'ext-tidytab'; |
2558 | | - |
2559 | | - protected $arrName = 'messages'; |
2560 | | - protected $messageFile = 'TidyTab/Tidy.i18n.php'; |
2561 | | -} |
2562 | | - |
2563 | | -class ThrottleMessageGroup extends ExtensionMessageGroup { |
2564 | | - protected $label = 'Throttle'; |
2565 | | - protected $id = 'ext-throttle'; |
2566 | | - |
2567 | | - protected $arrName = 'messages'; |
2568 | | - protected $messageFile = 'Throttle/UserThrottle.i18n.php'; |
2569 | | -} |
2570 | | - |
2571 | | -class TimelineMessageGroup extends ExtensionMessageGroup { |
2572 | | - protected $label = 'Timeline'; |
2573 | | - protected $id = 'ext-timeline'; |
2574 | | - |
2575 | | - protected $arrName = 'messages'; |
2576 | | - protected $messageFile = 'timeline/Timeline.i18n.php'; |
2577 | | -} |
2578 | | - |
2579 | | -class TitleBlacklistMessageGroup extends ExtensionMessageGroup { |
2580 | | - protected $label = 'Title Blacklist'; |
2581 | | - protected $id = 'ext-titleblacklist'; |
2582 | | - |
2583 | | - protected $arrName = 'messages'; |
2584 | | - protected $messageFile = 'TitleBlacklist/TitleBlacklist.i18n.php'; |
2585 | | -} |
2586 | | - |
2587 | | -class TitleKeyMessageGroup extends ExtensionMessageGroup { |
2588 | | - protected $label = 'Title Key'; |
2589 | | - protected $id = 'ext-titlekey'; |
2590 | | - |
2591 | | - protected $arrName = 'messages'; |
2592 | | - protected $messageFile = 'TitleKey/TitleKey.i18n.php'; |
2593 | | -} |
2594 | | - |
2595 | | -class TodoMessageGroup extends ExtensionMessageGroup { |
2596 | | - protected $label = 'Todo'; |
2597 | | - protected $id = 'ext-todo'; |
2598 | | - |
2599 | | - protected $arrName = 'messages'; |
2600 | | - protected $messageFile = 'Todo/SpecialTodo.i18n.php'; |
2601 | | -} |
2602 | | - |
2603 | | -class TodoTasksMessageGroup extends ExtensionMessageGroup { |
2604 | | - protected $label = 'Todo Tasks'; |
2605 | | - protected $id = 'ext-todotasks'; |
2606 | | - |
2607 | | - protected $arrName = 'messages'; |
2608 | | - protected $messageFile = 'TodoTasks/SpecialTaskList.i18n.php'; |
2609 | | -} |
2610 | | - |
2611 | | -class TooltipMessageGroup extends ExtensionMessageGroup { |
2612 | | - protected $label = 'Tool Tip'; |
2613 | | - protected $id = 'ext-tooltip'; |
2614 | | - |
2615 | | - protected $arrName = 'messages'; |
2616 | | - protected $messageFile = 'Tooltip/Tooltip.i18n.php'; |
2617 | | -} |
2618 | | - |
2619 | | -class TranslateMessageGroup extends ExtensionMessageGroup { |
2620 | | - protected $label = 'Translate'; |
2621 | | - protected $id = 'ext-translate'; |
2622 | | - |
2623 | | - protected $arrName = 'messages'; |
2624 | | - protected $messageFile = 'Translate/Translate.i18n.php'; |
2625 | | - |
2626 | | - protected $optional = array( |
2627 | | - 'translate-page-paging-links', |
2628 | | - ); |
2629 | | -} |
2630 | | - |
2631 | | -class TorBlockMessageGroup extends ExtensionMessageGroup { |
2632 | | - protected $label = 'TOr Block'; |
2633 | | - protected $id = 'ext-torblock'; |
2634 | | - |
2635 | | - protected $arrName = 'messages'; |
2636 | | - protected $messageFile = 'TorBlock/TorBlock.i18n.php'; |
2637 | | -} |
2638 | | - |
2639 | | - |
2640 | | - |
2641 | | -class UsageStatisticsMessageGroup extends ExtensionMessageGroup { |
2642 | | - protected $label = 'Usage Statistics'; |
2643 | | - protected $id = 'ext-usagestatistics'; |
2644 | | - |
2645 | | - protected $arrName = 'messages'; |
2646 | | - protected $messageFile = 'UsageStatistics/SpecialUserStats.i18n.php'; |
2647 | | -} |
2648 | | - |
2649 | | -class UserContactLinksMessageGroup extends ExtensionMessageGroup { |
2650 | | - protected $label = 'User Contact Links'; |
2651 | | - protected $id = 'ext-usercontactlinks'; |
2652 | | - |
2653 | | - protected $arrName = 'messages'; |
2654 | | - protected $messageFile = 'UserContactLinks/UserSignature.i18n.php'; |
2655 | | -} |
2656 | | - |
2657 | | -class UserImagesMessageGroup extends ExtensionMessageGroup { |
2658 | | - protected $label = 'User Images'; |
2659 | | - protected $id = 'ext-userimages'; |
2660 | | - |
2661 | | - protected $arrName = 'messages'; |
2662 | | - protected $messageFile = 'UserImages/UserImages.i18n.php'; |
2663 | | -} |
2664 | | - |
2665 | | -class UserMergeMessageGroup extends ExtensionMessageGroup { |
2666 | | - protected $label = 'User Merge'; |
2667 | | - protected $id = 'ext-usermerge'; |
2668 | | - |
2669 | | - protected $arrName = 'messages'; |
2670 | | - protected $messageFile = 'UserMerge/UserMerge.i18n.php'; |
2671 | | -} |
2672 | | - |
2673 | | -class UsernameBlacklistMessageGroup extends ExtensionMessageGroup { |
2674 | | - protected $label = 'Username Blacklist'; |
2675 | | - protected $id = 'ext-usernameblacklist'; |
2676 | | - |
2677 | | - protected $arrName = 'messages'; |
2678 | | - protected $messageFile = 'UsernameBlacklist/UsernameBlacklist.i18n.php'; |
2679 | | -} |
2680 | | - |
2681 | | -class UserRightsNotifMessageGroup extends ExtensionMessageGroup { |
2682 | | - protected $label = 'User Rights Notification'; |
2683 | | - protected $id = 'ext-userrightsnotif'; |
2684 | | - |
2685 | | - protected $arrName = 'messages'; |
2686 | | - protected $messageFile = 'UserRightsNotif/UserRightsNotif.i18n.php'; |
2687 | | -} |
2688 | | - |
2689 | | -class VoteMessageGroup extends ExtensionMessageGroup { |
2690 | | - protected $label = 'Vote'; |
2691 | | - protected $id = 'ext-vote'; |
2692 | | - |
2693 | | - protected $arrName = 'messages'; |
2694 | | - protected $messageFile = 'Vote/Vote.i18n.php'; |
2695 | | -} |
2696 | | - |
2697 | | -class WatchersMessageGroup extends ExtensionMessageGroup { |
2698 | | - protected $label = 'Watchers'; |
2699 | | - protected $id = 'ext-watchers'; |
2700 | | - |
2701 | | - protected $arrName = 'messages'; |
2702 | | - protected $messageFile = 'Watchers/Watchers.i18n.php'; |
2703 | | -} |
2704 | | - |
2705 | | -class WatchSubpagesMessageGroup extends ExtensionMessageGroup { |
2706 | | - protected $label = 'Watch Subpages'; |
2707 | | - protected $id = 'ext-watchsubpages'; |
2708 | | - |
2709 | | - protected $arrName = 'messages'; |
2710 | | - protected $messageFile = 'WatchSubpages/WatchSubpages.i18n.php'; |
2711 | | -} |
2712 | | - |
2713 | | -class WebStoreMessageGroup extends ExtensionMessageGroup { |
2714 | | - protected $label = 'Web Store'; |
2715 | | - protected $id = 'ext-webstore'; |
2716 | | - |
2717 | | - protected $arrName = 'messages'; |
2718 | | - protected $messageFile = 'WebStore/WebStore.i18n.php'; |
2719 | | -} |
2720 | | - |
2721 | | -class WhiteListMessageGroup extends ExtensionMessageGroup { |
2722 | | - protected $label = 'White List'; |
2723 | | - protected $id = 'ext-whitelist'; |
2724 | | - |
2725 | | - protected $arrName = 'allMessages'; |
2726 | | - protected $messageFile = 'WhiteList/SpecialWhitelistEdit.i18n.php'; |
2727 | | -} |
2728 | | - |
2729 | | -class WhoIsWatchingMessageGroup extends ExtensionMessageGroup { |
2730 | | - protected $label = 'Who Is Watching'; |
2731 | | - protected $id = 'ext-whoiswatching'; |
2732 | | - |
2733 | | - protected $arrName = 'messages'; |
2734 | | - protected $messageFile = 'WhoIsWatching/SpecialWhoIsWatching.i18n.php'; |
2735 | | -} |
2736 | | - |
2737 | | -class WikidataLanguageManagerMessageGroup extends ExtensionMessageGroup { |
2738 | | - protected $label = 'Wikidata Language Manager'; |
2739 | | - protected $id = 'ext-wikidatalanguagemanager'; |
2740 | | - |
2741 | | - protected $arrName = 'wdMessages'; |
2742 | | - protected $messageFile = 'Wikidata/SpecialLanguages.i18n.php'; |
2743 | | - |
2744 | | - protected $ignored = array( 'ow_editing_policy_url' ); |
2745 | | -} |
2746 | | - |
2747 | | -class WikihieroMessageGroup extends ExtensionMessageGroup { |
2748 | | - protected $label = 'Wikihiero'; |
2749 | | - protected $id = 'ext-wikihiero'; |
2750 | | - |
2751 | | - protected $arrName = 'messages'; |
2752 | | - protected $messageFile = 'wikihiero/wikihiero.i18n.php'; |
2753 | | -} |
2754 | | - |
2755 | | -class WoopraMessageGroup extends ExtensionMessageGroup { |
2756 | | - protected $label = 'Woopra'; |
2757 | | - protected $id = 'ext-woopra'; |
2758 | | - |
2759 | | - protected $arrName = 'messages'; |
2760 | | - protected $messageFile = 'Woopra/Woopra.i18n.php'; |
2761 | | -} |
2762 | | - |
2763 | | -class YUIMessageGroup extends ExtensionMessageGroup { |
2764 | | - protected $label = 'YUI'; |
2765 | | - protected $id = 'ext-yui'; |
2766 | | - |
2767 | | - protected $arrName = 'messages'; |
2768 | | - protected $messageFile = 'SocialProfile/YUI/yui.i18n.php'; |
2769 | | -} |
2770 | | - |
2771 | | -class YouTubeAuthSubMessageGroup extends ExtensionMessageGroup { |
2772 | | - protected $label = 'YouTube Auth Sub'; |
2773 | | - protected $id = 'ext-youtubeauthsub'; |
2774 | | - |
2775 | | - protected $arrName = 'messages'; |
2776 | | - protected $messageFile = 'YouTubeAuthSub/YouTubeAuthSub.i18n.php'; |
2777 | | -} |
2778 | | - |
2779 | 464 | class Word2MediaWikiPlusMessageGroup extends ExtensionMessageGroup { |
2780 | 465 | protected $label = 'Word2MediaWiki Plus'; |
2781 | 466 | protected $id = 'out-word2mediawikiplus'; |
2782 | | - |
2783 | | - protected $arrName = 'messages'; |
2784 | 467 | protected $messageFile = 'Translate/external/Word2MediaWikiPlus/Word2MediaWikiPlus.i18n.php'; |
2785 | 468 | } |
2786 | 469 | |
| 470 | + |
2787 | 471 | class FreeColMessageGroup extends MessageGroup { |
2788 | 472 | protected $fileExporter = 'CoreExporter'; |
2789 | 473 | protected $label = 'FreeCol (open source game)'; |
— | — | @@ -2810,11 +494,6 @@ |
2811 | 495 | $this->mangler = new StringMatcher( $this->prefix, array( '*' ) ); |
2812 | 496 | } |
2813 | 497 | |
2814 | | - public function getMessage( $key, $code ) { |
2815 | | - $this->load( $code ); |
2816 | | - return isset( $this->mcache[$code][$key] ) ? $this->mcache[$code][$key] : null; |
2817 | | - } |
2818 | | - |
2819 | 498 | public function getMessageFile( $code ) { |
2820 | 499 | if ( $code == 'en' ) { |
2821 | 500 | return 'FreeColMessages.properties'; |
— | — | @@ -2830,88 +509,17 @@ |
2831 | 510 | return $this->fileDir . $this->getMessageFile( $code ); |
2832 | 511 | } |
2833 | 512 | |
2834 | | - private function load( $code ) { |
2835 | | - if ( isset($this->mcache[$code]) ) return; |
2836 | | - |
2837 | | - $filename = $this->getFileLocation( $code ); |
2838 | | - |
2839 | | - $lines = false; |
2840 | | - if ( file_exists( $filename ) ) { |
2841 | | - $lines = file( $filename ); |
2842 | | - } else { |
2843 | | - # No such localisation, fall out |
2844 | | - $this->mcache[$code] = null; |
2845 | | - return; |
2846 | | - } |
2847 | | - |
2848 | | - if ( !$lines ) { return; } |
2849 | | - |
2850 | | - foreach ( $lines as $line ) { |
2851 | | - if ( !strpos( $line, '=' ) ) { continue; } |
2852 | | - list( $key, $string ) = explode( '=', $line, 2 ); |
2853 | | - $this->mcache[$code][$this->mangler->mangle($key)] = trim($string); |
2854 | | - } |
2855 | | - |
| 513 | + public function getReader( $code ) { |
| 514 | + return new JavaFormatReader( $this->getFileLocation( $code ) ); |
2856 | 515 | } |
2857 | 516 | |
2858 | | - public function export( MessageCollection $messages ) { |
2859 | | - return $this->exportToFile( $messages, array() ); |
| 517 | + public function getWriter() { |
| 518 | + return new JavaFormatWriter( $this ); |
2860 | 519 | } |
2861 | 520 | |
2862 | | - public function exportToFile( MessageCollection $messages, $authors ) { |
2863 | | - global $wgSitename, $wgRequest; |
2864 | | - $txt = '# Exported on ' . wfTimestamp(TS_ISO_8601) . ' from ' . $wgSitename . "\n#\n"; |
2865 | | - if ( count( $authors ) ) { |
2866 | | - $txt .= $this->formatAuthors( $authors ) . "\n"; |
2867 | | - } |
2868 | | - |
2869 | | - $array = $this->makeExportArray( $messages ); |
2870 | | - foreach ($array as $key => $translation) { |
2871 | | - $txt .= $key . '=' . rtrim( $translation ) . "\n"; |
2872 | | - } |
2873 | | - return $txt; |
2874 | | - } |
2875 | | - |
2876 | | - protected function formatAuthors( $authors ) { |
2877 | | - $s = array(); |
2878 | | - foreach ( $authors as $a ) { |
2879 | | - $s[] = "# Author: $a"; |
2880 | | - } |
2881 | | - return implode( "\n", $s ); |
2882 | | - } |
2883 | | - |
2884 | | - function fill( MessageCollection $messages ) { |
2885 | | - $this->load( $messages->code ); |
2886 | | - |
2887 | | - foreach ( $messages->keys() as $key ) { |
2888 | | - if ( isset($this->mcache[$messages->code][$key]) ) { |
2889 | | - $messages[$key]->infile = $this->mcache[$messages->code][$key]; |
2890 | | - } |
2891 | | - } |
2892 | | - } |
2893 | | - |
2894 | | - function getDefinitions() { |
2895 | | - $this->load('en'); |
2896 | | - return $this->mcache['en']; |
2897 | | - } |
2898 | | - |
2899 | 521 | } |
2900 | 522 | |
2901 | 523 | class WikiMessageGroup extends MessageGroup { |
2902 | | - /** |
2903 | | - * Human-readable name of this group |
2904 | | - */ |
2905 | | - protected $label = 'none'; |
2906 | | - |
2907 | | - /** |
2908 | | - * Group-wide unique id of this group. Used also for sorting. |
2909 | | - */ |
2910 | | - protected $id = 'none'; |
2911 | | - |
2912 | | - /** |
2913 | | - * Name of the page in Mediawiki-namespace that contains white-space separated |
2914 | | - * list of message keys. |
2915 | | - */ |
2916 | 524 | protected $source = null; |
2917 | 525 | |
2918 | 526 | /** |
— | — | @@ -2926,11 +534,8 @@ |
2927 | 535 | $this->source = $source; |
2928 | 536 | } |
2929 | 537 | |
2930 | | - /* Implemted functions */ |
2931 | | - |
2932 | | - /* Do nothing, as there is no "source file". */ |
2933 | 538 | public function fill( MessageCollection $messages ) { |
2934 | | - return; |
| 539 | + return; // no-op |
2935 | 540 | } |
2936 | 541 | |
2937 | 542 | /* Fetch definitions from database */ |
— | — | @@ -2966,41 +571,35 @@ |
2967 | 572 | return wfEmptyMsg( $key, $message ) ? null : $message; |
2968 | 573 | } |
2969 | 574 | |
2970 | | - /* New functions */ |
| 575 | +} |
2971 | 576 | |
2972 | | - /** |
2973 | | - * Sets a description of this group. It will be parsed as wikitext. |
2974 | | - * |
2975 | | - * @param $description The description. |
2976 | | - */ |
2977 | | - public function setDescription( $description ) { |
2978 | | - $this->description = $description; |
2979 | | - } |
| 577 | +class MessageGroups { |
| 578 | + public static function init() { |
| 579 | + static $loaded = false; |
| 580 | + if ( $loaded ) return; |
2980 | 581 | |
2981 | | - /** |
2982 | | - * Sets a label for this group. |
2983 | | - * |
2984 | | - * @param $label The label. |
2985 | | - */ |
2986 | | - public function setLabel( $label ) { |
2987 | | - $this->label = $label; |
2988 | | - } |
| 582 | + global $wgTranslateAddMWExtensionGroups; |
| 583 | + if ($wgTranslateAddMWExtensionGroups) { |
| 584 | + $a = new PremadeMediawikiExtensionGroups; |
| 585 | + $a->addAll(); |
| 586 | + } |
2989 | 587 | |
2990 | | - /** |
2991 | | - * Sets meta status for this group. |
2992 | | - * |
2993 | | - * @param $value Boolean value |
2994 | | - */ |
2995 | | - public function setMeta( $value ) { |
2996 | | - $this->meta = (bool) $value; |
| 588 | + global $wgTranslateCC; |
| 589 | + wfRunHooks('TranslatePostInitGroups', array( &$wgTranslateCC ) ); |
| 590 | + $loaded = true; |
2997 | 591 | } |
2998 | | -} |
2999 | 592 | |
3000 | | -class MessageGroups { |
3001 | 593 | public static function getGroup( $id ) { |
| 594 | + self::init(); |
| 595 | + |
3002 | 596 | global $wgTranslateEC, $wgTranslateAC, $wgTranslateCC; |
3003 | | - if ( in_array( $id, $wgTranslateEC) ) { |
3004 | | - return new $wgTranslateAC[$id]; |
| 597 | + if ( in_array( $id, $wgTranslateEC ) ) { |
| 598 | + $creater = $wgTranslateAC[$id]; |
| 599 | + if ( is_array( $creater ) ) { |
| 600 | + return call_user_func( $creater, $id ); |
| 601 | + } else { |
| 602 | + return new $creater; |
| 603 | + } |
3005 | 604 | } else { |
3006 | 605 | if ( array_key_exists( $id, $wgTranslateCC ) ) { |
3007 | 606 | if ( is_callable( $wgTranslateCC[$id] ) ) { |
— | — | @@ -3016,6 +615,7 @@ |
3017 | 616 | |
3018 | 617 | public $classes = array(); |
3019 | 618 | private function __construct() { |
| 619 | + self::init(); |
3020 | 620 | global $wgTranslateEC, $wgTranslateCC; |
3021 | 621 | |
3022 | 622 | $all = array_merge( $wgTranslateEC, array_keys( $wgTranslateCC ) ); |
Index: trunk/extensions/Translate/ffs/Simple.php |
— | — | @@ -0,0 +1,272 @@ |
| 2 | +<?php |
| 3 | +if (!defined('MEDIAWIKI')) die(); |
| 4 | +/** |
| 5 | + * Simple file format handler for testing import and export. |
| 6 | + * |
| 7 | + * @author Niklas Laxström |
| 8 | + * @copyright Copyright © 2008, Niklas Laxström |
| 9 | + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
| 10 | + * @file |
| 11 | + */ |
| 12 | + |
| 13 | +class SimpleFormatReader { |
| 14 | + const SEPARATOR = '----'; |
| 15 | + const AUTHORPREFIX = 'Author: '; |
| 16 | + |
| 17 | + // One reader per file |
| 18 | + protected $filename = false; |
| 19 | + |
| 20 | + public function __construct( $filename ) { |
| 21 | + if ( is_readable( $filename ) ) { |
| 22 | + $this->filename = $filename; |
| 23 | + } |
| 24 | + } |
| 25 | + |
| 26 | + protected $authors, $staticHeader; |
| 27 | + |
| 28 | + public function parseAuthors() { |
| 29 | + if ( $this->authors === null ) { |
| 30 | + $this->parseHeader(); |
| 31 | + } |
| 32 | + return $this->authors; |
| 33 | + } |
| 34 | + |
| 35 | + public function parseStaticHeader() { |
| 36 | + if ( $this->staticHeader === null ) { |
| 37 | + $this->parseHeader(); |
| 38 | + } |
| 39 | + return $this->staticHeader; |
| 40 | + } |
| 41 | + |
| 42 | + protected function parseHeader() { |
| 43 | + if ( $this->filename === false ) { |
| 44 | + return ''; |
| 45 | + } |
| 46 | + |
| 47 | + $authors = array(); |
| 48 | + $staticHeader = ''; |
| 49 | + |
| 50 | + $handle = fopen( $this->filename, "rt" ); |
| 51 | + $state = 0; |
| 52 | + |
| 53 | + while ( !feof($handle) ) { |
| 54 | + $line = fgets($handle); |
| 55 | + |
| 56 | + if ( $state === 0 ) { |
| 57 | + if ( $line === "\n" ) { |
| 58 | + $state = 1; |
| 59 | + continue; |
| 60 | + } |
| 61 | + |
| 62 | + $prefixLength = strlen(self::AUTHORPREFIX); |
| 63 | + $prefix = substr( $line, 0, $prefixLength ); |
| 64 | + if ( strcasecmp( $prefix, self::AUTHORPREFIX ) === 0 ) { |
| 65 | + $authors[] = substr( $line, $prefixLength ); |
| 66 | + } |
| 67 | + } elseif ( $state === 1 ) { |
| 68 | + if ( $line === self::SEPARATOR ) break; // End of static header, if any |
| 69 | + $staticHeader .= $line; |
| 70 | + } |
| 71 | + } |
| 72 | + |
| 73 | + fclose( $handle ); |
| 74 | + |
| 75 | + $this->authors = $authors; |
| 76 | + $this->staticHeader = $staticHeader; |
| 77 | + |
| 78 | + } |
| 79 | + |
| 80 | + protected $messagePattern = '/([^\0]+)\0([^\0]+)\0\n/U'; |
| 81 | + public function parseMessages( StringMangler $mangler ) { |
| 82 | + |
| 83 | + $data = file_get_contents( $this->filename ); |
| 84 | + $messages = array(); |
| 85 | + $matches = array(); |
| 86 | + |
| 87 | + $match = array(); |
| 88 | + preg_match_all( $this->messagePattern, $data, $matches, PREG_SET_ORDER ); |
| 89 | + foreach ( $matches as $match ) { |
| 90 | + list( , $key, $value ) = $match; |
| 91 | + $messages[$key] = $value; |
| 92 | + } |
| 93 | + |
| 94 | + return $messages; |
| 95 | + |
| 96 | + } |
| 97 | + |
| 98 | + |
| 99 | +} |
| 100 | + |
| 101 | +class SimpleFormatWriter { |
| 102 | + |
| 103 | + const SEPARATOR = '----'; |
| 104 | + const AUTHORPREFIX = 'Author: '; |
| 105 | + |
| 106 | + // Stored objects |
| 107 | + protected $group; |
| 108 | + |
| 109 | + // Stored data |
| 110 | + protected $authors, $staticHeader; |
| 111 | + |
| 112 | + public function __construct( MessageGroup $group ) { |
| 113 | + $this->group = $group; |
| 114 | + } |
| 115 | + |
| 116 | + public function addAuthors( array $authors, $code ) { |
| 117 | + if ( $this->authors === null ) { |
| 118 | + $this->authors = array(); |
| 119 | + } |
| 120 | + |
| 121 | + if ( !isset($this->authors[$code]) ) { |
| 122 | + $this->authors[$code] = array(); |
| 123 | + } |
| 124 | + |
| 125 | + $this->authors[$code] += $authors; |
| 126 | + } |
| 127 | + |
| 128 | + public function load( $code ) { |
| 129 | + $reader = $this->group->getReader( $code ); |
| 130 | + if ( $reader ) { |
| 131 | + $this->addAuthors( $reader->parseAuthors(), $code ); |
| 132 | + $this->staticHeader = $reader->parseStaticHeader(); |
| 133 | + } |
| 134 | + } |
| 135 | + |
| 136 | + |
| 137 | + public function fileExport( array $languages, $targetDirectory ) { |
| 138 | + global $wgTranslateExtensionDirectory; |
| 139 | + foreach ( $languages as $code ) { |
| 140 | + $messages = $this->getMessagesForExport( $this->group, $code ); |
| 141 | + $filename = $this->group->getMessageFile( $code ); |
| 142 | + $target = $targetDirectory . '/' . $filename; |
| 143 | + |
| 144 | + wfMkdirParents( dirname( $target ) ); |
| 145 | + $tHandle = fopen( $target, 'wt' ); |
| 146 | + if ( $tHandle === false ) { |
| 147 | + throw new MWException( "Unable to open target for writing" ); |
| 148 | + } |
| 149 | + |
| 150 | + $this->exportLanguage( $tHandle, $code, $messages ); |
| 151 | + |
| 152 | + fclose( $tHandle ); |
| 153 | + } |
| 154 | + } |
| 155 | + |
| 156 | + public function webExport( MessageCollection $MG ) { |
| 157 | + global $wgTranslateExtensionDirectory; |
| 158 | + $messages = $this->makeExportArray( $MG ); |
| 159 | + $filename = $this->group->getMessageFile( $MG->code ); |
| 160 | + |
| 161 | + $tHandle = fopen( 'php://temp', 'wt' ); |
| 162 | + |
| 163 | + $this->exportLanguage( $tHandle, $MG->code, $messages ); |
| 164 | + |
| 165 | + rewind( $tHandle ); |
| 166 | + $data = stream_get_contents( $tHandle ); |
| 167 | + fclose( $tHandle ); |
| 168 | + return $data; |
| 169 | + } |
| 170 | + |
| 171 | + protected function getMessagesForExport( MessageGroup $group, $code ) { |
| 172 | + $messages = new MessageCollection( $code ); |
| 173 | + $definitions = $this->group->getDefinitions(); |
| 174 | + foreach ( $definitions as $key => $definition ) { |
| 175 | + $messages->add( new TMessage( $key, $definition ) ); |
| 176 | + } |
| 177 | + |
| 178 | + $bools = $this->group->getBools(); |
| 179 | + foreach ( $bools['optional'] as $key ) { |
| 180 | + if ( isset($messages[$key]) ) { |
| 181 | + $messages[$key]->optional = true; |
| 182 | + } |
| 183 | + } |
| 184 | + |
| 185 | + foreach ( $bools['ignored'] as $key ) { |
| 186 | + if ( isset($messages[$key]) ) { |
| 187 | + unset($messages[$key]); |
| 188 | + } |
| 189 | + } |
| 190 | + |
| 191 | + $messages->populatePageExistence(); |
| 192 | + $messages->populateTranslationsFromDatabase(); |
| 193 | + $this->group->fill( $messages ); |
| 194 | + |
| 195 | + return $this->makeExportArray( $messages ); |
| 196 | + } |
| 197 | + |
| 198 | + protected function exportLanguage( $target, $code, $messages ) { |
| 199 | + $this->load( $code ); |
| 200 | + $this->makeHeader( $target, $code ); |
| 201 | + $this->exportStaticHeader( $target ); |
| 202 | + $this->exportMessages( $target, $messages ); |
| 203 | + } |
| 204 | + |
| 205 | + // Writing three |
| 206 | + protected function makeHeader( $handle, $code ) { |
| 207 | + fwrite( $handle, $this->formatAuthors( self::AUTHORPREFIX, $code ) ); |
| 208 | + fwrite( $handle, self::SEPARATOR . "\n"); |
| 209 | + } |
| 210 | + |
| 211 | + protected function formatAuthors( $prefix, $code ) { |
| 212 | + if ( empty($this->authors[$code]) ) return ''; |
| 213 | + $s = array(); |
| 214 | + foreach ( $this->authors[$code] as $a ) { |
| 215 | + $s[] = $prefix . $a; |
| 216 | + } |
| 217 | + return implode( "\n", $s ) . "\n"; |
| 218 | + } |
| 219 | + |
| 220 | + protected function exportStaticHeader( $target ) { |
| 221 | + if( $this->staticHeader ) { |
| 222 | + fwrite( $target, $this->staticHeader ); |
| 223 | + } |
| 224 | + } |
| 225 | + |
| 226 | + protected function exportMessages( $handle, array $messages ) { |
| 227 | + foreach ( $messages as $key => $value ) { |
| 228 | + fwrite( $handle, "$key\000$value\000\n" ); |
| 229 | + } |
| 230 | + } |
| 231 | + |
| 232 | + protected function getLanguageNames( $code ) { |
| 233 | + $name = TranslateUtils::getLanguageName( $code ); |
| 234 | + $native = TranslateUtils::getLanguageName( $code, true ); |
| 235 | + return array( $name, $native ); |
| 236 | + } |
| 237 | + |
| 238 | + /** |
| 239 | + * Preprocesses MessageArray to suitable format and filters things that should |
| 240 | + * not be exported. |
| 241 | + * |
| 242 | + * @param $array Reference of MessageArray. |
| 243 | + */ |
| 244 | + public function makeExportArray( MessageCollection $messages ) { |
| 245 | + // We copy only relevant translations to this new array |
| 246 | + $new = array(); |
| 247 | + $mangler = $this->group->getMangler(); |
| 248 | + foreach( $messages as $key => $m ) { |
| 249 | + $key = $mangler->unMangle( $key ); |
| 250 | + |
| 251 | + # CASE1: ignored |
| 252 | + if ( $m->ignored ) continue; |
| 253 | + |
| 254 | + $translation = $m->translation; |
| 255 | + # CASE2: no translation |
| 256 | + if ( $translation === null ) continue; |
| 257 | + |
| 258 | + # Remove fuzzy markings before export |
| 259 | + $translation = str_replace( TRANSLATE_FUZZY, '', $translation ); |
| 260 | + |
| 261 | + # CASE3: optional messages; accept only if different |
| 262 | + if ( $m->optional && $translation === $m->definition ) continue; |
| 263 | + |
| 264 | + # CASE4: don't export non-translations unless translated in wiki |
| 265 | + if ( !$m->pageExists && $translation === $m->definition ) continue; |
| 266 | + |
| 267 | + # Otherwise it's good |
| 268 | + $new[$key] = $translation; |
| 269 | + } |
| 270 | + |
| 271 | + return $new; |
| 272 | + } |
| 273 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/Translate/ffs/Simple.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 274 | + native |
Index: trunk/extensions/Translate/ffs/WikiExtension.php |
— | — | @@ -0,0 +1,182 @@ |
| 2 | +<?php |
| 3 | +if (!defined('MEDIAWIKI')) die(); |
| 4 | +/** |
| 5 | + * Multiple language wiki file format handler. |
| 6 | + * |
| 7 | + * @author Niklas Laxström |
| 8 | + * @copyright Copyright © 2008, Niklas Laxström |
| 9 | + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
| 10 | + * @file |
| 11 | + */ |
| 12 | + |
| 13 | + |
| 14 | +class WikiExtensionFormatReader extends WikiFormatReader { |
| 15 | + public function parseSections( $var ) { |
| 16 | + if ( $this->filename === false ) { |
| 17 | + return array( '', array()); |
| 18 | + } |
| 19 | + |
| 20 | + $data = file_get_contents( $this->filename ) . "\n"; |
| 21 | + |
| 22 | + $headerP = " |
| 23 | + .*? # Ungreedily eat header |
| 24 | + \\$$var \s* = \s* array\(\);"; |
| 25 | + /* |
| 26 | + * x to have nice syntax |
| 27 | + * u for utf-8 |
| 28 | + * s for dot matches newline |
| 29 | + */ |
| 30 | + $fileStructure = "~^($headerP)(.*)~xsu"; |
| 31 | + |
| 32 | + $matches = array(); |
| 33 | + if ( !preg_match( $fileStructure, $data, $matches ) ) { |
| 34 | + throw new MWException( "Unable to parse file structure" ); |
| 35 | + } |
| 36 | + |
| 37 | + list( , $header, $data) = $matches; |
| 38 | + |
| 39 | + $sectionP = '(?: /\*\* .*? \*/ )? (?: .*? \n\);\n\n )'; |
| 40 | + $codeP = "\\$$var\[' (.*?) '\]"; |
| 41 | + |
| 42 | + $sectionMatches = array(); |
| 43 | + if ( !preg_match_all( "~$sectionP~xsu", $data, $sectionMatches, PREG_SET_ORDER ) ) { |
| 44 | + throw new MWException( "Unable to parse sections" ); |
| 45 | + } |
| 46 | + |
| 47 | + $sections = array(); |
| 48 | + $unknown = array(); |
| 49 | + foreach ( $sectionMatches as $index => $data ) { |
| 50 | + $code = array(); |
| 51 | + if ( !preg_match( "~$codeP~xsu", $data[0], $code ) ) { |
| 52 | + echo "Malformed section:\n$data[0]"; |
| 53 | + $unknown[] = $data[0]; |
| 54 | + } else { |
| 55 | + $sections[$code[1]] = $data[0]; |
| 56 | + } |
| 57 | + } |
| 58 | + |
| 59 | + if ( $unknown ) |
| 60 | + $sections[] = implode( "\n", $unknown ); |
| 61 | + |
| 62 | + return array( $header, $sections ); |
| 63 | + } |
| 64 | + |
| 65 | + public function parseMessages( StringMangler $mangler ) { |
| 66 | + if ( $this->filename === false ) { |
| 67 | + return array(); |
| 68 | + } |
| 69 | + ${$this->variableName} = array(); |
| 70 | + require( $this->filename ); |
| 71 | + $messages = ${$this->variableName}; |
| 72 | + foreach ( $messages as $code => $value ) { |
| 73 | + $messages[$code] = $mangler->mangle( $value ); |
| 74 | + } |
| 75 | + return $messages; |
| 76 | + } |
| 77 | +} |
| 78 | + |
| 79 | +class WikiExtensionFormatWriter extends WikiFormatWriter { |
| 80 | + |
| 81 | + // Inherit |
| 82 | + protected $authors; |
| 83 | + |
| 84 | + // Own data |
| 85 | + protected $header = ''; |
| 86 | + protected $sections; |
| 87 | + |
| 88 | + // Set by creater |
| 89 | + public $variableName = 'messages'; |
| 90 | + |
| 91 | + public function fileExport( array $languages, $targetDirectory ) { |
| 92 | + $filename = $targetDirectory . '/' . $this->group->getMessageFile( '' ); |
| 93 | + |
| 94 | + wfMkdirParents( dirname( $filename ) ); |
| 95 | + $handle = fopen( $filename, 'wt' ); |
| 96 | + if ( $handle === false ) { |
| 97 | + throw new MWException( "Unable to open target for writing" ); |
| 98 | + } |
| 99 | + |
| 100 | + $this->doExport( $handle, $languages ); |
| 101 | + |
| 102 | + fclose( $handle ); |
| 103 | + } |
| 104 | + |
| 105 | + protected function doExport( $handle, $languages ) { |
| 106 | + $this->_load(); |
| 107 | + $this->_makeHeader( $handle ); |
| 108 | + |
| 109 | + $this->exportSection( $handle, 'en', $languages ); |
| 110 | + $this->exportSection( $handle, 'qqq', $languages ); |
| 111 | + |
| 112 | + $__languages = Language::getLanguageNames( false ); |
| 113 | + foreach ( array_keys( $__languages ) as $code ) { |
| 114 | + if ( $code === 'en' || $code === 'qqq' ) continue; |
| 115 | + $this->exportSection( $handle, $code, $languages ); |
| 116 | + } |
| 117 | + } |
| 118 | + |
| 119 | + protected function exportSection( $handle, $code, array $languages) { |
| 120 | + if ( isset($this->sections[$code]) ) { |
| 121 | + $authors = $this->parseAuthorsFromString( $this->sections[$code] ); |
| 122 | + $this->addAuthors( $authors, $code ); |
| 123 | + } |
| 124 | + |
| 125 | + if ( in_array( $code, $languages ) ) { |
| 126 | + $this->writeSection( $handle, $code ); |
| 127 | + unset( $this->sections[$code] ); |
| 128 | + } elseif ( isset( $this->sections[$code] ) ) { |
| 129 | + fwrite( $handle, $this->sections[$code] ); |
| 130 | + unset( $this->sections[$code] ); |
| 131 | + } |
| 132 | + } |
| 133 | + |
| 134 | + protected function writeSection( $handle, $code ) { |
| 135 | + $messages = $this->getMessagesForExport( $this->group, $code ); |
| 136 | + if ( count($messages) ) { |
| 137 | + list( $name, $native) = $this->getLanguageNames($code); |
| 138 | + $authors = $this->formatAuthors( ' * @author ', $code ); |
| 139 | + if ( !empty($authors) ) |
| 140 | + $authors = "\n$authors"; |
| 141 | + |
| 142 | + fwrite( $handle, "/** $name ($native)$authors */\n" ); |
| 143 | + fwrite( $handle, "\${$this->variableName}['$code'] = array(\n" ); |
| 144 | + $this->writeMessagesBlock( $handle, $messages, "\t" ); |
| 145 | + fwrite( $handle, ");\n\n" ); |
| 146 | + } |
| 147 | + } |
| 148 | + |
| 149 | + public function parseAuthorsFromString( $string ) { |
| 150 | + $count = preg_match_all( '/@author (.*)/', $string, $m ); |
| 151 | + return $m[1]; |
| 152 | + } |
| 153 | + |
| 154 | + public function webExport( MessageCollection $MG ) { |
| 155 | + $handle = fopen( 'php://temp', 'wt' ); |
| 156 | + $this->doExport( $handle, array( $MG->code ) ); |
| 157 | + |
| 158 | + rewind( $handle ); |
| 159 | + $data = stream_get_contents( $handle ); |
| 160 | + fclose( $handle ); |
| 161 | + return $data; |
| 162 | + } |
| 163 | + |
| 164 | + public function _load() { |
| 165 | + $reader = $this->group->getReader( 'mul' ); |
| 166 | + if ( $reader instanceof WikiExtensionFormatReader ) { |
| 167 | + list( $this->header, $this->sections ) = $reader->parseSections($this->group->getVariableName()); |
| 168 | + } |
| 169 | + } |
| 170 | + |
| 171 | + public function _makeHeader( $handle ) { |
| 172 | + if ( $this->header ) { |
| 173 | + fwrite( $handle, $this->header ); |
| 174 | + } else { |
| 175 | + // TODO: something nice |
| 176 | + fwrite( $handle, 'BAA' ); |
| 177 | + } |
| 178 | + } |
| 179 | + |
| 180 | + // Inherit |
| 181 | + #protected function writeMessagesBlock( $handle, $messages ); |
| 182 | + |
| 183 | +} |
Property changes on: trunk/extensions/Translate/ffs/WikiExtension.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 184 | + native |
Index: trunk/extensions/Translate/ffs/Java.php |
— | — | @@ -0,0 +1,98 @@ |
| 2 | +<?php |
| 3 | +if (!defined('MEDIAWIKI')) die(); |
| 4 | +/** |
| 5 | + * Java properties file format handler. |
| 6 | + * |
| 7 | + * @author Niklas Laxström |
| 8 | + * @copyright Copyright © 2008, Niklas Laxström |
| 9 | + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
| 10 | + * @file |
| 11 | + */ |
| 12 | + |
| 13 | +class JavaFormatReader extends SimpleFormatReader { |
| 14 | + protected function parseHeader() { |
| 15 | + if ( $this->filename === false ) { |
| 16 | + return; |
| 17 | + } |
| 18 | + $authors = array(); |
| 19 | + $staticHeader = ''; |
| 20 | + |
| 21 | + $handle = fopen( $this->filename, "rt" ); |
| 22 | + $state = 0; |
| 23 | + |
| 24 | + while ( !feof($handle) ) { |
| 25 | + $line = fgets($handle); |
| 26 | + |
| 27 | + if ( $state === 0 ) { |
| 28 | + if ( $line === "\n" ) { |
| 29 | + $state = 1; |
| 30 | + continue; |
| 31 | + } |
| 32 | + |
| 33 | + $formatPrefix = '# Author: '; |
| 34 | + |
| 35 | + $prefixLength = strlen($formatPrefix); |
| 36 | + $prefix = substr( $line, 0, $prefixLength ); |
| 37 | + if ( strcasecmp( $prefix, $formatPrefix ) === 0 ) { |
| 38 | + // fgets includes the trailing newline, trim to get rid of it |
| 39 | + $authors[] = trim(substr( $line, $prefixLength )); |
| 40 | + } |
| 41 | + } elseif ( $state === 1 ) { |
| 42 | + if ( $line === "\n" || $line[0] !== '#' ) { |
| 43 | + break; // End of static header, if any |
| 44 | + } |
| 45 | + $staticHeader .= $line; |
| 46 | + } |
| 47 | + } |
| 48 | + |
| 49 | + fclose( $handle ); |
| 50 | + |
| 51 | + $this->authors = $authors; |
| 52 | + $this->staticHeader = $staticHeader; |
| 53 | + } |
| 54 | + |
| 55 | + public function parseMessages( StringMangler $mangler ) { |
| 56 | + if ( !file_exists( $this->filename ) ) { |
| 57 | + return null; |
| 58 | + } |
| 59 | + |
| 60 | + $lines = file( $this->filename ); |
| 61 | + if ( !$lines ) { return null; } |
| 62 | + |
| 63 | + $messages = array(); |
| 64 | + |
| 65 | + foreach ( $lines as $line ) { |
| 66 | + if ( !strpos( $line, '=' ) ) { continue; } |
| 67 | + list( $key, $value ) = explode( '=', $line, 2 ); |
| 68 | + $messages[$mangler->mangle($key)] = trim($value); |
| 69 | + } |
| 70 | + return $messages; |
| 71 | + } |
| 72 | +} |
| 73 | + |
| 74 | + |
| 75 | +class JavaFormatWriter extends SimpleFormatWriter { |
| 76 | + |
| 77 | + public function makeHeader( $handle, $code ) { |
| 78 | + global $wgSitename; |
| 79 | + list( $name, $native ) = $this->getLanguageNames($code); |
| 80 | + $authors = $this->formatAuthors( '# Author: ', $code ); |
| 81 | + $when = wfTimestamp(TS_ISO_8601); |
| 82 | + |
| 83 | + fwrite( $handle, <<<HEADER |
| 84 | +# Messages for $name ($native) |
| 85 | +# Exported from $wgSitename at $when |
| 86 | +$authors |
| 87 | + |
| 88 | +HEADER |
| 89 | + ); |
| 90 | + } |
| 91 | + |
| 92 | + protected function exportMessages( $handle, array $messages ) { |
| 93 | + foreach ( $messages as $key => $value ) { |
| 94 | + $value = str_replace( "\n", '\\n', $value ); |
| 95 | + fwrite( $handle, "$key=$value\n" ); |
| 96 | + } |
| 97 | + } |
| 98 | + |
| 99 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/Translate/ffs/Java.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 100 | + native |
Index: trunk/extensions/Translate/ffs/Wiki.php |
— | — | @@ -0,0 +1,203 @@ |
| 2 | +<?php |
| 3 | +if (!defined('MEDIAWIKI')) die(); |
| 4 | +/** |
| 5 | + * Wike file format handler. |
| 6 | + * |
| 7 | + * Metadata items understood by this class: |
| 8 | + * - exportprefix: Prefix for every item exported |
| 9 | + * - languagename: Name of the language in English |
| 10 | + * - nativename: Name of the language in that language |
| 11 | + * - authors |
| 12 | + * |
| 13 | + * @author Niklas Laxström |
| 14 | + * @copyright Copyright © 2008, Niklas Laxström |
| 15 | + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
| 16 | + * @file |
| 17 | + */ |
| 18 | + |
| 19 | + |
| 20 | +class WikiFormatReader extends SimpleFormatReader { |
| 21 | + // Set by creater |
| 22 | + public $variableName = 'messages'; |
| 23 | + |
| 24 | + /** |
| 25 | + * Reads all \@author tags from the file and returns array of authors. |
| 26 | + * |
| 27 | + * @param $filename From which file to get the authors. |
| 28 | + * @return Array of authors. |
| 29 | + */ |
| 30 | + public function parseAuthors() { |
| 31 | + if ( $this->filename === false ) { |
| 32 | + return array(); |
| 33 | + } |
| 34 | + $contents = file_get_contents( $this->filename ); |
| 35 | + $m = array(); |
| 36 | + $count = preg_match_all( '/@author (.*)/', $contents, $m ); |
| 37 | + return $m[1]; |
| 38 | + } |
| 39 | + |
| 40 | + public function parseStaticHeader() { |
| 41 | + if ( $this->filename === false ) { |
| 42 | + return ''; |
| 43 | + } |
| 44 | + $contents = file_get_contents( $this->filename ); |
| 45 | + |
| 46 | + /** FIXME: handle the case where the first comment is missing */ |
| 47 | + $dollarstart = strpos( $contents, '$' ); |
| 48 | + |
| 49 | + $start = strpos( $contents, '*/' ); |
| 50 | + $end = strpos( $contents, '$messages' ); |
| 51 | + if ( $start === false ) return ''; |
| 52 | + if ( $start === $end ) return ''; |
| 53 | + $start += 2; // Get over the comment ending |
| 54 | + if ( $end === false ) return trim( substr( $contents, $start ) ); |
| 55 | + return trim( substr( $contents, $start, $end-$start ) ); |
| 56 | + } |
| 57 | + |
| 58 | + public function parseMessages( StringMangler $mangler ) { |
| 59 | + if ( $this->filename === false ) { |
| 60 | + return array(); |
| 61 | + } |
| 62 | + ${$this->variableName} = array(); |
| 63 | + require( $this->filename ); |
| 64 | + return $mangler->mangle( ${$this->variableName} ); |
| 65 | + } |
| 66 | + |
| 67 | +} |
| 68 | + |
| 69 | +class WikiFormatWriter extends SimpleFormatWriter { |
| 70 | + |
| 71 | + public function makeHeader( $handle, $code ) { |
| 72 | + list( $name, $native ) = $this->getLanguageNames($code); |
| 73 | + $authors = $this->formatAuthors( ' * @author ', $code ); |
| 74 | + |
| 75 | + fwrite( $handle, <<<HEADER |
| 76 | +<?php |
| 77 | +/** $name ($native) |
| 78 | + * |
| 79 | + * @ingroup Language |
| 80 | + * @file |
| 81 | + * |
| 82 | +$authors */ |
| 83 | + |
| 84 | +HEADER |
| 85 | + ); |
| 86 | + } |
| 87 | + |
| 88 | + protected function exportStaticHeader( $target ) { |
| 89 | + if( $this->staticHeader ) { |
| 90 | + fwrite( $target, "\n" . $this->staticHeader . "\n" ); |
| 91 | + } |
| 92 | + } |
| 93 | + |
| 94 | + protected function exportMessages( $handle, array $messages ) { |
| 95 | + fwrite( $handle, "\n\$messages = array(\n" ); |
| 96 | + |
| 97 | + $dir = $this->group->getMetaDataPrefix(); |
| 98 | + if ( !$dir ) { |
| 99 | + $this->writeMessagesBlock( $handle, $messages ); |
| 100 | + fwrite( $handle, ");\n" ); |
| 101 | + return; |
| 102 | + } |
| 103 | + |
| 104 | + require( $dir . '/messages.inc' ); |
| 105 | + |
| 106 | + # Sort messages to blocks |
| 107 | + $sortedMessages['unknown'] = $messages; |
| 108 | + foreach( $wgMessageStructure as $blockName => $block ) { |
| 109 | + foreach( $block as $key ) { |
| 110 | + if( array_key_exists( $key, $sortedMessages['unknown'] ) ) { |
| 111 | + $sortedMessages[$blockName][$key] = $sortedMessages['unknown'][$key]; |
| 112 | + unset( $sortedMessages['unknown'][$key] ); |
| 113 | + } |
| 114 | + } |
| 115 | + } |
| 116 | + |
| 117 | + foreach( $sortedMessages as $block => $messages ) { |
| 118 | + # Skip if it's the block of unknown messages - handle that in the end of file |
| 119 | + if ( $block == 'unknown' ) continue; |
| 120 | + $this->writeMessagesBlockComment( $handle, $wgBlockComments[$block] ); |
| 121 | + $this->writeMessagesBlock( $handle, $messages ); |
| 122 | + fwrite( $handle, "\n" ); |
| 123 | + } |
| 124 | + |
| 125 | + # Write the unknown messages, alphabetically sorted. |
| 126 | + if ( count($sortedMessages['unknown'] ) ) { |
| 127 | + ksort( $sortedMessages['unknown'] ); |
| 128 | + $this->writeMessagesBlockComment( $handle, 'Unknown messages' ); |
| 129 | + $this->writeMessagesBlock( $handle, $sortedMessages['unknown'] ); |
| 130 | + } |
| 131 | + |
| 132 | + fwrite( $handle, ");\n" ); |
| 133 | + } |
| 134 | + |
| 135 | + protected function writeMessagesBlockComment( $handle, $blockComment ) { |
| 136 | + # Format the block comment (if exists); check for multiple lines comments |
| 137 | + if( !empty( $blockComment ) ) { |
| 138 | + if( strpos( $blockComment, "\n" ) === false ) { |
| 139 | + fwrite( $handle, "# $blockComment\n" ); |
| 140 | + } else { |
| 141 | + fwrite( $handle, "/*\n$blockComment\n*/\n" ); |
| 142 | + } |
| 143 | + } |
| 144 | + } |
| 145 | + |
| 146 | + protected function writeMessagesBlock( $handle, $messages, $prefix = '') { |
| 147 | + # Skip the block if it includes no messages |
| 148 | + if( empty($messages) ) { |
| 149 | + return; |
| 150 | + } |
| 151 | + |
| 152 | + # Get max key length |
| 153 | + $maxKeyLength = max( array_map( 'strlen', array_keys( $messages ) ) ); |
| 154 | + |
| 155 | + foreach ( $messages as $key => $value ) { |
| 156 | + fwrite( $handle, $prefix ); |
| 157 | + $this->exportItemPad( $handle, $key, $value, $maxKeyLength ); |
| 158 | + } |
| 159 | + } |
| 160 | + |
| 161 | + protected function exportItemPad( $handle, $key, $value, $pad ) { |
| 162 | + # Add the key name |
| 163 | + fwrite( $handle, "'$key'" ); |
| 164 | + # Add the appropriate block whitespace |
| 165 | + fwrite( $handle, str_repeat( ' ', $pad - strlen($key) ) ); |
| 166 | + fwrite( $handle, ' => ' ); |
| 167 | + |
| 168 | + # Check for the appropriate apostrophe and add the value |
| 169 | + # Quote \ here, because it needs always escaping |
| 170 | + $value = addcslashes( $value, '\\' ); |
| 171 | + |
| 172 | + # For readability |
| 173 | + $single = "'"; |
| 174 | + $double = '"'; |
| 175 | + $quote = $single; |
| 176 | + |
| 177 | + # It is safe to use '-quoting, unless there is '-quote in the text |
| 178 | + if( strpos( $value, $single ) !== false ) { |
| 179 | + |
| 180 | + # In case there is no variables that need to be escaped, just use "-quote |
| 181 | + if( strpos( $value, $double ) === false && !preg_match('/\$[^0-9]/', $value) ) { |
| 182 | + $quote = $double; |
| 183 | + |
| 184 | + # Something needs quoting, pick the quote which causes less quoting |
| 185 | + } else { |
| 186 | + $doubleEsc = substr_count( $value, $double ) + substr_count( $value, '$' ); |
| 187 | + $singleEsc = substr_count( $value, $single ); |
| 188 | + |
| 189 | + if ( $doubleEsc < $singleEsc ) { |
| 190 | + $quote = $double; |
| 191 | + $extra = '$'; |
| 192 | + } else { |
| 193 | + $extra = ''; |
| 194 | + } |
| 195 | + |
| 196 | + $value = addcslashes( $value, $quote . $extra ); |
| 197 | + } |
| 198 | + } |
| 199 | + |
| 200 | + fwrite( $handle, $quote . $value . $quote ); |
| 201 | + fwrite( $handle, ",\n" ); |
| 202 | + } |
| 203 | + |
| 204 | +} |
Property changes on: trunk/extensions/Translate/ffs/Wiki.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 205 | + native |
Index: trunk/extensions/Translate/ffs/Gettext.php |
— | — | @@ -0,0 +1,192 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * Parses a po file that has been exported from Mediawiki. Other files are not |
| 6 | + * supported. |
| 7 | + */ |
| 8 | +class GettextFormatHandler { |
| 9 | + |
| 10 | + public function __construct( $file ) { |
| 11 | + $this->file = $file; |
| 12 | + } |
| 13 | + |
| 14 | + /** |
| 15 | + * Loads translations for comparison. |
| 16 | + * |
| 17 | + * @param $id Id of MessageGroup. |
| 18 | + * @param $code Language code. |
| 19 | + * @return MessageCollection |
| 20 | + */ |
| 21 | + protected function initMessages( $id, $code ) { |
| 22 | + $messages = new MessageCollection( $code ); |
| 23 | + $group = MessageGroups::getGroup( $id ); |
| 24 | + |
| 25 | + $definitions = $group->getDefinitions(); |
| 26 | + foreach ( $definitions as $key => $definition ) { |
| 27 | + $messages->add( new TMessage( $key, $definition ) ); |
| 28 | + } |
| 29 | + |
| 30 | + $bools = $group->getBools(); |
| 31 | + foreach ( $bools['optional'] as $key ) { |
| 32 | + if ( isset($messages[$key]) ) { $messages[$key]->optional = true; } |
| 33 | + } |
| 34 | + foreach ( $bools['ignored'] as $key ) { |
| 35 | + if ( isset($messages[$key]) ) { $messages[$key]->ignored = true; } |
| 36 | + } |
| 37 | + |
| 38 | + $messages->populatePageExistence(); |
| 39 | + $messages->populateTranslationsFromDatabase(); |
| 40 | + $group->fill( $messages ); |
| 41 | + |
| 42 | + return $messages; |
| 43 | + } |
| 44 | + |
| 45 | + /** |
| 46 | + * Parses relevant stuff from the po file. |
| 47 | + */ |
| 48 | + public function parse() { |
| 49 | + $data = file_get_contents( $this->file ); |
| 50 | + $data = str_replace( "\r\n", "\n", $data ); |
| 51 | + |
| 52 | + $matches = array(); |
| 53 | + if ( preg_match( '/X-Language-Code:\s+([a-zA-Z-_]+)/', $data, $matches ) ) { |
| 54 | + $code = $matches[1]; |
| 55 | + echo "Detected language as $code\n"; |
| 56 | + } else { |
| 57 | + echo "Unable to determine language code\n"; |
| 58 | + return false; |
| 59 | + } |
| 60 | + |
| 61 | + if ( preg_match( '/X-Message-Group:\s+([a-zA-Z0-9-_]+)/', $data, $matches ) ) { |
| 62 | + $groupId = $matches[1]; |
| 63 | + echo "Detected message group as $groupId\n"; |
| 64 | + } else { |
| 65 | + echo "Unable to determine message group\n"; |
| 66 | + return false; |
| 67 | + } |
| 68 | + |
| 69 | + $contents = $this->initMessages( $groupId, $code ); |
| 70 | + |
| 71 | + echo "----\n"; |
| 72 | + |
| 73 | + $poformat = '".*"\n?(^".*"$\n?)*'; |
| 74 | + $quotePattern = '/(^"|"$\n?)/m'; |
| 75 | + |
| 76 | + $sections = preg_split( '/\n{2,}/', $data ); |
| 77 | + $changes = array(); |
| 78 | + foreach ( $sections as $section ) { |
| 79 | + $matches = array(); |
| 80 | + if ( preg_match( "/^msgctxt\s($poformat)/mx", $section, $matches ) ) { |
| 81 | + // Remove quoting |
| 82 | + $key = preg_replace( $quotePattern, '', $matches[1] ); |
| 83 | + // Ignore unknown keys |
| 84 | + if ( !isset($contents[$key]) ) continue; |
| 85 | + } else { |
| 86 | + continue; |
| 87 | + } |
| 88 | + $matches = array(); |
| 89 | + if ( preg_match( "/^msgstr\s($poformat)/mx", $section, $matches ) ) { |
| 90 | + // Remove quoting |
| 91 | + $translation = preg_replace( $quotePattern, '', $matches[1] ); |
| 92 | + // Restore new lines and remove quoting |
| 93 | + $translation = stripcslashes( $translation ); |
| 94 | + } else { |
| 95 | + continue; |
| 96 | + } |
| 97 | + |
| 98 | + // Fuzzy messages |
| 99 | + if ( preg_match( '/^#, fuzzy$/m', $section ) ) { |
| 100 | + $translation = TRANSLATE_FUZZY . $translation; |
| 101 | + } |
| 102 | + |
| 103 | + if ( $translation !== (string) $contents[$key]->translation ) { |
| 104 | + echo "Translation of $key differs:\n$translation\n\n"; |
| 105 | + $changes["$key/$code"] = $translation; |
| 106 | + } |
| 107 | + |
| 108 | + } |
| 109 | + |
| 110 | + return $changes; |
| 111 | + |
| 112 | + } |
| 113 | + |
| 114 | + // Inherited: Stored objects |
| 115 | + protected $info; |
| 116 | + |
| 117 | + public function makeHeaderTo( $handle ) { |
| 118 | + $name = $this->info->getOption( 'languagename' ); |
| 119 | + $native = $this->info->getOption( 'nativename' ); |
| 120 | + $authors = $this->_formatAuthors( $this->info->getOption( 'authors' ) ); |
| 121 | + |
| 122 | + fwrite( $handle, <<<HEADER |
| 123 | +# Messages for $name ($native) |
| 124 | +# Exported from XYZ |
| 125 | +$authors |
| 126 | + |
| 127 | +HEADER |
| 128 | + ); |
| 129 | + } |
| 130 | + |
| 131 | + protected function _formatAuthors( array $authors ) { |
| 132 | + $s = array(); |
| 133 | + foreach ( $authors as $a ) { |
| 134 | + $s[] = "# Author: $a"; |
| 135 | + } |
| 136 | + return "\n" . implode( "\n", $s ) . "\n"; |
| 137 | + } |
| 138 | + |
| 139 | + protected function _exportItem( $handle, $key, $value ) { |
| 140 | + $prefix = $this->info->getOption( 'exportprefix' ); |
| 141 | + if ( $prefix ) fwrite( $handle, $prefix ); |
| 142 | + |
| 143 | + # Add the key name |
| 144 | + fwrite( $handle, "'$key'" ); |
| 145 | + # Add the appropriate block whitespace |
| 146 | + fwrite( $handle, str_repeat( ' ', $this->padTo - strlen($key) ) ); |
| 147 | + fwrite( $handle, ' => ' ); |
| 148 | + |
| 149 | + # Check for the appropriate apostrophe and add the value |
| 150 | + # Quote \ here, because it needs always escaping |
| 151 | + $value = addcslashes( $value, '\\' ); |
| 152 | + |
| 153 | + # For readability |
| 154 | + $single = "'"; |
| 155 | + $double = '"'; |
| 156 | + $quote = $single; |
| 157 | + |
| 158 | + # It is safe to use '-quoting, unless there is '-quote in the text |
| 159 | + if( strpos( $value, $single ) !== false ) { |
| 160 | + |
| 161 | + # In case there is no variables that need to be escaped, just use "-quote |
| 162 | + if( strpos( $value, $double ) === false && !preg_match('/\$[^0-9]/', $value) ) { |
| 163 | + $quote = $double; |
| 164 | + |
| 165 | + # Something needs quoting, pick the quote which causes less quoting |
| 166 | + } else { |
| 167 | + $doubleEsc = substr_count( $value, $double ) + substr_count( $value, '$' ); |
| 168 | + $singleEsc = substr_count( $value, $single ); |
| 169 | + |
| 170 | + if ( $doubleEsc < $singleEsc ) { |
| 171 | + $quote = $double; |
| 172 | + $extra = '$'; |
| 173 | + } else { |
| 174 | + $extra = ''; |
| 175 | + } |
| 176 | + |
| 177 | + $value = addcslashes( $value, $quote . $extra ); |
| 178 | + } |
| 179 | + } |
| 180 | + |
| 181 | + fwrite( $handle, $quote . $value . $quote ); |
| 182 | + fwrite( $handle, ",\n" ); |
| 183 | + } |
| 184 | + |
| 185 | + public function parseMessages( $filename ) { |
| 186 | + $messages = array(); |
| 187 | + require( $filename ); |
| 188 | + return $messages; |
| 189 | + |
| 190 | + } |
| 191 | + |
| 192 | + |
| 193 | +} |
Property changes on: trunk/extensions/Translate/ffs/Gettext.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 194 | + native |