From: Niklas Laxström Date: Fri, 16 Sep 2011 16:11:54 +0000 (+0000) Subject: * (bug 27398) Add $wgExtraGenderNamespaces for configured gendered namespaces X-Git-Tag: 1.31.0-rc.0~27614 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=7b842140ae91b0558c3d52a6b60762dfdcc5f191;p=lhc%2Fweb%2Fwiklou.git * (bug 27398) Add $wgExtraGenderNamespaces for configured gendered namespaces --- diff --git a/RELEASE-NOTES-1.18 b/RELEASE-NOTES-1.18 index 110d1e6bee..e95f3c8531 100644 --- a/RELEASE-NOTES-1.18 +++ b/RELEASE-NOTES-1.18 @@ -626,6 +626,7 @@ changes to languages because of Bugzilla reports. (Devanagari) (ks-deva). Defaults to ks-arab. * (bug 30864) Use bengali numerals for
    for Assamese * (bug 30817) Restored linktrail for kk (Kazakh) +* (bug 27398) Add $wgExtraGenderNamespaces for configured gendered namespaces === Other changes in 1.18 === * Removed legacy wgAjaxWatch javascript global object, no longer in use. diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 80c85bcbf8..4e30d277ad 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -2630,6 +2630,11 @@ $wgMetaNamespaceTalk = false; # ); $wgExtraNamespaces = array(); +/** + * Same as above, but for namespaces with gender distinction. + */ +$wgExtraGenderNamespaces = array(); + /** * Namespace aliases * These are alternate names for the primary localised namespace names, which diff --git a/languages/Language.php b/languages/Language.php index 8723a97a6e..a1eba5005a 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -409,7 +409,9 @@ class Language { * @since 1.18 */ function getGenderNsText( $index, $gender ) { - $ns = self::$dataCache->getItem( $this->mCode, 'namespaceGenderAliases' ); + global $wgExtraGenderNamespaces; + + $ns = $wgExtraGenderNamespaces + self::$dataCache->getItem( $this->mCode, 'namespaceGenderAliases' ); return isset( $ns[$index][$gender] ) ? $ns[$index][$gender] : $this->getNsText( $index ); } @@ -420,7 +422,8 @@ class Language { * @since 1.18 */ function needsGenderDistinction() { - $aliases = self::$dataCache->getItem( $this->mCode, 'namespaceGenderAliases' ); + global $wgExtraGenderNamespaces; + $aliases = $wgExtraGenderNamespaces + self::$dataCache->getItem( $this->mCode, 'namespaceGenderAliases' ); return count( $aliases ) > 0; } @@ -456,7 +459,8 @@ class Language { } } - $genders = self::$dataCache->getItem( $this->mCode, 'namespaceGenderAliases' ); + global $wgExtraGenderNamespaces; + $genders = $wgExtraGenderNamespaces + self::$dataCache->getItem( $this->mCode, 'namespaceGenderAliases' ); foreach ( $genders as $index => $forms ) { foreach ( $forms as $alias ) { $aliases[$alias] = $index;