summaryrefslogtreecommitdiff
path: root/maintenance/language
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-12-08 09:55:49 +0100
committerPierre Schmitz <pierre@archlinux.de>2013-12-08 09:55:49 +0100
commit4ac9fa081a7c045f6a9f1cfc529d82423f485b2e (patch)
treeaf68743f2f4a47d13f2b0eb05f5c4aaf86d8ea37 /maintenance/language
parentaf4da56f1ad4d3ef7b06557bae365da2ea27a897 (diff)
Update to MediaWiki 1.22.0
Diffstat (limited to 'maintenance/language')
-rw-r--r--maintenance/language/StatOutputs.php12
-rw-r--r--maintenance/language/alltrans.php4
-rw-r--r--maintenance/language/checkDupeMessages.php34
-rw-r--r--maintenance/language/checkExtensions.php8
-rw-r--r--maintenance/language/checkLanguage.inc210
-rw-r--r--maintenance/language/checkLanguage.php6
-rw-r--r--maintenance/language/countMessages.php6
-rw-r--r--maintenance/language/date-formats.php4
-rw-r--r--maintenance/language/digit2html.php6
-rw-r--r--maintenance/language/dumpMessages.php4
-rw-r--r--maintenance/language/generateCollationData.php8
-rw-r--r--maintenance/language/generateNormalizerData.php6
-rw-r--r--maintenance/language/langmemusage.php9
-rw-r--r--maintenance/language/languages.inc34
-rw-r--r--maintenance/language/messageTypes.inc41
-rw-r--r--maintenance/language/messages.inc289
-rw-r--r--maintenance/language/rebuildLanguage.php12
-rw-r--r--maintenance/language/transstat.php8
-rw-r--r--maintenance/language/validate.php6
-rw-r--r--maintenance/language/writeMessagesArray.inc67
20 files changed, 462 insertions, 312 deletions
diff --git a/maintenance/language/StatOutputs.php b/maintenance/language/StatOutputs.php
index 20fb4778..e9d8c86d 100644
--- a/maintenance/language/StatOutputs.php
+++ b/maintenance/language/StatOutputs.php
@@ -1,5 +1,7 @@
<?php
-if ( !defined( 'MEDIAWIKI' ) ) die();
+if ( !defined( 'MEDIAWIKI' ) ) {
+ die();
+}
/**
* Statistic output classes.
*
@@ -52,9 +54,9 @@ class wikiStatsOutput extends statsOutput {
echo "'''Note:''' These statistics can be generated by running <code>php maintenance/language/transstat.php</code>.\n\n";
echo "For additional information on specific languages (the message names, the actual problems, etc.), run <code>php maintenance/language/checkLanguage.php --lang=foo</code>.\n\n";
echo 'English (en) is excluded because it is the default localization';
- if( is_array( $wgDummyLanguageCodes ) ) {
+ if ( is_array( $wgDummyLanguageCodes ) ) {
$dummyCodes = array();
- foreach( $wgDummyLanguageCodes as $dummyCode => $correctCode ) {
+ foreach ( $wgDummyLanguageCodes as $dummyCode => $correctCode ) {
$dummyCodes[] = Language::fetchLanguageName( $dummyCode ) . ' (' . $dummyCode . ')';
}
echo ', as well as the following languages that are not intended for system message translations, usually because they redirect to other language codes: ' . implode( ', ', $dummyCodes );
@@ -80,7 +82,9 @@ class wikiStatsOutput extends statsOutput {
# Weigh reverse with factor 20 so coloring takes effect more quickly as
# this option is used solely for reporting 'bad' percentages.
$v = $v * 20;
- if ( $v > 255 ) $v = 255;
+ if ( $v > 255 ) {
+ $v = 255;
+ }
$v = 255 - $v;
}
if ( $v < 128 ) {
diff --git a/maintenance/language/alltrans.php b/maintenance/language/alltrans.php
index 8caf8677..d0e6e849 100644
--- a/maintenance/language/alltrans.php
+++ b/maintenance/language/alltrans.php
@@ -21,7 +21,7 @@
* @ingroup MaintenanceLanguage
*/
-require_once( __DIR__ . '/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
/**
* Maintenance script that gets all messages as defined by the
@@ -44,4 +44,4 @@ class AllTrans extends Maintenance {
}
$maintClass = "AllTrans";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;
diff --git a/maintenance/language/checkDupeMessages.php b/maintenance/language/checkDupeMessages.php
index 6abf7b44..381ddae1 100644
--- a/maintenance/language/checkDupeMessages.php
+++ b/maintenance/language/checkDupeMessages.php
@@ -21,7 +21,7 @@
* @ingroup MaintenanceLanguage
*/
-require_once( __DIR__ . '/../commandLine.inc' );
+require_once __DIR__ . '/../commandLine.inc';
$messagesDir = __DIR__ . '/../../languages/messages/';
$runTest = false;
$run = false;
@@ -52,7 +52,7 @@ Options:
* mode: Output format, can be either:
* text: Text output on the console (default)
* wiki: Wiki format, with * at beginning of each line
- * php: Output text as PHP syntax in a array $dupeMessages
+ * php: Output text as PHP syntax in an array named \$dupeMessages
* raw: Raw output for duplicates
TEXT;
}
@@ -80,35 +80,37 @@ if ( $run ) {
} elseif ( !strcmp( $runMode, 'raw' ) ) {
$runMode = 'raw';
}
- include( $messagesFile );
+ include $messagesFile;
$messageExist = isset( $messages );
- if ( $messageExist )
+ if ( $messageExist ) {
$wgMessages[$langCode] = $messages;
- include( $messagesFileC );
+ }
+ include $messagesFileC;
$messageCExist = isset( $messages );
- if ( $messageCExist )
+ if ( $messageCExist ) {
$wgMessages[$langCodeC] = $messages;
+ }
$count = 0;
if ( ( $messageExist ) && ( $messageCExist ) ) {
if ( !strcmp( $runMode, 'php' ) ) {
- print( "<?php\n" );
- print( '$dupeMessages = array(' . "\n" );
+ print "<?php\n";
+ print '$dupeMessages = array(' . "\n";
}
foreach ( $wgMessages[$langCodeC] as $key => $value ) {
foreach ( $wgMessages[$langCode] as $ckey => $cvalue ) {
if ( !strcmp( $key, $ckey ) ) {
if ( ( !strcmp( $key, $ckey ) ) && ( !strcmp( $value, $cvalue ) ) ) {
if ( !strcmp( $runMode, 'raw' ) ) {
- print( "$key\n" );
+ print "$key\n";
} elseif ( !strcmp( $runMode, 'php' ) ) {
- print( "'$key' => '',\n" );
+ print "'$key' => '',\n";
} elseif ( !strcmp( $runMode, 'wiki' ) ) {
$uKey = ucfirst( $key );
- print( "* MediaWiki:$uKey/$langCode\n" );
+ print "* MediaWiki:$uKey/$langCode\n";
} else {
- print( "* $key\n" );
+ print "* $key\n";
}
$count++;
}
@@ -116,7 +118,7 @@ if ( $run ) {
}
}
if ( !strcmp( $runMode, 'php' ) ) {
- print( ");\n" );
+ print ");\n";
}
if ( !strcmp( $runMode, 'text' ) ) {
if ( $count == 1 ) {
@@ -126,9 +128,11 @@ if ( $run ) {
}
}
} else {
- if ( !$messageExist )
+ if ( !$messageExist ) {
echo "There are no messages defined in $langCode.\n";
- if ( !$messageCExist )
+ }
+ if ( !$messageCExist ) {
echo "There are no messages defined in $langCodeC.\n";
+ }
}
}
diff --git a/maintenance/language/checkExtensions.php b/maintenance/language/checkExtensions.php
index ebc62b60..79a4dd98 100644
--- a/maintenance/language/checkExtensions.php
+++ b/maintenance/language/checkExtensions.php
@@ -21,14 +21,14 @@
* @ingroup MaintenanceLanguage
*/
-require_once( __DIR__ . '/../commandLine.inc' );
-require_once( 'languages.inc' );
-require_once( 'checkLanguage.inc' );
+require_once __DIR__ . '/../commandLine.inc';
+require_once 'languages.inc';
+require_once 'checkLanguage.inc';
if ( !class_exists( 'MessageGroups' ) || !class_exists( 'PremadeMediawikiExtensionGroups' ) ) {
echo <<<TEXT
Please add the Translate extension to LocalSettings.php, and enable the extension groups:
- require_once( 'extensions/Translate/Translate.php' );
+ require_once 'extensions/Translate/Translate.php';
\$wgTranslateEC = array_keys( \$wgTranslateAC );
If you still get this message, update Translate to its latest version.
diff --git a/maintenance/language/checkLanguage.inc b/maintenance/language/checkLanguage.inc
index 1860f4a5..4b49ada3 100644
--- a/maintenance/language/checkLanguage.inc
+++ b/maintenance/language/checkLanguage.inc
@@ -25,7 +25,7 @@
* @ingroup MaintenanceLanguage
*/
class CheckLanguageCLI {
- protected $code = null;
+ protected $code = null;
protected $level = 2;
protected $doLinks = false;
protected $linksPrefix = '';
@@ -46,7 +46,7 @@ class CheckLanguageCLI {
public function __construct( array $options ) {
if ( isset( $options['help'] ) ) {
echo $this->help();
- exit(1);
+ exit( 1 );
}
if ( isset( $options['lang'] ) ) {
@@ -134,24 +134,24 @@ class CheckLanguageCLI {
protected function getChecks() {
return array(
'untranslated' => 'getUntranslatedMessages',
- 'duplicate' => 'getDuplicateMessages',
- 'obsolete' => 'getObsoleteMessages',
- 'variables' => 'getMessagesWithMismatchVariables',
- 'plural' => 'getMessagesWithoutPlural',
- 'empty' => 'getEmptyMessages',
- 'whitespace' => 'getMessagesWithWhitespace',
- 'xhtml' => 'getNonXHTMLMessages',
- 'chars' => 'getMessagesWithWrongChars',
- 'links' => 'getMessagesWithDubiousLinks',
- 'unbalanced' => 'getMessagesWithUnbalanced',
- 'namespace' => 'getUntranslatedNamespaces',
- 'projecttalk' => 'getProblematicProjectTalks',
- 'magic' => 'getUntranslatedMagicWords',
- 'magic-old' => 'getObsoleteMagicWords',
- 'magic-over' => 'getOverridingMagicWords',
- 'magic-case' => 'getCaseMismatchMagicWords',
- 'special' => 'getUntraslatedSpecialPages',
- 'special-old' => 'getObsoleteSpecialPages',
+ 'duplicate' => 'getDuplicateMessages',
+ 'obsolete' => 'getObsoleteMessages',
+ 'variables' => 'getMessagesWithMismatchVariables',
+ 'plural' => 'getMessagesWithoutPlural',
+ 'empty' => 'getEmptyMessages',
+ 'whitespace' => 'getMessagesWithWhitespace',
+ 'xhtml' => 'getNonXHTMLMessages',
+ 'chars' => 'getMessagesWithWrongChars',
+ 'links' => 'getMessagesWithDubiousLinks',
+ 'unbalanced' => 'getMessagesWithUnbalanced',
+ 'namespace' => 'getUntranslatedNamespaces',
+ 'projecttalk' => 'getProblematicProjectTalks',
+ 'magic' => 'getUntranslatedMagicWords',
+ 'magic-old' => 'getObsoleteMagicWords',
+ 'magic-over' => 'getOverridingMagicWords',
+ 'magic-case' => 'getCaseMismatchMagicWords',
+ 'special' => 'getUntraslatedSpecialPages',
+ 'special-old' => 'getObsoleteSpecialPages',
);
}
@@ -163,14 +163,14 @@ class CheckLanguageCLI {
*/
protected function getTotalCount() {
return array(
- 'namespace' => array( 'getNamespaceNames', 'en' ),
- 'projecttalk' => null,
- 'magic' => array( 'getMagicWords', 'en' ),
- 'magic-old' => array( 'getMagicWords', null ),
- 'magic-over' => array( 'getMagicWords', null ),
- 'magic-case' => array( 'getMagicWords', null ),
- 'special' => array( 'getSpecialPageAliases', 'en' ),
- 'special-old' => array( 'getSpecialPageAliases', null ),
+ 'namespace' => array( 'getNamespaceNames', 'en' ),
+ 'projecttalk' => null,
+ 'magic' => array( 'getMagicWords', 'en' ),
+ 'magic-old' => array( 'getMagicWords', null ),
+ 'magic-over' => array( 'getMagicWords', null ),
+ 'magic-case' => array( 'getMagicWords', null ),
+ 'special' => array( 'getSpecialPageAliases', 'en' ),
+ 'special-old' => array( 'getSpecialPageAliases', null ),
);
}
@@ -181,24 +181,24 @@ class CheckLanguageCLI {
protected function getDescriptions() {
return array(
'untranslated' => '$1 message(s) of $2 are not translated to $3, but exist in en:',
- 'duplicate' => '$1 message(s) of $2 are translated the same in en and $3:',
- 'obsolete' => '$1 message(s) of $2 do not exist in en or are in the ignore list, but exist in $3:',
- 'variables' => '$1 message(s) of $2 in $3 don\'t match the variables used in en:',
- 'plural' => '$1 message(s) of $2 in $3 don\'t use {{plural}} while en uses:',
- 'empty' => '$1 message(s) of $2 in $3 are empty or -:',
- 'whitespace' => '$1 message(s) of $2 in $3 have trailing whitespace:',
- 'xhtml' => '$1 message(s) of $2 in $3 contain illegal XHTML:',
- 'chars' => '$1 message(s) of $2 in $3 include hidden chars which should not be used in the messages:',
- 'links' => '$1 message(s) of $2 in $3 have problematic link(s):',
- 'unbalanced' => '$1 message(s) of $2 in $3 have unbalanced {[]}:',
- 'namespace' => '$1 namespace name(s) of $2 are not translated to $3, but exist in en:',
- 'projecttalk' => '$1 namespace name(s) and alias(es) in $3 are project talk namespaces without the parameter:',
- 'magic' => '$1 magic word(s) of $2 are not translated to $3, but exist in en:',
- 'magic-old' => '$1 magic word(s) of $2 do not exist in en, but exist in $3:',
- 'magic-over' => '$1 magic word(s) of $2 in $3 do not contain the original en word(s):',
- 'magic-case' => '$1 magic word(s) of $2 in $3 change the case-sensitivity of the original en word:',
- 'special' => '$1 special page alias(es) of $2 are not translated to $3, but exist in en:',
- 'special-old' => '$1 special page alias(es) of $2 do not exist in en, but exist in $3:',
+ 'duplicate' => '$1 message(s) of $2 are translated the same in en and $3:',
+ 'obsolete' => '$1 message(s) of $2 do not exist in en or are in the ignore list, but exist in $3:',
+ 'variables' => '$1 message(s) of $2 in $3 don\'t match the variables used in en:',
+ 'plural' => '$1 message(s) of $2 in $3 don\'t use {{plural}} while en uses:',
+ 'empty' => '$1 message(s) of $2 in $3 are empty or -:',
+ 'whitespace' => '$1 message(s) of $2 in $3 have trailing whitespace:',
+ 'xhtml' => '$1 message(s) of $2 in $3 contain illegal XHTML:',
+ 'chars' => '$1 message(s) of $2 in $3 include hidden chars which should not be used in the messages:',
+ 'links' => '$1 message(s) of $2 in $3 have problematic link(s):',
+ 'unbalanced' => '$1 message(s) of $2 in $3 have unbalanced {[]}:',
+ 'namespace' => '$1 namespace name(s) of $2 are not translated to $3, but exist in en:',
+ 'projecttalk' => '$1 namespace name(s) and alias(es) in $3 are project talk namespaces without the parameter:',
+ 'magic' => '$1 magic word(s) of $2 are not translated to $3, but exist in en:',
+ 'magic-old' => '$1 magic word(s) of $2 do not exist in en, but exist in $3:',
+ 'magic-over' => '$1 magic word(s) of $2 in $3 do not contain the original en word(s):',
+ 'magic-case' => '$1 magic word(s) of $2 in $3 change the case-sensitivity of the original en word:',
+ 'special' => '$1 special page alias(es) of $2 are not translated to $3, but exist in en:',
+ 'special-old' => '$1 special page alias(es) of $2 do not exist in en, but exist in $3:',
);
}
@@ -222,7 +222,7 @@ Parameters:
--links: Link the message values (default off).
--prefix: prefix to add to links.
--wikilang: For the links, what is the content language of the wiki to display the output in (default en).
- --noexif: Do not check for EXIF messages (a bit hard and boring to translate), if you know
+ --noexif: Do not check for Exif messages (a bit hard and boring to translate), if you know
that they are currently not translated and want to focus on other problems (default off).
--whitelist: Do only the following checks (form: code,code).
--blacklist: Do not do the following checks (form: code,code).
@@ -299,6 +299,7 @@ ENDS;
*/
protected function getCheckBlacklist() {
global $checkBlacklist;
+
return $checkBlacklist;
}
@@ -313,6 +314,7 @@ ENDS;
$results = array();
if ( $this->level === 0 ) {
$this->L->getMessages( $code );
+
return $results;
}
@@ -320,7 +322,8 @@ ENDS;
$checkBlacklist = $this->getCheckBlacklist();
foreach ( $this->checks as $check ) {
if ( isset( $checkBlacklist[$code] ) &&
- in_array( $check, $checkBlacklist[$code] ) ) {
+ in_array( $check, $checkBlacklist[$code] )
+ ) {
$results[$check] = array();
continue;
}
@@ -384,7 +387,7 @@ ENDS;
echo "[messages are hidden]\n";
} else {
foreach ( $messages as $key => $value ) {
- if( !in_array( $check, $this->nonMessageChecks() ) ) {
+ if ( !in_array( $check, $this->nonMessageChecks() ) ) {
$key = $this->formatKey( $key, $code );
}
if ( $this->level == 2 || empty( $value ) ) {
@@ -411,7 +414,7 @@ ENDS;
$problems = 0;
$detailTextForLangChecks = array();
foreach ( $results as $check => $messages ) {
- if( in_array( $check, $this->nonMessageChecks() ) ) {
+ if ( in_array( $check, $this->nonMessageChecks() ) ) {
continue;
}
$count = count( $messages );
@@ -427,7 +430,6 @@ ENDS;
} else {
$numbers[] = $count;
}
-
}
if ( count( $detailTextForLangChecks ) ) {
@@ -463,13 +465,14 @@ EOL;
* @return bool True if there are any results, false if not.
*/
protected function isEmpty() {
- foreach( $this->results as $results ) {
- foreach( $results as $messages ) {
- if( !empty( $messages ) ) {
+ foreach ( $this->results as $results ) {
+ foreach ( $results as $messages ) {
+ if ( !empty( $messages ) ) {
return false;
}
}
}
+
return true;
}
}
@@ -488,7 +491,7 @@ class CheckExtensionsCLI extends CheckLanguageCLI {
public function __construct( array $options, $extension ) {
if ( isset( $options['help'] ) ) {
echo $this->help();
- exit(1);
+ exit( 1 );
}
if ( isset( $options['lang'] ) ) {
@@ -645,16 +648,16 @@ ENDS;
* @throws MWException
*/
protected function checkLanguage( $code ) {
- foreach( $this->extensions as $extension ) {
+ foreach ( $this->extensions as $extension ) {
$this->L = $extension;
$this->results = array();
$this->results[$code] = parent::checkLanguage( $code );
- if( !$this->isEmpty() ) {
+ if ( !$this->isEmpty() ) {
echo $extension->name() . ":\n";
- if( $this->level > 0 ) {
- switch( $this->output ) {
+ if ( $this->level > 0 ) {
+ switch ( $this->output ) {
case 'plain':
$this->outputText();
break;
@@ -675,48 +678,49 @@ ENDS;
# Blacklist some checks for some languages
$checkBlacklist = array(
#'code' => array( 'check1', 'check2' ... )
-'az' => array( 'plural' ),
-'bo' => array( 'plural' ),
-'dz' => array( 'plural' ),
-'id' => array( 'plural' ),
-'fa' => array( 'plural' ),
-'gan' => array( 'plural' ),
-'gan-hans' => array( 'plural' ),
-'gan-hant' => array( 'plural' ),
-'gn' => array( 'plural' ),
-'hak' => array( 'plural' ),
-'hu' => array( 'plural' ),
-'ja' => array( 'plural' ), // Does not use plural
-'jv' => array( 'plural' ),
-'ka' => array( 'plural' ),
-'kk-arab' => array( 'plural' ),
-'kk-cyrl' => array( 'plural' ),
-'kk-latn' => array( 'plural' ),
-'km' => array( 'plural' ),
-'kn' => array( 'plural' ),
-'ko' => array( 'plural' ),
-'lzh' => array( 'plural' ),
-'mn' => array( 'plural' ),
-'ms' => array( 'plural' ),
-'my' => array( 'plural', 'chars' ), // Uses a lot zwnj
-'sah' => array( 'plural' ),
-'sq' => array( 'plural' ),
-'tet' => array( 'plural' ),
-'th' => array( 'plural' ),
-'to' => array( 'plural' ),
-'tr' => array( 'plural' ),
-'vi' => array( 'plural' ),
-'wuu' => array( 'plural' ),
-'xmf' => array( 'plural' ),
-'yo' => array( 'plural' ),
-'yue' => array( 'plural' ),
-'zh' => array( 'plural' ),
-'zh-classical' => array( 'plural' ),
-'zh-cn' => array( 'plural' ),
-'zh-hans' => array( 'plural' ),
-'zh-hant' => array( 'plural' ),
-'zh-hk' => array( 'plural' ),
-'zh-sg' => array( 'plural' ),
-'zh-tw' => array( 'plural' ),
-'zh-yue' => array( 'plural' ),
+ 'az' => array( 'plural' ),
+ 'bo' => array( 'plural' ),
+ 'cdo' => array( 'plural' ),
+ 'dz' => array( 'plural' ),
+ 'id' => array( 'plural' ),
+ 'fa' => array( 'plural' ),
+ 'gan' => array( 'plural' ),
+ 'gan-hans' => array( 'plural' ),
+ 'gan-hant' => array( 'plural' ),
+ 'gn' => array( 'plural' ),
+ 'hak' => array( 'plural' ),
+ 'hu' => array( 'plural' ),
+ 'ja' => array( 'plural' ), // Does not use plural
+ 'jv' => array( 'plural' ),
+ 'ka' => array( 'plural' ),
+ 'kk-arab' => array( 'plural' ),
+ 'kk-cyrl' => array( 'plural' ),
+ 'kk-latn' => array( 'plural' ),
+ 'km' => array( 'plural' ),
+ 'kn' => array( 'plural' ),
+ 'ko' => array( 'plural' ),
+ 'lzh' => array( 'plural' ),
+ 'mn' => array( 'plural' ),
+ 'ms' => array( 'plural' ),
+ 'my' => array( 'plural', 'chars' ), // Uses a lot zwnj
+ 'sah' => array( 'plural' ),
+ 'sq' => array( 'plural' ),
+ 'tet' => array( 'plural' ),
+ 'th' => array( 'plural' ),
+ 'to' => array( 'plural' ),
+ 'tr' => array( 'plural' ),
+ 'vi' => array( 'plural' ),
+ 'wuu' => array( 'plural' ),
+ 'xmf' => array( 'plural' ),
+ 'yo' => array( 'plural' ),
+ 'yue' => array( 'plural' ),
+ 'zh' => array( 'plural' ),
+ 'zh-classical' => array( 'plural' ),
+ 'zh-cn' => array( 'plural' ),
+ 'zh-hans' => array( 'plural' ),
+ 'zh-hant' => array( 'plural' ),
+ 'zh-hk' => array( 'plural' ),
+ 'zh-sg' => array( 'plural' ),
+ 'zh-tw' => array( 'plural' ),
+ 'zh-yue' => array( 'plural' ),
);
diff --git a/maintenance/language/checkLanguage.php b/maintenance/language/checkLanguage.php
index 99ba4e98..ec6e1226 100644
--- a/maintenance/language/checkLanguage.php
+++ b/maintenance/language/checkLanguage.php
@@ -21,9 +21,9 @@
* @ingroup MaintenanceLanguage
*/
-require_once( __DIR__ . '/../commandLine.inc' );
-require_once( 'checkLanguage.inc' );
-require_once( 'languages.inc' );
+require_once __DIR__ . '/../commandLine.inc';
+require_once 'checkLanguage.inc';
+require_once 'languages.inc';
$cli = new CheckLanguageCLI( $options );
diff --git a/maintenance/language/countMessages.php b/maintenance/language/countMessages.php
index 5058a549..95a7154b 100644
--- a/maintenance/language/countMessages.php
+++ b/maintenance/language/countMessages.php
@@ -21,7 +21,7 @@
* @ingroup MaintenanceLanguage
*/
-require_once( __DIR__ . '/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
/**
* Maintenance script that counts how many messages we have defined
@@ -59,7 +59,7 @@ class CountMessages extends Maintenance {
private function getNumMessages( $file ) {
// Separate function to limit scope
- require( $file );
+ require $file;
if ( isset( $messages ) ) {
return count( $messages );
} else {
@@ -69,4 +69,4 @@ class CountMessages extends Maintenance {
}
$maintClass = "CountMessages";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;
diff --git a/maintenance/language/date-formats.php b/maintenance/language/date-formats.php
index ed12b786..14634185 100644
--- a/maintenance/language/date-formats.php
+++ b/maintenance/language/date-formats.php
@@ -21,7 +21,7 @@
* @ingroup MaintenanceLanguage
*/
-require_once( __DIR__ . '/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
/**
* Maintenance script that tests various language time and date functions.
@@ -79,4 +79,4 @@ class DateFormats extends Maintenance {
}
$maintClass = "DateFormats";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;
diff --git a/maintenance/language/digit2html.php b/maintenance/language/digit2html.php
index 9d4cbe7e..a6e0456a 100644
--- a/maintenance/language/digit2html.php
+++ b/maintenance/language/digit2html.php
@@ -21,7 +21,7 @@
* @ingroup MaintenanceLanguage
*/
-require_once( __DIR__ . '/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
/**
* Maintenance script that check digit transformation.
@@ -49,7 +49,7 @@ class Digit2Html extends Maintenance {
$filename = Language::getMessagesFileName( $code );
$this->output( "Loading language [$code] ... " );
unset( $digitTransformTable );
- require_once( $filename );
+ require_once $filename;
if ( !isset( $digitTransformTable ) ) {
$this->error( "\$digitTransformTable not found for lang: $code" );
continue;
@@ -66,4 +66,4 @@ class Digit2Html extends Maintenance {
}
$maintClass = "Digit2Html";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;
diff --git a/maintenance/language/dumpMessages.php b/maintenance/language/dumpMessages.php
index 0292d314..a72e25b8 100644
--- a/maintenance/language/dumpMessages.php
+++ b/maintenance/language/dumpMessages.php
@@ -23,7 +23,7 @@
* @todo Make this more useful, right now just dumps $wgContLang
*/
-require_once( __DIR__ . '/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
/**
* Maintenance script that dumps an entire language, using the keys from English.
@@ -49,4 +49,4 @@ class DumpMessages extends Maintenance {
}
$maintClass = "DumpMessages";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;
diff --git a/maintenance/language/generateCollationData.php b/maintenance/language/generateCollationData.php
index 12823c0c..fcf2c960 100644
--- a/maintenance/language/generateCollationData.php
+++ b/maintenance/language/generateCollationData.php
@@ -21,7 +21,7 @@
* @ingroup MaintenanceLanguage
*/
-require_once( __DIR__ .'/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
/**
* Generate first letter data files for Collation.php
@@ -102,7 +102,7 @@ class GenerateCollationData extends Maintenance {
$error .= "You are using outdated version of ICU ($icuVersion), intended for "
. ( $unicodeVersion ? "Unicode $unicodeVersion" : "an unknown version of Unicode" )
. "; this file might not be avalaible for it, and it's not supported by MediaWiki. "
- ." You are on your own; consider upgrading PHP's intl extension or try "
+ . " You are on your own; consider upgrading PHP's intl extension or try "
. "one of the files available at:";
} elseif ( version_compare( $icuVersion, "51.0", ">=" ) ) {
// Extra recent version
@@ -386,7 +386,7 @@ class UcdXmlReader {
$this->xml = new XMLReader;
$this->xml->open( $this->fileName );
if ( !$this->xml ) {
- throw new MWException( __METHOD__.": unable to open {$this->fileName}" );
+ throw new MWException( __METHOD__ . ": unable to open {$this->fileName}" );
}
while ( $this->xml->name !== 'ucd' && $this->xml->read() );
$this->xml->read();
@@ -466,4 +466,4 @@ class UcdXmlReader {
}
$maintClass = 'GenerateCollationData';
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;
diff --git a/maintenance/language/generateNormalizerData.php b/maintenance/language/generateNormalizerData.php
index c03162c4..216445e4 100644
--- a/maintenance/language/generateNormalizerData.php
+++ b/maintenance/language/generateNormalizerData.php
@@ -21,9 +21,9 @@
* @ingroup MaintenanceLanguage
*/
-require_once( __DIR__ . '/../../includes/normal/UtfNormalUtil.php' );
+require_once __DIR__ . '/../../includes/normal/UtfNormalUtil.php';
-require_once( __DIR__ . '/../Maintenance.php' );
+require_once __DIR__ . '/../Maintenance.php';
/**
* Generates normalizer data files for Arabic and Malayalam.
@@ -156,4 +156,4 @@ class GenerateNormalizerData extends Maintenance {
}
$maintClass = 'GenerateNormalizerData';
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;
diff --git a/maintenance/language/langmemusage.php b/maintenance/language/langmemusage.php
index ad29efb2..14485f98 100644
--- a/maintenance/language/langmemusage.php
+++ b/maintenance/language/langmemusage.php
@@ -22,8 +22,8 @@
*/
/** This is a command line script */
-require_once( __DIR__ . '/../Maintenance.php' );
-require_once( __DIR__ . '/languages.inc' );
+require_once __DIR__ . '/../Maintenance.php';
+require_once __DIR__ . '/languages.inc';
/**
* Maintenance script that tries to get the memory usage for each language file.
@@ -39,8 +39,9 @@ class LangMemUsage extends Maintenance {
}
public function execute() {
- if ( !function_exists( 'memory_get_usage' ) )
+ if ( !function_exists( 'memory_get_usage' ) ) {
$this->error( "You must compile PHP with --enable-memory-limit", true );
+ }
$langtool = new languages();
$memlast = $memstart = memory_get_usage();
@@ -61,4 +62,4 @@ class LangMemUsage extends Maintenance {
}
$maintClass = "LangMemUsage";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;
diff --git a/maintenance/language/languages.inc b/maintenance/language/languages.inc
index dcd9b9b4..6070f4ab 100644
--- a/maintenance/language/languages.inc
+++ b/maintenance/language/languages.inc
@@ -43,10 +43,10 @@ class languages {
* Load the list of languages: all the Messages*.php
* files in the languages directory.
*
- * @param $exif bool Treat the EXIF messages?
+ * @param $exif bool Treat the Exif messages?
*/
function __construct( $exif = true ) {
- require( __DIR__ . '/messageTypes.inc' );
+ require __DIR__ . '/messageTypes.inc';
$this->mIgnoredMessages = $wgIgnoredMessages;
if ( $exif ) {
$this->mOptionalMessages = array_merge( $wgOptionalMessages );
@@ -107,7 +107,7 @@ class languages {
$this->mSpecialPageAliases[$code] = array();
$filename = Language::getMessagesFileName( $code );
if ( file_exists( $filename ) ) {
- require( $filename );
+ require $filename;
if ( isset( $messages ) ) {
$this->mRawMessages[$code] = $messages;
}
@@ -154,7 +154,7 @@ class languages {
if ( isset( $this->mGeneralMessages['required'][$key] ) ) {
$this->mMessages[$code]['required'][$key] = $value;
$this->mMessages[$code]['translated'][$key] = $value;
- } else if ( isset( $this->mGeneralMessages['optional'][$key] ) ) {
+ } elseif ( isset( $this->mGeneralMessages['optional'][$key] ) ) {
$this->mMessages[$code]['optional'][$key] = $value;
$this->mMessages[$code]['translated'][$key] = $value;
} else {
@@ -184,7 +184,7 @@ class languages {
foreach ( $this->mGeneralMessages['all'] as $key => $value ) {
if ( in_array( $key, $this->mIgnoredMessages ) ) {
$this->mGeneralMessages['ignored'][$key] = $value;
- } else if ( in_array( $key, $this->mOptionalMessages ) ) {
+ } elseif ( in_array( $key, $this->mOptionalMessages ) ) {
$this->mGeneralMessages['optional'][$key] = $value;
$this->mGeneralMessages['translatable'][$key] = $value;
} else {
@@ -466,11 +466,11 @@ class languages {
'[POP]' => "\xE2\x80\xAC",
'[LRO]' => "\xE2\x80\xAD",
'[RLO]' => "\xE2\x80\xAB",
- '[ZWSP]'=> "\xE2\x80\x8B",
- '[NBSP]'=> "\xC2\xA0",
- '[WJ]' => "\xE2\x81\xA0",
+ '[ZWSP]' => "\xE2\x80\x8B",
+ '[NBSP]' => "\xC2\xA0",
+ '[WJ]' => "\xE2\x81\xA0",
'[BOM]' => "\xEF\xBB\xBF",
- '[FFFD]'=> "\xEF\xBF\xBD",
+ '[FFFD]' => "\xEF\xBF\xBD",
);
$wrongRegExp = '/(' . implode( '|', array_values( $wrongChars ) ) . ')/sDu';
$wrongCharsMessages = array();
@@ -500,8 +500,8 @@ class languages {
foreach ( $this->mMessages[$code]['translated'] as $key => $value ) {
$matches = array();
preg_match_all( "/\[\[([{$tc}]+)(?:\\|(.+?))?]]/sDu", $value, $matches );
- for ($i = 0; $i < count($matches[0]); $i++ ) {
- if ( preg_match( "/.*project.*/isDu", $matches[1][$i] ) ) {
+ for ( $i = 0; $i < count( $matches[0] ); $i++ ) {
+ if ( preg_match( "/.*project.*/isDu", $matches[1][$i] ) ) {
$messages[$key][] = $matches[0][$i];
}
}
@@ -563,7 +563,9 @@ class languages {
$this->loadFile( 'en' );
$this->loadFile( $code );
$namespacesDiff = array_diff_key( $this->mNamespaceNames['en'], $this->mNamespaceNames[$code] );
- if ( isset( $namespacesDiff[NS_MAIN] ) ) unset( $namespacesDiff[NS_MAIN] );
+ if ( isset( $namespacesDiff[NS_MAIN] ) ) {
+ unset( $namespacesDiff[NS_MAIN] );
+ }
return $namespacesDiff;
}
@@ -579,7 +581,7 @@ class languages {
$namespaces = array();
# Check default namespace name
- if( isset( $this->mNamespaceNames[$code][NS_PROJECT_TALK] ) ) {
+ if ( isset( $this->mNamespaceNames[$code][NS_PROJECT_TALK] ) ) {
$default = $this->mNamespaceNames[$code][NS_PROJECT_TALK];
if ( strpos( $default, '$1' ) === false ) {
$namespaces[$default] = 'default';
@@ -587,7 +589,7 @@ class languages {
}
# Check namespace aliases
- foreach( $this->mNamespaceAliases[$code] as $key => $value ) {
+ foreach ( $this->mNamespaceAliases[$code] as $key => $value ) {
if ( $value == NS_PROJECT_TALK && strpos( $key, '$1' ) === false ) {
$namespaces[$key] = '';
}
@@ -758,9 +760,9 @@ class extensionLanguages extends languages {
* @param $code string The language code.
*/
protected function loadFile( $code ) {
- if( !isset( $this->mRawMessages[$code] ) ) {
+ if ( !isset( $this->mRawMessages[$code] ) ) {
$this->mRawMessages[$code] = $this->mMessageGroup->load( $code );
- if( empty( $this->mRawMessages[$code] ) ) {
+ if ( empty( $this->mRawMessages[$code] ) ) {
$this->mRawMessages[$code] = array();
}
}
diff --git a/maintenance/language/messageTypes.inc b/maintenance/language/messageTypes.inc
index 66cc1dcc..8676d741 100644
--- a/maintenance/language/messageTypes.inc
+++ b/maintenance/language/messageTypes.inc
@@ -96,7 +96,6 @@ $wgIgnoredMessages = array(
'talkpageheader',
'anonnotice',
'autoblock_whitelist',
- 'searchmenu-help',
'searchmenu-new-nocreate',
'googlesearch',
'opensearch-desc',
@@ -142,6 +141,7 @@ $wgIgnoredMessages = array(
'statistics-footer',
'talkpagetext',
'uploadfooter',
+ 'upload-default-description',
'listgrouprights-link',
'search-interwiki-custom',
'allpages-summary',
@@ -224,6 +224,8 @@ $wgIgnoredMessages = array(
'deletedarticle',
// 'uploadedimage',
// 'overwroteimage',
+ 'createacct-helpusername',
+ 'createacct-imgcaptcha-help',
'userlogout-summary',
'changeemail-summary',
'changepassword-summary',
@@ -242,18 +244,29 @@ $wgIgnoredMessages = array(
'version-summary',
'tags-summary',
'comparepages-summary',
+ 'resettokens-summary',
'version-entrypoints-index-php',
'version-entrypoints-api-php',
'version-entrypoints-load-php',
'ipb-default-expiry',
'pageinfo-header',
'pageinfo-footer',
+ 'createacct-benefit-head1',
+ 'createacct-benefit-icon1',
+ 'createacct-benefit-head2',
+ 'createacct-benefit-icon2',
+ 'createacct-benefit-head3',
+ 'createacct-benefit-icon3',
+ 'today-at',
+ 'redirect-text',
+ 'edithelppage',
+ 'autocomment-prefix',
+ 'move-redirect-text',
);
/** Optional messages, which may be translated only if changed in the target language. */
$wgOptionalMessages = array(
'linkprefix',
- 'editsection-brackets',
'feed-atom',
'feed-rss',
'unit-pixel',
@@ -297,40 +310,24 @@ $wgOptionalMessages = array(
'resetpass_text',
'image_sample',
'media_sample',
- 'skinname-standard',
- 'skinname-nostalgia',
'skinname-cologneblue',
'skinname-monobook',
- 'skinname-myskin',
- 'skinname-chick',
- 'skinname-simple',
'skinname-modern',
'skinname-vector',
'common.css',
- 'standard.css',
- 'nostalgia.css',
'cologneblue.css',
'monobook.css',
- 'myskin.css',
- 'chick.css',
- 'simple.css',
'modern.css',
'vector.css',
'print.css',
- 'handheld.css',
'noscript.css',
'group-autoconfirmed.css',
'group-bot.css',
'group-sysop.css',
'group-bureaucrat.css',
'common.js',
- 'standard.js',
- 'nostalgia.js',
'cologneblue.js',
'monobook.js',
- 'myskin.js',
- 'chick.js',
- 'simple.js',
'modern.js',
'vector.js',
'group-autoconfirmed.js',
@@ -460,7 +457,6 @@ $wgOptionalMessages = array(
'percent',
'parentheses',
'brackets',
- 'autocomment-prefix',
'listgrouprights-right-display',
'listgrouprights-right-revoked',
'timezone-utc',
@@ -485,9 +481,14 @@ $wgOptionalMessages = array(
'pageinfo-redirects-value',
'created', // @deprecated. Remove in MediaWiki 1.23.
'changed', // @deprecated. Remove in MediaWiki 1.23.
+ 'limitreport-ppvisitednodes-value',
+ 'limitreport-ppgeneratednodes-value',
+ 'limitreport-expansiondepth-value',
+ 'limitreport-expensivefunctioncount-value',
+ 'tooltip-iwiki',
);
-/** EXIF messages, which may be set as optional in several checks, but are generally mandatory */
+/** Exif messages, which may be set as optional in several checks, but are generally mandatory */
$wgEXIFMessages = array(
'exif-imagewidth',
'exif-imagelength',
diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc
index c2d5847d..5e8e9744 100644
--- a/maintenance/language/messages.inc
+++ b/maintenance/language/messages.inc
@@ -56,9 +56,6 @@ $wgMessageStructure = array(
'tog-shownumberswatching',
'tog-oldsig',
'tog-fancysig',
- 'tog-externaleditor',
- 'tog-externaldiff',
- 'tog-showjumplinks',
'tog-uselivepreview',
'tog-forceeditsummary',
'tog-watchlisthideown',
@@ -72,6 +69,8 @@ $wgMessageStructure = array(
'tog-showhiddencats',
'tog-noconvertlink',
'tog-norollbackdiff',
+ 'tog-useeditwarning',
+ 'tog-prefershttps'
),
'underline' => array(
'underline-always',
@@ -136,6 +135,18 @@ $wgMessageStructure = array(
'oct',
'nov',
'dec',
+ 'january-date',
+ 'february-date',
+ 'march-date',
+ 'april-date',
+ 'may-date',
+ 'june-date',
+ 'july-date',
+ 'august-date',
+ 'september-date',
+ 'october-date',
+ 'november-date',
+ 'december-date',
),
'categorypages' => array(
'pagecategories',
@@ -226,6 +237,7 @@ $wgMessageStructure = array(
'create-this-page',
'delete',
'deletethispage',
+ 'undeletethispage',
'undelete_short',
'viewdeleted_short',
'protect',
@@ -313,7 +325,6 @@ $wgMessageStructure = array(
'youhavenewmessagesmulti',
'newtalkseparator',
'editsection',
- 'editsection-brackets',
'editold',
'viewsourceold',
'editlink',
@@ -366,8 +377,11 @@ $wgMessageStructure = array(
'errors' => array(
'error',
'databaseerror',
- 'dberrortext',
- 'dberrortextcl',
+ 'databaseerror-text',
+ 'databaseerror-textcl',
+ 'databaseerror-query',
+ 'databaseerror-function',
+ 'databaseerror-error',
'laggedslavemode',
'readonly',
'enterlockreason',
@@ -392,6 +406,7 @@ $wgMessageStructure = array(
'cannotdelete',
'cannotdelete-title',
'delete-hook-aborted',
+ 'no-null-revision',
'badtitle',
'badtitletext',
'perfcached',
@@ -407,11 +422,14 @@ $wgMessageStructure = array(
'viewyourtext',
'protectedinterface',
'editinginterface',
- 'sqlhidden',
'cascadeprotected',
'namespaceprotected',
'customcssprotected',
'customjsprotected',
+ 'mycustomcssprotected',
+ 'mycustomjsprotected',
+ 'myprivateinfoprotected',
+ 'mypreferencesprotected',
'ns-specialprotected',
'titleprotected',
'filereadonlyerror',
@@ -430,10 +448,20 @@ $wgMessageStructure = array(
'welcomeuser',
'welcomecreation-msg',
'yourname',
+ 'userlogin-yourname',
+ 'userlogin-yourname-ph',
+ 'createacct-another-username-ph',
+ 'createacct-helpusername',
'yourpassword',
+ 'userlogin-yourpassword',
+ 'userlogin-yourpassword-ph',
+ 'createacct-yourpassword-ph',
'yourpasswordagain',
+ 'createacct-yourpasswordagain',
+ 'createacct-yourpasswordagain-ph',
'remembermypassword',
- 'securelogin-stick-https',
+ 'userlogin-remembermypassword',
+ 'userlogin-signwithsecure',
'yourdomainname',
'password-change-forbidden',
'externaldberror',
@@ -446,17 +474,49 @@ $wgMessageStructure = array(
'userlogout',
'userlogout-summary',
'notloggedin',
+ 'userlogin-noaccount',
+ 'userlogin-joinproject',
'nologin',
'nologinlink',
'createaccount',
'gotaccount',
'gotaccountlink',
'userlogin-resetlink',
+ 'userlogin-resetpassword-link',
+ 'helplogin-url',
+ 'userlogin-helplink',
+ 'userlogin-loggedin',
+ 'userlogin-createanother',
+ 'createacct-join',
+ 'createacct-another-join',
+ 'createacct-emailrequired',
+ 'createacct-emailoptional',
+ 'createacct-email-ph',
+ 'createacct-another-email-ph',
'createaccountmail',
+ 'createacct-realname',
'createaccountreason',
+ 'createacct-reason',
+ 'createacct-reason-ph',
+ 'createacct-captcha',
+ 'createacct-imgcaptcha-help',
+ 'createacct-imgcaptcha-ph',
+ 'createacct-submit',
+ 'createacct-another-submit',
+ 'createacct-benefit-heading',
+ 'createacct-benefit-icon1',
+ 'createacct-benefit-head1',
+ 'createacct-benefit-body1',
+ 'createacct-benefit-icon2',
+ 'createacct-benefit-head2',
+ 'createacct-benefit-body2',
+ 'createacct-benefit-icon3',
+ 'createacct-benefit-head3',
+ 'createacct-benefit-body3',
'badretype',
'userexists',
'loginerror',
+ 'createacct-error',
'createaccounterror',
'nocookiesnew',
'nocookieslogin',
@@ -508,6 +568,7 @@ $wgMessageStructure = array(
'loginlanguagelabel',
'loginlanguagelinks',
'suspicious-userlogout',
+ 'createacct-another-realname-tip',
),
'mail' => array(
'pear-mail-error',
@@ -525,7 +586,7 @@ $wgMessageStructure = array(
'newpassword',
'retypenew',
'resetpass_submit',
- 'resetpass_success',
+ 'changepassword-success',
'resetpass_forbidden',
'resetpass-no-info',
'resetpass-submit-loggedin',
@@ -536,10 +597,11 @@ $wgMessageStructure = array(
),
'passwordreset' => array(
'passwordreset',
- 'passwordreset-text',
+ 'passwordreset-text-one',
+ 'passwordreset-text-many',
'passwordreset-legend',
'passwordreset-disabled',
- 'passwordreset-pretext',
+ 'passwordreset-emaildisabled',
'passwordreset-username',
'passwordreset-domain',
'passwordreset-capture',
@@ -566,6 +628,18 @@ $wgMessageStructure = array(
'changeemail-submit',
'changeemail-cancel',
),
+ 'resettokens' => array(
+ 'resettokens',
+ 'resettokens-summary',
+ 'resettokens-text',
+ 'resettokens-no-tokens',
+ 'resettokens-legend',
+ 'resettokens-tokens',
+ 'resettokens-token-label',
+ 'resettokens-watchlist-token',
+ 'resettokens-done',
+ 'resettokens-resetbutton',
+ ),
'toolbar' => array(
'bold_sample',
'bold_tip',
@@ -689,6 +763,7 @@ $wgMessageStructure = array(
'edit-gone-missing',
'edit-conflict',
'edit-no-change',
+ 'postedit-confirmation',
'edit-already-exists',
'addsection-preload',
'addsection-editintro',
@@ -696,6 +771,7 @@ $wgMessageStructure = array(
'content-failed-to-parse',
'invalid-content-data',
'content-not-allowed-here',
+ 'editwarning-warning',
),
'contentmodels' => array(
'content-model-wikitext',
@@ -726,6 +802,7 @@ $wgMessageStructure = array(
'undo-failure',
'undo-norev',
'undo-summary',
+ 'undo-summary-username-hidden',
),
'cantcreateaccount' => array(
'cantcreateaccounttitle',
@@ -874,6 +951,7 @@ $wgMessageStructure = array(
'compareselectedversions',
'showhideselectedversions',
'editundo',
+ 'diff-empty',
'diff-multi',
'diff-multi-manyusers',
'difference-missing-revision',
@@ -900,9 +978,7 @@ $wgMessageStructure = array(
'searchmenu-exists',
'searchmenu-new',
'searchmenu-new-nocreate',
- 'searchhelp-url',
'searchmenu-prefix',
- 'searchmenu-help',
'searchprofile-articles',
'searchprofile-project',
'searchprofile-images',
@@ -944,19 +1020,11 @@ $wgMessageStructure = array(
'search-external',
'searchdisabled',
'googlesearch',
+ 'search-error',
),
'opensearch' => array(
'opensearch-desc',
),
- 'quickbar' => array(
- 'qbsettings',
- 'qbsettings-none',
- 'qbsettings-fixedleft',
- 'qbsettings-fixedright',
- 'qbsettings-floatingleft',
- 'qbsettings-floatingright',
- 'qbsettings-directionality',
- ),
'preferences' => array(
'preferences',
'preferences-summary',
@@ -991,7 +1059,6 @@ $wgMessageStructure = array(
'resetprefs',
'restoreprefs',
'prefs-editing',
- 'prefs-edit-boxsize',
'rows',
'columns',
'searchresultshead',
@@ -1002,7 +1069,7 @@ $wgMessageStructure = array(
'recentchangesdays-max',
'recentchangescount',
'prefs-help-recentchangescount',
- 'prefs-help-watchlist-token',
+ 'prefs-help-watchlist-token2',
'savedprefs',
'timezonelegend',
'localtime',
@@ -1033,7 +1100,6 @@ $wgMessageStructure = array(
'prefs-common-css-js',
'prefs-reset-intro',
'prefs-emailconfirm-label',
- 'prefs-textboxsize',
'youremail',
'username',
'uid',
@@ -1068,6 +1134,8 @@ $wgMessageStructure = array(
'prefs-dateformat',
'prefs-timeoffset',
'prefs-advancedediting',
+ 'prefs-editor',
+ 'prefs-preview',
'prefs-advancedrc',
'prefs-advancedrendering',
'prefs-advancedsearchoptions',
@@ -1075,7 +1143,9 @@ $wgMessageStructure = array(
'prefs-displayrc',
'prefs-displaysearchoptions',
'prefs-displaywatchlist',
+ 'prefs-tokenwatchlist',
'prefs-diffs',
+ 'prefs-help-prefershttps',
),
'preferences-email' => array(
'email-address-validity-valid',
@@ -1102,6 +1172,8 @@ $wgMessageStructure = array(
'userrights-changeable-col',
'userrights-unchangeable-col',
'userrights-irreversible-marker',
+ 'userrights-conflict',
+ 'userrights-removed-self',
),
'group' => array(
'group',
@@ -1170,10 +1242,18 @@ $wgMessageStructure = array(
'right-unblockself',
'right-protect',
'right-editprotected',
+ 'right-editsemiprotected',
'right-editinterface',
'right-editusercssjs',
'right-editusercss',
'right-edituserjs',
+ 'right-editmyusercss',
+ 'right-editmyuserjs',
+ 'right-viewmywatchlist',
+ 'right-editmywatchlist',
+ 'right-viewmyprivateinfo',
+ 'right-editmyprivateinfo',
+ 'right-editmyoptions',
'right-rollback',
'right-markbotedits',
'right-noratelimit',
@@ -1235,14 +1315,21 @@ $wgMessageStructure = array(
'action-userrights-interwiki',
'action-siteadmin',
'action-sendemail',
+ 'action-editmywatchlist',
+ 'action-viewmywatchlist',
+ 'action-viewmyprivateinfo',
+ 'action-editmyprivateinfo',
),
'recentchanges' => array(
'nchanges',
+ 'enhancedrc-since-last-visit',
+ 'enhancedrc-history',
'recentchanges',
'recentchanges-url',
'recentchanges-legend',
'recentchanges-summary',
'recentchangestext',
+ 'recentchanges-noresult',
'recentchanges-feed-description',
'recentchanges-label-newpage',
'recentchanges-label-minor',
@@ -1282,7 +1369,6 @@ $wgMessageStructure = array(
'recentchangeslinked-feed',
'recentchangeslinked-toolbox',
'recentchangeslinked-title',
- 'recentchangeslinked-noresult',
'recentchangeslinked-summary',
'recentchangeslinked-page',
'recentchangeslinked-to',
@@ -1304,6 +1390,7 @@ $wgMessageStructure = array(
'upload-preferred',
'upload-prohibited',
'uploadfooter',
+ 'upload-default-description',
'uploadlog',
'uploadlogpage',
'uploadlogpagetext',
@@ -1481,7 +1568,6 @@ $wgMessageStructure = array(
'http-read-error',
'http-timed-out',
'http-curl-error',
- 'http-host-unreachable',
'http-bad-status',
),
@@ -1512,6 +1598,10 @@ $wgMessageStructure = array(
'listfiles_size',
'listfiles_description',
'listfiles_count',
+ 'listfiles-show-all',
+ 'listfiles-latestversion',
+ 'listfiles-latestversion-yes',
+ 'listfiles-latestversion-no',
),
'filedescription' => array(
'file-anchor-link',
@@ -1605,6 +1695,13 @@ $wgMessageStructure = array(
'randompage-nopages',
'randompage-url',
),
+ 'randomincategory' => array(
+ 'randomincategory',
+ 'randomincategory-invalidcategory',
+ 'randomincategory-nopages',
+ 'randomincategory-selectcategory',
+ 'randomincategory-selectcategory-submit',
+ ),
'randomredirect' => array(
'randomredirect',
'randomredirect-nopages',
@@ -1632,12 +1729,6 @@ $wgMessageStructure = array(
'statistics-mostpopular',
'statistics-footer',
),
- 'disambiguations' => array(
- 'disambiguations',
- 'disambiguations-summary',
- 'disambiguationspage',
- 'disambiguations-text',
- ),
'pageswithprop' => array(
'pageswithprop',
'pageswithprop-summary',
@@ -1645,6 +1736,8 @@ $wgMessageStructure = array(
'pageswithprop-text',
'pageswithprop-prop',
'pageswithprop-submit',
+ 'pageswithprop-prophidden-long',
+ 'pageswithprop-prophidden-binary',
),
'doubleredirects' => array(
'doubleredirects',
@@ -1728,6 +1821,7 @@ $wgMessageStructure = array(
'prefixindex',
'prefixindex-namespace',
'prefixindex-summary',
+ 'prefixindex-strip',
'shortpages',
'shortpages-summary',
'longpages',
@@ -1749,6 +1843,7 @@ $wgMessageStructure = array(
'listusers-summary',
'listusers-editsonly',
'listusers-creationsort',
+ 'listusers-desc',
'usereditcount',
'usercreated',
'newpages',
@@ -1934,7 +2029,6 @@ $wgMessageStructure = array(
'unwatchthispage',
'notanarticle',
'notvisiblerev',
- 'watchnochange',
'watchlist-details',
'wlheader-enotif',
'wlheader-showupdated',
@@ -2284,14 +2378,12 @@ $wgMessageStructure = array(
'ipb_blocked_as_range',
'ip_range_invalid',
'ip_range_toolarge',
- 'blockme',
'proxyblocker',
- 'proxyblocker-disabled',
'proxyblockreason',
- 'proxyblocksuccess',
'sorbs',
'sorbsreason',
'sorbs_create_account_reason',
+ 'xffblockreason',
'cant-block-while-blocked',
'cant-see-hidden-user',
'ipbblocked',
@@ -2355,6 +2447,7 @@ $wgMessageStructure = array(
'movesubpagetext',
'movenosubpage',
'movereason',
+ 'move-redirect-text',
'revertmove',
'delete_and_move',
'delete_and_move_text',
@@ -2416,6 +2509,7 @@ $wgMessageStructure = array(
'thumbnail-more',
'filemissing',
'thumbnail_error',
+ 'thumbnail_error_remote',
'djvu_page_error',
'djvu_no_xml',
'thumbnail-temp-create',
@@ -2488,7 +2582,7 @@ $wgMessageStructure = array(
'javascripttest-pagetext-noframework',
'javascripttest-pagetext-unknownframework',
'javascripttest-pagetext-frameworks',
- 'javascripttest-pagetext-skins' ,
+ 'javascripttest-pagetext-skins',
'javascripttest-qunit-name',
'javascripttest-qunit-intro',
'javascripttest-qunit-heading',
@@ -2633,20 +2727,15 @@ $wgMessageStructure = array(
'tooltip-undo',
'tooltip-preferences-save',
'tooltip-summary',
+ 'interlanguage-link-title',
),
'stylesheets' => array(
'common.css',
- 'standard.css',
- 'nostalgia.css',
'cologneblue.css',
'monobook.css',
- 'myskin.css',
- 'chick.css',
- 'simple.css',
'modern.css',
'vector.css',
'print.css',
- 'handheld.css',
'noscript.css',
'group-autoconfirmed.css',
'group-bot.css',
@@ -2655,13 +2744,8 @@ $wgMessageStructure = array(
),
'scripts' => array(
'common.js',
- 'standard.js',
- 'nostalgia.js',
'cologneblue.js',
'monobook.js',
- 'myskin.js',
- 'chick.js',
- 'simple.js',
'modern.js',
'vector.js',
'group-autoconfirmed.js',
@@ -2692,6 +2776,7 @@ $wgMessageStructure = array(
'spam_reverting',
'spam_blanking',
'spam_deleting',
+ 'simpleantispam-label',
),
'info' => array(
'pageinfo-header',
@@ -2743,13 +2828,8 @@ $wgMessageStructure = array(
'pageinfo-category-files'
),
'skin' => array(
- 'skinname-standard',
- 'skinname-nostalgia',
'skinname-cologneblue',
'skinname-monobook',
- 'skinname-myskin',
- 'skinname-chick',
- 'skinname-simple',
'skinname-modern',
'skinname-vector',
),
@@ -2832,11 +2912,26 @@ $wgMessageStructure = array(
'minutes',
'hours',
'days',
+ 'weeks',
'months',
'years',
'ago',
'just-now',
),
+ 'human-timestamps' => array(
+ 'hours-ago',
+ 'minutes-ago',
+ 'seconds-ago',
+ 'monday-at',
+ 'tuesday-at',
+ 'wednesday-at',
+ 'thursday-at',
+ 'friday-at',
+ 'saturday-at',
+ 'sunday-at',
+ 'today-at',
+ 'yesterday-at',
+ ),
'badimagelist' => array(
'bad_image_list',
),
@@ -3192,16 +3287,16 @@ $wgMessageStructure = array(
'exif-lightsource-255',
),
'exif-flash' => array(
- 'exif-flash-fired-0' ,
- 'exif-flash-fired-1' ,
- 'exif-flash-return-0' ,
- 'exif-flash-return-2' ,
- 'exif-flash-return-3' ,
- 'exif-flash-mode-1' ,
- 'exif-flash-mode-2' ,
- 'exif-flash-mode-3' ,
- 'exif-flash-function-1' ,
- 'exif-flash-redeye-1' ,
+ 'exif-flash-fired-0',
+ 'exif-flash-fired-1',
+ 'exif-flash-return-0',
+ 'exif-flash-return-2',
+ 'exif-flash-return-3',
+ 'exif-flash-mode-1',
+ 'exif-flash-mode-2',
+ 'exif-flash-mode-3',
+ 'exif-flash-function-1',
+ 'exif-flash-redeye-1',
),
'exif-focalplaneresolutionunit' => array(
'exif-focalplaneresolutionunit-2',
@@ -3596,7 +3691,6 @@ $wgMessageStructure = array(
'version-other',
'version-mediahandlers',
'version-hooks',
- 'version-extension-functions',
'version-parser-extensiontags',
'version-parser-function-hooks',
'version-hook-name',
@@ -3606,6 +3700,7 @@ $wgMessageStructure = array(
'version-license',
'version-poweredby-credits',
'version-poweredby-others',
+ 'version-poweredby-translators',
'version-credits-summary',
'version-license-info',
'version-software',
@@ -3620,11 +3715,18 @@ $wgMessageStructure = array(
'version-entrypoints-api-php',
'version-entrypoints-load-php',
),
- 'filepath' => array(
- 'filepath',
- 'filepath-page',
- 'filepath-submit',
- 'filepath-summary',
+ 'redirect' => array(
+ 'redirect',
+ 'redirect-legend',
+ 'redirect-text',
+ 'redirect-summary',
+ 'redirect-submit',
+ 'redirect-lookup',
+ 'redirect-value',
+ 'redirect-user',
+ 'redirect-revision',
+ 'redirect-file',
+ 'redirect-not-exists',
),
'fileduplicatesearch' => array(
'fileduplicatesearch',
@@ -3666,12 +3768,16 @@ $wgMessageStructure = array(
'tags-summary',
'tag-filter',
'tag-filter-submit',
+ 'tag-list-wrapper',
'tags-title',
'tags-intro',
'tags-tag',
'tags-display-header',
'tags-description-header',
+ 'tags-active-header',
'tags-hitcount-header',
+ 'tags-active-yes',
+ 'tags-active-no',
'tags-edit',
'tags-hitcount',
),
@@ -3693,6 +3799,7 @@ $wgMessageStructure = array(
'dberr-problems',
'dberr-again',
'dberr-info',
+ 'dberr-info-hidden',
'dberr-usegoogle',
'dberr-outofdate',
'dberr-cachederror',
@@ -3708,6 +3815,9 @@ $wgMessageStructure = array(
'htmlform-submit',
'htmlform-reset',
'htmlform-selectorother-other',
+ 'htmlform-no',
+ 'htmlform-yes',
+ 'htmlform-chosen-placeholder',
),
'sqlite' => array(
'sqlite-has-fts',
@@ -3856,6 +3966,25 @@ $wgMessageStructure = array(
'rotation' => array(
'rotate-comment',
),
+ 'limitreport' => array(
+ 'limitreport-title',
+ 'limitreport-cputime',
+ 'limitreport-cputime-value',
+ 'limitreport-walltime',
+ 'limitreport-walltime-value',
+ 'limitreport-ppvisitednodes',
+ 'limitreport-ppvisitednodes-value',
+ 'limitreport-ppgeneratednodes',
+ 'limitreport-ppgeneratednodes-value',
+ 'limitreport-postexpandincludesize',
+ 'limitreport-postexpandincludesize-value',
+ 'limitreport-templateargumentsize',
+ 'limitreport-templateargumentsize-value',
+ 'limitreport-expansiondepth',
+ 'limitreport-expansiondepth-value',
+ 'limitreport-expensivefunctioncount',
+ 'limitreport-expensivefunctioncount-value',
+ ),
);
/** Comments for each block */
@@ -3864,8 +3993,8 @@ $wgBlockComments = array(
begin with * or ** are discarded, furthermore lines that do begin with ** and
do not contain | are also discarded, but do not depend on this behavior for
future releases. Also note that since each list value is wrapped in a unique
-XHTML id it should only appear once and include characters that are legal
-XHTML id names.",
+(X)HTML id it should only appear once and include characters that are legal
+(X)HTML id names.",
'toggles' => 'User preference toggles',
'underline' => '',
'editfont' => 'Font style option in Special:Preferences',
@@ -3876,7 +4005,7 @@ XHTML id names.",
'cologneblue' => 'Cologne Blue skin',
'vector' => 'Vector skin',
'miscellaneous2' => '',
- 'links' => 'All link text and link target definitions of links into project namespace that get used by other message strings, with the exception of user group pages (see grouppage) and the disambiguation template definition (see disambiguations).',
+ 'links' => 'All link text and link target definitions of links into project namespace that get used by other message strings, with the exception of user group pages (see grouppage).',
'badaccess' => '',
'versionrequired' => '',
'miscellaneous3' => '',
@@ -3890,6 +4019,7 @@ XHTML id names.",
'resetpass' => 'Change password dialog',
'passwordreset' => 'Special:PasswordReset',
'changeemail' => 'Special:ChangeEmail',
+ 'resettokens' => 'Special:ResetTokens',
'toolbar' => 'Edit page toolbar',
'edit' => 'Edit pages',
'parserwarnings' => 'Parser/template warnings',
@@ -3905,7 +4035,6 @@ XHTML id names.",
'diffs' => 'Diffs',
'search' => 'Search results',
'opensearch' => 'OpenSearch description',
- 'quickbar' => 'Quickbar',
'preferences' => 'Preferences page',
'preferences-email' => 'User preference: email validation using jQuery',
'userrights' => 'User rights',
@@ -3937,9 +4066,9 @@ XHTML id names.",
'listredirects' => 'List redirects',
'unusedtemplates' => 'Unused templates',
'randompage' => 'Random page',
+ 'randomincategory' => 'Random page in category',
'randomredirect' => 'Random redirect',
'statistics' => 'Statistics',
- 'disambiguations' => '',
'pageswithprop' => '',
'doubleredirects' => '',
'brokenredirects' => '',
@@ -3995,8 +4124,9 @@ XHTML id names.",
'patrol-log' => 'Patrol log',
'imagedeletion' => 'Image deletion',
'browsediffs' => 'Browsing diffs',
- 'newfiles' => 'Special:NewFiles',
+ 'newfiles' => 'Special:NewFiles',
'video-info' => 'Video information, used by Language::formatTimePeriod() to format lengths in the above messages',
+ 'human-timestamps' => 'Human-readable timestamps',
'badimagelist' => 'Bad image list',
'variantname-zh' => "Short names for language variants used for language conversion links.
Variants for Chinese language",
@@ -4009,9 +4139,9 @@ Variants for Chinese language",
'variantname-shi' => 'Variants for Tachelhit language',
'media-info' => 'Media information',
'metadata' => 'Metadata',
- 'exif' => 'EXIF tags',
+ 'exif' => 'Exif tags',
'exif-values' => 'Make & model, can be wikified in order to link to the camera and model name',
- 'exif-compression' => 'EXIF attributes',
+ 'exif-compression' => 'Exif attributes',
'exif-copyrighted' => '',
'exif-unknowndate' => '',
'exif-photometricinterpretation' => '',
@@ -4080,7 +4210,7 @@ Variants for Chinese language",
'signatures' => 'Signatures',
'CoreParserFunctions' => 'Core parser functions',
'version' => 'Special:Version',
- 'filepath' => 'Special:FilePath',
+ 'redirect' => 'Special:Redirect',
'fileduplicatesearch' => 'Special:FileDuplicateSearch',
'special-specialpages' => 'Special:SpecialPages',
'special-blank' => 'Special:BlankPage',
@@ -4098,4 +4228,5 @@ Variants for Chinese language",
'duration' => 'Durations',
'cachedspecial' => 'SpecialCachedPage',
'rotation' => 'Image rotation',
+ 'limitreport' => 'Limit report',
);
diff --git a/maintenance/language/rebuildLanguage.php b/maintenance/language/rebuildLanguage.php
index ad839054..66948aeb 100644
--- a/maintenance/language/rebuildLanguage.php
+++ b/maintenance/language/rebuildLanguage.php
@@ -22,9 +22,9 @@
* @defgroup MaintenanceLanguage MaintenanceLanguage
*/
-require_once( __DIR__ . '/../commandLine.inc' );
-require_once( 'languages.inc' );
-require_once( 'writeMessagesArray.inc' );
+require_once __DIR__ . '/../commandLine.inc';
+require_once 'languages.inc';
+require_once 'writeMessagesArray.inc';
/**
* Rewrite a messages array.
@@ -56,13 +56,13 @@ function rebuildLanguage( $languages, $code, $write, $listUnknown, $removeUnknow
*/
function removeDupes( $oldMsgArray, $dupeMsgSource ) {
if ( file_exists( $dupeMsgSource ) ) {
- include( $dupeMsgSource );
+ include $dupeMsgSource;
if ( !isset( $dupeMessages ) ) {
- echo( "There are no duplicated messages in the source file provided." );
+ echo "There are no duplicated messages in the source file provided.";
exit( 1 );
}
} else {
- echo ( "The specified file $dupeMsgSource cannot be found." );
+ echo "The specified file $dupeMsgSource cannot be found.";
exit( 1 );
}
$newMsgArray = $oldMsgArray;
diff --git a/maintenance/language/transstat.php b/maintenance/language/transstat.php
index ba503224..61b84a07 100644
--- a/maintenance/language/transstat.php
+++ b/maintenance/language/transstat.php
@@ -28,9 +28,9 @@
*/
$optionsWithArgs = array( 'output' );
-require_once( __DIR__ . '/../commandLine.inc' );
-require_once( 'languages.inc' );
-require_once( __DIR__ . '/StatOutputs.php' );
+require_once __DIR__ . '/../commandLine.inc';
+require_once 'languages.inc';
+require_once __DIR__ . '/StatOutputs.php';
if ( isset( $options['help'] ) ) {
@@ -96,7 +96,7 @@ $wgRequiredMessagesNumber = count( $wgGeneralMessages['required'] );
foreach ( $wgLanguages->getLanguages() as $code ) {
# Don't check English, RTL English or dummy language codes
- if ( $code == 'en' || $code == 'enRTL' || (is_array( $wgDummyLanguageCodes ) &&
+ if ( $code == 'en' || $code == 'enRTL' || ( is_array( $wgDummyLanguageCodes ) &&
isset( $wgDummyLanguageCodes[$code] ) ) ) {
continue;
}
diff --git a/maintenance/language/validate.php b/maintenance/language/validate.php
index 4f00496f..63d9b847 100644
--- a/maintenance/language/validate.php
+++ b/maintenance/language/validate.php
@@ -36,8 +36,8 @@ define( 'NOT_REALLY_MEDIAWIKI', 1 );
$IP = __DIR__ . '/../..';
-require_once( "$IP/includes/Defines.php" );
-require_once( "$IP/languages/Language.php" );
+require_once "$IP/includes/Defines.php";
+require_once "$IP/languages/Language.php";
$files = array();
foreach ( $argv as $arg ) {
@@ -57,7 +57,7 @@ foreach ( $files as $filename ) {
}
function getVars( $filename ) {
- require( $filename );
+ require $filename;
$vars = get_defined_vars();
unset( $vars['filename'] );
return $vars;
diff --git a/maintenance/language/writeMessagesArray.inc b/maintenance/language/writeMessagesArray.inc
index b2e04c7f..fc0da3f5 100644
--- a/maintenance/language/writeMessagesArray.inc
+++ b/maintenance/language/writeMessagesArray.inc
@@ -50,25 +50,27 @@ class MessageWriter {
$sortedMessages = $messages[1];
# Write to the file
- if ( $messagesFolder )
+ if ( $messagesFolder ) {
$filename = Language::getFileName( "$messagesFolder/Messages", $code );
- else
+ } else {
$filename = Language::getMessagesFileName( $code );
+ }
- if ( file_exists( $filename ) )
+ if ( file_exists( $filename ) ) {
$contents = file_get_contents( $filename );
- else
+ } else {
$contents = '<?php
$messages = array(
);
';
+ }
- if( strpos( $contents, '$messages' ) !== false ) {
+ if ( strpos( $contents, '$messages' ) !== false ) {
$contents = explode( '$messages', $contents );
- if( $messagesText == '$messages' . $contents[1] ) {
+ if ( $messagesText == '$messages' . $contents[1] ) {
echo "Generated messages for language $code. Same as the current file.\n";
} else {
- if( $write ) {
+ if ( $write ) {
$new = $contents[0];
$new .= $messagesText;
file_put_contents( $filename, $new );
@@ -77,12 +79,13 @@ $messages = array(
echo "Generated messages for language $code. Please run the script again (without the parameter \"dry-run\") to write the array to the file.\n";
}
}
- if( $listUnknown && isset( $sortedMessages['unknown'] ) && !empty( $sortedMessages['unknown'] ) ) {
- if ( $removeUnknown )
+ if ( $listUnknown && isset( $sortedMessages['unknown'] ) && !empty( $sortedMessages['unknown'] ) ) {
+ if ( $removeUnknown ) {
echo "\nThe following " . count( $sortedMessages['unknown'] ) . " unknown messages have been removed:\n";
- else
+ } else {
echo "\nThere are " . count( $sortedMessages['unknown'] ) . " unknown messages, please check them:\n";
- foreach( $sortedMessages['unknown'] as $key => $value ) {
+ }
+ foreach ( $sortedMessages['unknown'] as $key => $value ) {
echo "* " . $key . "\n";
}
}
@@ -107,22 +110,22 @@ $messages = array(
# Load messages
$dir = $prefix ? $prefix : __DIR__;
- require( $dir . '/messages.inc' );
+ require $dir . '/messages.inc';
self::$messageStructure = $wgMessageStructure;
self::$blockComments = $wgBlockComments;
- require( $dir . '/messageTypes.inc' );
+ require $dir . '/messageTypes.inc';
self::$ignoredMessages = $wgIgnoredMessages;
self::$optionalMessages = $wgOptionalMessages;
# Sort messages to blocks
$sortedMessages['unknown'] = $messages;
- foreach( self::$messageStructure as $blockName => $block ) {
+ foreach ( self::$messageStructure as $blockName => $block ) {
/**
* @var $block array
*/
- foreach( $block as $key ) {
- if( array_key_exists( $key, $sortedMessages['unknown'] ) ) {
+ foreach ( $block as $key ) {
+ if ( array_key_exists( $key, $sortedMessages['unknown'] ) ) {
$sortedMessages[$blockName][$key] = $sortedMessages['unknown'][$key];
unset( $sortedMessages['unknown'][$key] );
}
@@ -132,13 +135,13 @@ $messages = array(
# Write all the messages
$messagesText = "\$messages = array(
";
- foreach( $sortedMessages as $block => $messages ) {
+ foreach ( $sortedMessages as $block => $messages ) {
# Skip if it's the block of unknown messages - handle that in the end of file
- if( $block == 'unknown' ) {
+ if ( $block == 'unknown' ) {
continue;
}
- if( $ignoredComments ) {
+ if ( $ignoredComments ) {
$ignored = self::$ignoredMessages;
$optional = self::$optionalMessages;
} else {
@@ -175,10 +178,10 @@ $messages = array(
$commentArray = array();
# List of keys only
- foreach( $messages as $key ) {
- if( in_array( $key, $ignored ) ) {
+ foreach ( $messages as $key ) {
+ if ( in_array( $key, $ignored ) ) {
$commentArray[$key] = ' # ' . self::$ignoredComment;
- } elseif( in_array( $key, $optional ) ) {
+ } elseif ( in_array( $key, $optional ) ) {
$commentArray[$key] = ' # ' . self::$optionalComment;
}
}
@@ -202,13 +205,13 @@ $messages = array(
$blockText = '';
# Skip the block if it includes no messages
- if( empty( $messages ) ) {
+ if ( empty( $messages ) ) {
return '';
}
# Format the block comment (if exists); check for multiple lines comments
- if( !empty( $blockComment ) ) {
- if( strpos( $blockComment, "\n" ) === false ) {
+ if ( !empty( $blockComment ) ) {
+ if ( strpos( $blockComment, "\n" ) === false ) {
$blockText .= "$prefix# $blockComment
";
} else {
@@ -223,7 +226,7 @@ $blockComment
$maxKeyLength = max( array_map( 'strlen', array_keys( $messages ) ) );
# Format the messages
- foreach( $messages as $key => $value ) {
+ foreach ( $messages as $key => $value ) {
# Add the key name
$blockText .= "$prefix'$key'";
@@ -241,16 +244,16 @@ $blockComment
$single = "'";
$double = '"';
- if( strpos( $value, $single ) === false ) {
+ if ( strpos( $value, $single ) === false ) {
# Nothing ugly, just use '
- $blockText .= $single.$value.$single;
- } elseif( strpos( $value, $double ) === false && !preg_match('/\$[a-zA-Z_\x7f-\xff]/', $value) ) {
+ $blockText .= $single . $value . $single;
+ } elseif ( strpos( $value, $double ) === false && !preg_match( '/\$[a-zA-Z_\x7f-\xff]/', $value ) ) {
# No "-quotes, no variables that need quoting, use "
- $blockText .= $double.$value.$double;
+ $blockText .= $double . $value . $double;
} else {
# Something needs quoting, pick the quote which causes less quoting
$quote = substr_count( $value, $double ) + substr_count( $value, '$' ) >= substr_count( $value, $single ) ? $single : $double;
- if( $quote === $double ) {
+ if ( $quote === $double ) {
$extra = '$';
} else {
$extra = '';
@@ -262,7 +265,7 @@ $blockComment
$blockText .= ',';
# Add comments, if there is any
- if( array_key_exists( $key, $messageComments ) ) {
+ if ( array_key_exists( $key, $messageComments ) ) {
$blockText .= $messageComments[$key];
}