Merge "Remove use of strencode() in buildLike()"
[lhc/web/wiklou.git] / maintenance / language / languages.inc
index 0483aea..9c9b7ff 100644 (file)
@@ -26,9 +26,9 @@
  */
 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 */
@@ -61,17 +61,10 @@ class Languages {
        /**
         * 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 );
@@ -107,7 +100,7 @@ class Languages {
        /**
         * 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] ) &&
@@ -165,7 +158,7 @@ class Languages {
         * 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] ) ) {
@@ -237,7 +230,7 @@ class Languages {
         * 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.
         */
@@ -269,7 +262,7 @@ class Languages {
        /**
         * Get fallback language code for a specific language.
         *
-        * @param $code string The language code.
+        * @param string $code The language code.
         *
         * @return string Fallback code.
         */
@@ -282,7 +275,7 @@ class Languages {
        /**
         * Get namespace names for a specific language.
         *
-        * @param $code string The language code.
+        * @param string $code The language code.
         *
         * @return array Namespace names.
         */
@@ -295,7 +288,7 @@ class Languages {
        /**
         * Get namespace aliases for a specific language.
         *
-        * @param $code string The language code.
+        * @param string $code The language code.
         *
         * @return array Namespace aliases.
         */
@@ -308,7 +301,7 @@ class Languages {
        /**
         * Get magic words for a specific language.
         *
-        * @param $code string The language code.
+        * @param string $code The language code.
         *
         * @return array Magic words.
         */
@@ -321,7 +314,7 @@ class Languages {
        /**
         * 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.
         */
@@ -334,7 +327,7 @@ class Languages {
        /**
         * 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.
         */
@@ -348,7 +341,7 @@ class Languages {
        /**
         * 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.
         */
@@ -368,7 +361,7 @@ class Languages {
        /**
         * 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.
         */
@@ -382,7 +375,7 @@ class Languages {
        /**
         * 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.
         */
@@ -416,7 +409,7 @@ class Languages {
        /**
         * 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.
         */
@@ -438,7 +431,7 @@ class Languages {
        /**
         * Get the empty messages.
         *
-        * @param $code string The language code.
+        * @param string $code The language code.
         *
         * @return array The empty messages for this language.
         */
@@ -458,7 +451,7 @@ class Languages {
        /**
         * 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.
         */
@@ -478,7 +471,7 @@ class Languages {
        /**
         * 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.
         */
@@ -507,7 +500,7 @@ class Languages {
        /**
         * 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.
         */
@@ -545,7 +538,7 @@ class Languages {
        /**
         * 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.
         */
@@ -575,7 +568,7 @@ class Languages {
        /**
         * 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.
         */
@@ -613,7 +606,7 @@ class Languages {
        /**
         * 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.
         */
@@ -631,7 +624,7 @@ class Languages {
        /**
         * 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.
         */
@@ -660,7 +653,7 @@ class Languages {
        /**
         * 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.
         */
@@ -680,7 +673,7 @@ class Languages {
        /**
         * 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.
         */
@@ -700,7 +693,7 @@ class Languages {
        /**
         * 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.
         */
@@ -730,7 +723,7 @@ class Languages {
        /**
         * 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.
         */
@@ -754,7 +747,7 @@ class Languages {
        /**
         * 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.
         */
@@ -774,7 +767,7 @@ class Languages {
        /**
         * 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.
         */
@@ -800,7 +793,7 @@ class ExtensionLanguages extends Languages {
 
        /**
         * Load the messages group.
-        * @param $group MessageGroup The messages group.
+        * @param MessageGroup $group The messages group.
         */
        function __construct( MessageGroup $group ) {
                $this->mMessageGroup = $group;
@@ -821,7 +814,7 @@ class ExtensionLanguages extends Languages {
        /**
         * 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] ) ) {