MediaWiki REL1_34
dumpMessages.php
Go to the documentation of this file.
1<?php
26require_once __DIR__ . '/../Maintenance.php';
27
34 public function __construct() {
35 parent::__construct();
36 $this->addDescription( 'Dump an entire language, using the keys from English' );
37 }
38
39 public function execute() {
40 global $wgVersion;
41
42 $messages = [];
43 foreach ( array_keys( Language::getMessagesFor( 'en' ) ) as $key ) {
44 $messages[$key] = wfMessage( $key )->text();
45 }
46 $this->output( "MediaWiki $wgVersion language file\n" );
47 $this->output( serialize( $messages ) );
48 }
49}
50
51$maintClass = DumpMessages::class;
52require_once RUN_MAINTENANCE_IF_MAIN;
serialize()
$wgVersion
MediaWiki version number.
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
const RUN_MAINTENANCE_IF_MAIN
Maintenance script that dumps an entire language, using the keys from English.
__construct()
Default constructor.
execute()
Do the actual work.
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
output( $out, $channel=null)
Throw some output to the user.
addDescription( $text)
Set the description text.
$maintClass