Page MenuHomePhabricator

Namespaces for Wikidata are not conveniently translatable
Open, Needs TriagePublic

Description

There are several special namespaces in Wikidata, and none of them is conveniently translatable. What's worse, each of them is hard to translate for different reasons.

Item and Property

In English, the namespace tab in the main space is shown as "Item". That's because nstab-main was manually set to "Item" in the MediaWiki space.

This isn't good. In most other languages, the tab is called "Page", the default translation of nstab-main. In a few languages, it was translated by administrators, but it's not the right way to do it.

All the same is true for the Property space.

Both namespaces and their associated talk spaces can be translated in repo/Wikibase.i18n.namespaces.php. They are translated there to Hebrew, for example, and the names could be used as tab titles, but they aren't.

Perhaps it would be better to make it translatable in translatewiki, because translating this file requires using Git, which most translators are not going to do. But at least using the file would be better than translating in the MediaWiki on Wikidata.org.

EntitySchema

This extension doesn't even have an .i18n.namespaces file. The tab title is translated to some languages locally, but it's bad.

The names for the EntitySchema and EntitySchema talk spaces appear to be defined in extension.json, only in English. Adding a EntitySchema.i18n.namespaces.php file, and actually using the translations there or making nstab-entityschema and nstab-entityschema_talk would be great.

Lexeme

The Lexeme namespace name appears to be hard-coded in src/WikibaseLexemeHooks.php, and not easily translatable in a PHP file or in translatewiki. The tab title is translated to some languages locally, but it's bad.

A solution similar to what is suggested for EntitySchema would be good.

Event Timeline

Change 813581 had a related patch set uploaded (by Amire80; author: Amire80):

[mediawiki/extensions/EntitySchema@master] Add translatable nstab-* messages

https://gerrit.wikimedia.org/r/813581

Change 813624 had a related patch set uploaded (by Amire80; author: Amire80):

[mediawiki/extensions/WikibaseLexeme@master] Make Lexeme namespace page tab easily translatable

https://gerrit.wikimedia.org/r/813624

Probably duplicate.

Feel free to abandon my patches if you have a better idea.

Not at all, I’m mainly surprised because the patches here look quite different than what I vaguely remembered from the other task. But if they work, that’s good ^^

Rereading the task description here, I think this part is essentially a restatement of T260073?

Both namespaces and their associated talk spaces can be translated in repo/Wikibase.i18n.namespaces.php. They are translated there to Hebrew, for example, and the names could be used as tab titles, but they aren't.

I think another thing that I missed in my earlier comment is that your patches don’t actually touch Wikibase / the Item and Property namespaces, right? You’re only fixing Lexeme and EntitySchema, and Item and Property would still be left to do.

Change 813581 merged by jenkins-bot:

[mediawiki/extensions/EntitySchema@master] Add translatable nstab-* messages

https://gerrit.wikimedia.org/r/813581

Change 813624 merged by jenkins-bot:

[mediawiki/extensions/WikibaseLexeme@master] Make Lexeme namespace page tab easily translatable

https://gerrit.wikimedia.org/r/813624

Change 841152 had a related patch set uploaded (by Winston Sung; author: Winston Sung):

[mediawiki/extensions/Wikibase@master] Adding i18n for the Wikibase Repository Item, Property, Query tabs

https://gerrit.wikimedia.org/r/841152

Change 841152 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Adding i18n for the Wikibase Repository Item, Property, Query tabs

https://gerrit.wikimedia.org/r/841152

Change 841152 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Adding i18n for the Wikibase Repository Item, Property, Query tabs

https://gerrit.wikimedia.org/r/841152

This can be tested on Beta now; it changes the display and title text of the Item:, Property: and Query: namespace tabs in the user interface, nothing else. It doesn’t introduce translated namespace names that could be used in [[wikilinks]]; it also doesn’t change the namespace tab of the main namespace if there is no separate Item: namespace, i.e. items on Wikidata will still use “Page” in most languages. So some progress on this task has been made, but it remains open, I’d say.

Only item namespace tab cannot be directly translated from translatewiki.net to Wikidata now.

Should we find a way to make nstab-main able to get the nstab-* messages?