'defaultUserOptionOverrides', 'linkTrail', 'namespaceAliases',
'dateFormats', 'datePreferences', 'datePreferenceMigrationMap',
'defaultDateFormat', 'extraUserToggles', 'specialPageAliases',
- 'imageFiles'
+ 'imageFiles', 'genderAliases'
);
static public $mMergeableMapKeys = array( 'messages', 'namespaceNames', 'mathNames',
return isset( $ns[$index] ) ? $ns[$index] : false;
}
+ /**
+ * Like getNsText, but looks first if there is custom alias for given gender
+ */
+ function getGenderNsText( $index, $gender ) {
+ $this->load();
+ if ( isset( $this->genderAliases[$index][$gender] ) ) {
+ return $this->genderAliases[$index][$gender];
+ } else {
+ return $this->getNsText( $index );
+ }
+ }
+
/**
* A convenience function that returns the same thing as
* getNsText() except with '_' changed to ' ', useful for
*
* @return array Dependencies, map of filenames to mtimes
*/
- static function loadLocalisation( $code, $disableCache = false ) {
+ static function loadLocalisation( $code, $disableCache = true ) {
static $recursionGuard = array();
global $wgMemc, $wgEnableSerializedMessages, $wgCheckSerialized;
foreach ( $this->namespaceNames as $index => $name ) {
$this->mNamespaceIds[$this->lc($name)] = $index;
}
+ # Add gender aliases to the normal aliases table automatically
+ foreach ( $this->genderAliases as $index => $aliases ) {
+ foreach ( $aliases as $alias ) {
+ $this->namespaceAliases[$alias] = $index;
+ }
+ }
if ( $this->namespaceAliases ) {
foreach ( $this->namespaceAliases as $name => $index ) {
if ( $index === NS_PROJECT_TALK ) {