As a user primarily speaking a non-English language, I want to see translated names for the standard Wikibase namespaces (Item, Property).
Problem:
Wikibase has translated namespace names in repo/Wikibase.i18n.namespaces.php, but as far as I can tell, they are not used. Even if you set your wiki’s content language to a non-English language, you still get English names for the Item and Property namespaces.
This seems to be because Wikibase registers its namespaces through $wgExtraNamespaces (either in repo/config/Wikibase.example.php or in LocalSettings.php), whereas most extensions register them through the extension JSON file. In Language::getNamespaces(), the namespace names are combined like this:
$this->namespaceNames = $wgExtraNamespaces + $this->localisationCache->getItem( $this->mCode, 'namespaceNames' ); $this->namespaceNames += $validNamespaces;
Because the + operator for arrays doesn’t overwrite existing elements, this means that namespace names from $wgExtraNamespaces are never overwritten by names from the localisation cache.
Example:
Screenshots/mockups:
action=query&meta=siteinfo&siprop=namespaces on a local wiki with $wgLanguageCode = "es":
Note that the namespaces Category (from core) and Module (from Scribunto) are translated, but Item is not, even though a translation for it is available («Elemento»).
LTR namespace name in an otherwise RTL interface:
BDD
GIVEN
AND
WHEN
AND
THEN
AND
Acceptance criteria:
- Namespace names are translated depending on content or user interface language.
- Compare: https://www.wikidata.org/wiki/Module:Wikidata?uselang=he with Hebrew namespace name, and https://www.wikidata.org/wiki/Property:P2302?uselang=he with English namespace name.
Open questions:
- https://www.wikidata.org/wiki/Q2013?uselang=en shows “Item” as the name for the main namespace, but https://www.wikidata.org/wiki/Q2013?uselang=he shows “דף תוכן”, which apparently means “content page”, and is not the same as “פריט”, the 'he' translation in repo/Wikibase.i18n.namespaces.php. It’s unclear if this is the same issue or actually a different one.


