r97461 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97460‎ | r97461 | r97462 >
Date:10:43, 19 September 2011
Author:nikerabbit
Status:ok (Comments)
Tags:
Comment:
* (bug 27398) Add $wgExtraGenderNamespaces for configured gendered namespaces
Modified paths:
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/Language.php
@@ -428,9 +428,19 @@
429429 * @since 1.18
430430 */
431431 function needsGenderDistinction() {
432 - global $wgExtraGenderNamespaces;
433 - $aliases = $wgExtraGenderNamespaces + self::$dataCache->getItem( $this->mCode, 'namespaceGenderAliases' );
434 - return count( $aliases ) > 0;
 432+ global $wgExtraGenderNamespaces, $wgExtraNamespaces;
 433+ if ( count( $wgExtraGenderNamespaces ) > 0 ) {
 434+ // $wgExtraGenderNamespaces overrides everything
 435+ return true;
 436+ } elseif( isset( $wgExtraNamespaces[NS_USER] ) && isset( $wgExtraNamespaces[NS_USER_TALK] ) ) {
 437+ /// @todo There may be other gender namespace than NS_USER & NS_USER_TALK in the future
 438+ // $wgExtraNamespaces overrides any gender aliases specified in i18n files
 439+ return false;
 440+ } else {
 441+ // Check what is in i18n files
 442+ $alises = self::$dataCache->getItem( $this->mCode, 'namespaceGenderAliases' );
 443+ return count( $aliases ) > 0;
 444+ }
435445 }
436446
437447 /**

Sign-offs

UserFlagDate
Leinadtested10:57, 19 September 2011

Follow-up revisions

RevisionCommit summaryAuthorDate
r97469Fix typo from r97461, was breaking unit testsreedy11:31, 19 September 2011
r97481REL1_18 MFT r97460, r97461, r97469, r97470, r97475reedy12:58, 19 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97296* (bug 27398) Add $wgExtraGenderNamespaces for configured gendered namespacesnikerabbit16:11, 16 September 2011

Comments

#Comment by Nikerabbit (talk | contribs)   10:46, 19 September 2011

Oops, the commit message is wrong. Here is the correct one:

Changed the behaviour of $wgExtraNamespaces. Now if $wgExtraNamespaces[NS_USER] and NS_USER_TALK is set, the namespace aliases defined in the i18n file are ignored.


Otherwise for wikis who had set custom user namespace would suddenly get non-customised namespace aliases. $wgExtraGenderNamespaces still overrides everything.

Related to bug 30938

Status & tagging log