MediaWiki
REL1_34
dumpMessages.php
Go to the documentation of this file.
1
<?php
26
require_once __DIR__ .
'/../Maintenance.php'
;
27
33
class
DumpMessages
extends
Maintenance
{
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;
52
require_once
RUN_MAINTENANCE_IF_MAIN
;
serialize
serialize()
Definition
ApiMessageTrait.php:138
$wgVersion
$wgVersion
MediaWiki version number.
Definition
DefaultSettings.php:76
wfMessage
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Definition
GlobalFunctions.php:1263
RUN_MAINTENANCE_IF_MAIN
const RUN_MAINTENANCE_IF_MAIN
Definition
Maintenance.php:39
DumpMessages
Maintenance script that dumps an entire language, using the keys from English.
Definition
dumpMessages.php:33
DumpMessages\__construct
__construct()
Default constructor.
Definition
dumpMessages.php:34
DumpMessages\execute
execute()
Do the actual work.
Definition
dumpMessages.php:39
Maintenance
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
Definition
Maintenance.php:82
Maintenance\output
output( $out, $channel=null)
Throw some output to the user.
Definition
Maintenance.php:453
Maintenance\addDescription
addDescription( $text)
Set the description text.
Definition
Maintenance.php:348
$maintClass
$maintClass
Definition
dumpMessages.php:51
maintenance
language
dumpMessages.php
Generated on Fri Apr 5 2024 23:11:10 for MediaWiki by
1.9.8