Merge "Sanitizer: Allow attribute names to use any Unicode "Letter" or "Number""
[lhc/web/wiklou.git] / languages / Language.php
index f84e21e..83dff65 100644 (file)
@@ -361,7 +361,6 @@ class Language {
         * @return bool
         */
        public static function isValidBuiltInCode( $code ) {
-
                if ( !is_string( $code ) ) {
                        if ( is_object( $code ) ) {
                                $addmsg = " of class " . get_class( $code );
@@ -827,7 +826,7 @@ class Language {
         * @return array Language code => language name
         */
        private static function fetchLanguageNamesUncached( $inLanguage = null, $include = 'mw' ) {
-               global $wgExtraLanguageNames;
+               global $wgExtraLanguageNames, $wgUsePigLatinVariant;
 
                // If passed an invalid language code to use, fallback to en
                if ( $inLanguage !== null && !Language::isValidCode( $inLanguage ) ) {
@@ -842,6 +841,11 @@ class Language {
                }
 
                $mwNames = $wgExtraLanguageNames + MediaWiki\Languages\Data\Names::$names;
+               if ( $wgUsePigLatinVariant ) {
+                       // Pig Latin (for variant development)
+                       $mwNames['en-x-piglatin'] = 'Igpay Atinlay';
+               }
+
                foreach ( $mwNames as $mwCode => $mwName ) {
                        # - Prefer own MediaWiki native name when not using the hook
                        # - For other names just add if not added through the hook