Merge "vector/screen.css: Remove some unnecessary rules"
[lhc/web/wiklou.git] / languages / Language.php
index 355a834..86639a3 100644 (file)
@@ -686,7 +686,18 @@ class Language {
                                }
                        }
 
-                       $this->namespaceAliases = $aliases;
+                       # Also add converted namespace names as aliases, to avoid confusion.
+                       $convertedNames = array();
+                       foreach ( $this->getVariants() as $variant ) {
+                               if ( $variant === $this->mCode ) {
+                                       continue;
+                               }
+                               foreach ( $this->getNamespaces() as $ns => $_ ) {
+                                       $convertedNames[$this->getConverter()->convertNamespace( $ns, $variant )] = $ns;
+                               }
+                       }
+
+                       $this->namespaceAliases = $aliases + $convertedNames;
                }
                return $this->namespaceAliases;
        }
@@ -3624,7 +3635,7 @@ class Language {
                foreach ( $forms as $index => $form ) {
                        if ( preg_match( '/^\d+=/i', $form ) ) {
                                $pos = strpos( $form, '=' );
-                               if ( substr( $form, 0, $pos ) === (string) $count ) {
+                               if ( substr( $form, 0, $pos ) === (string)$count ) {
                                        return substr( $form, $pos + 1 );
                                }
                                unset( $forms[$index] );