Page MenuHomePhabricator

Provide a way to get localized namespaces names through the API
Open, Needs TriagePublic


E.g. the dropdown at shows German translations for the namespaces. This doesn't appear to be accessible through the Siteinfo API.

I was thinking uselang=de should provide the localized names but I am told it probably makes more sense to introduce a dedicated parameter, maybe sinslang (siteinfo namespace lang), or something similar.

This may be as simple as using the requested language instead of the content language in ApiQuerySiteInfo:

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 19 2019, 4:13 AM

There is a siinlanguagecode parameter, but for namespaces there is no offical german translation, because that would not work in links.

I have no idea how to get it for a namespace dropdown

Anomie moved this task from Unsorted to Needs Code on the MediaWiki-API board.Jul 11 2019, 7:01 PM

meta=siteinfo&siprop=namespaces would not be the right place for this, as that's intended for returning namespace names that actually function on the wiki.

Normally the answer would probably be to use list=allmessages to fetch the relevant i18n messages, but the namespace names are not stored as i18n messages (they're separate i18n data).

It's a bit of a stretch, but probably the new meta=languageinfo would be the best place since in MediaWiki the namespace names are in fact "properties" of the language.