*/
class Languages {
/** @var array List of languages */
- protected $mLanguages; #
+ protected $mLanguages;
- /** @var array Raw list of the messages in each language */
+ /** @var array Raw list of the messages in each language */
protected $mRawMessages;
/** @var array Messages in each language (except for English), divided to groups */
/**
* Load the list of languages: all the Messages*.php
* files in the languages directory.
- *
- * @param $exif bool Treat the Exif messages?
*/
- function __construct( $exif = true ) {
- require __DIR__ . '/messageTypes.inc';
- $this->mIgnoredMessages = $wgIgnoredMessages;
- if ( $exif ) {
- $this->mOptionalMessages = array_merge( $wgOptionalMessages );
- } else {
- $this->mOptionalMessages = array_merge( $wgOptionalMessages, $wgEXIFMessages );
- }
+ function __construct() {
+ wfRunHooks( 'LocalisationIgnoredOptionalMessages',
+ array( &$this->mIgnoredMessages, &$this->mOptionalMessages ) );
$this->mLanguages = array_keys( Language::fetchLanguageNames( null, 'mwfile' ) );
sort( $this->mLanguages );
/**
* Load the language file.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*/
protected function loadFile( $code ) {
if ( isset( $this->mRawMessages[$code] ) &&
* translated - messages which are either required or optional, but translated from
* English and needed.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*/
private function loadMessages( $code ) {
if ( isset( $this->mMessages[$code] ) ) {
* translated - messages which are either required or optional, but translated from
* English and needed.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return string The messages in this language.
*/
/**
* Get fallback language code for a specific language.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return string Fallback code.
*/
/**
* Get namespace names for a specific language.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array Namespace names.
*/
/**
* Get namespace aliases for a specific language.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array Namespace aliases.
*/
/**
* Get magic words for a specific language.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array Magic words.
*/
/**
* Get special page aliases for a specific language.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array Special page aliases.
*/
/**
* Get the untranslated messages for a specific language.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The untranslated messages for this language.
*/
/**
* Get the duplicate messages for a specific language.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The duplicate messages for this language.
*/
/**
* Get the obsolete messages for a specific language.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The obsolete messages for this language.
*/
/**
* Get the messages whose variables do not match the original ones.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The messages whose variables do not match the original ones.
*/
/**
* Get the messages which do not use plural.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The messages which do not use plural in this language.
*/
/**
* Get the empty messages.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The empty messages for this language.
*/
/**
* Get the messages with trailing whitespace.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The messages with trailing whitespace in this language.
*/
/**
* Get the non-XHTML messages.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The non-XHTML messages for this language.
*/
/**
* Get the messages which include wrong characters.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The messages which include wrong characters in this language.
*/
/**
* Get the messages which include dubious links.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The messages which include dubious links in this language.
*/
/**
* Get the messages which include unbalanced brackets.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The messages which include unbalanced brackets in this language.
*/
/**
* Get the untranslated namespace names.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The untranslated namespace names in this language.
*/
/**
* Get the project talk namespace names with no $1.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The problematic project talk namespaces in this language.
*/
/**
* Get the untranslated magic words.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The untranslated magic words in this language.
*/
/**
* Get the obsolete magic words.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The obsolete magic words in this language.
*/
/**
* Get the magic words that override the original English magic word.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The overriding magic words in this language.
*/
/**
* Get the magic words which do not match the case-sensitivity of the original words.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The magic words whose case does not match in this language.
*/
/**
* Get the untranslated special page names.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The untranslated special page names in this language.
*/
/**
* Get the obsolete special page names.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*
* @return array The obsolete special page names in this language.
*/
/**
* Load the messages group.
- * @param $group MessageGroup The messages group.
+ * @param MessageGroup $group The messages group.
*/
function __construct( MessageGroup $group ) {
$this->mMessageGroup = $group;
/**
* Load the language file.
*
- * @param $code string The language code.
+ * @param string $code The language code.
*/
protected function loadFile( $code ) {
if ( !isset( $this->mRawMessages[$code] ) ) {