Page MenuHomePhabricator

Expose CapitalLinks config in JS to allow modules to properly handle titles on case-sensitive wikis
Closed, ResolvedPublic

Description

Several scripts have been braking on wiktionary-like wikis since forever, resulting in per-wiki hardcoded hacks.

Although exposing $wgCapitalLinkOverrides and/or $wgCapitalLinks directly is no good, a simple array that matches MWNamespace::isCapital would be nice.

The reason those config variables aren't useful rightaway is due to the logic behind MWNamespace::isCapital (ie. Media->File, $alwaysCapitalizedNamespaces, getSubject(), etc.)

Since this would probably end up in a loop, we can re-use the loop introduced in r90096 for wgNamespaceIds.

This bug is blocking proper integration of the mw.Title constructor, which currently (in UploadWizard) harccodes ucFirst() – not a big deal since it's targetting Wikimedia Commons, but for core it needs to be fixed.

ie. on a wiki with a case-sensitive main-namespace the following is happening that could be breaking many things:

var title = new mw.Title( 'apple' );
title.toString()

"Apple"


Version: 1.20.x
Severity: normal

Details

Reference
bz29441

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 21 2014, 11:37 PM
bzimport set Reference to bz29441.