Localisation updates for core messages from Betawiki (2008-01-30 23:02 CET)
[lhc/web/wiklou.git] / languages / Language.php
index 6caee42..d9aa5f5 100644 (file)
@@ -171,6 +171,7 @@ class Language {
         * @return array
         */
        function getDefaultUserOptions() {
+               trigger_error( 'Use of ' . __METHOD__ . ' is deprecated', E_USER_NOTICE );
                return User::getDefaultOptions();
        }
 
@@ -1772,8 +1773,8 @@ class Language {
         */
        function convertGrammar( $word, $case ) {
                global $wgGrammarForms;
-               if ( isset($wgGrammarForms['en'][$case][$word]) ) {
-                       return $wgGrammarForms['en'][$case][$word];
+               if ( isset($wgGrammarForms[$this->getCode()][$case][$word]) ) {
+                       return $wgGrammarForms[$this->getCode()][$case][$word];
                }
                return $word;
        }
@@ -2134,6 +2135,13 @@ class Language {
 
                # Replace spaces with underscores in namespace names
                $cache['namespaceNames'] = str_replace( ' ', '_', $cache['namespaceNames'] );
+
+               # And do the same for specialpage aliases. $page is an array.
+               foreach ( $cache['specialPageAliases'] as &$page ) {
+                       $page = str_replace( ' ', '_', $page );
+               }
+               # Decouple the reference to prevent accidental damage
+               unset($page);
                
                # Save to both caches
                self::$mLocalisationCache[$code] = $cache;