Create API to fetch MediaWiki's language fallback tree structure
Closed, ResolvedPublic

Description

add listing of fallback language to SiteInfo/General

I think it would be nice to know which language is the fallback language ($fallback in Message.php).
This information can be used e.g. by bots to know which language should by used on edit summary when there is no translation for the primary language.
I think it should by added to the gernal information part of Siteinfo.

I've created a patch which lists all fallback language as an array by requesting action=query&meta=siteinfo&siprop=general.


Version: unspecified
Severity: enhancement

Attached: fallbackLangCode.patch

bzimport added a project: MediaWiki-API.Via ConduitNov 21 2014, 10:34 PM
bzimport set Reference to bz18634.
Merl created this task.Via LegacyApr 30 2009, 2:30 PM
Catrope added a comment.Via ConduitApr 30 2009, 2:56 PM

(In reply to comment #0)

Created an attachment (id=6075) [details]
add listing of fallback language to SiteInfo/General

I think it would be nice to know which language is the fallback language
($fallback in Message.php).
This information can be used e.g. by bots to know which language should by used
on edit summary when there is no translation for the primary language.

If this is about MediaWiki messages, you can do this by just using list=allmessages&amlang=whatever&ammessage=messagename , and the fallback chain will automatically be honored.

I think it should by added to the gernal information part of Siteinfo.

I don't think so, because this way you'd only get information about the language that happens to be the site language. There should be a way to get it for all languages. I'm not sure what the right place to add this would be, I'll have to think about that.

Nikerabbit added a comment.Via ConduitApr 30 2009, 7:51 PM

(In reply to comment #1)

I don't think so, because this way you'd only get information about the
language that happens to be the site language. There should be a way to get it
for all languages. I'm not sure what the right place to add this would be, I'll
have to think about that.

The fallbacks are cached individually in memcached. In the future we may support custom fallback languages per user.

Merl added a comment.Via ConduitApr 30 2009, 8:04 PM

(In reply to comment #2)

The fallbacks are cached individually in memcached. In the future we may
support custom fallback languages per user.

My intention was more to get the site fallbacks and not user specific fallbacks because as mentioned above i would like to have the information for choosing the language for edit summary (e.g. my bot has no "als" template but its better to use "de" instead of the "en" one) and not for displaying customized messages to me. If the individual lang is "zh" this would end up in bad summary results on "als" projects.

Reedy added a comment.Via ConduitMay 10 2010, 10:45 PM

Roan, Can this patch be used, or is it scrap?

Krinkle added a comment.Via ConduitAug 5 2011, 6:51 AM

So the request is to expose the fallback tree MediaWiki has through an API so that bots can use the same tree for their systems.

Changing summary accordingly.

Nikerabbit added a comment.Via ConduitAug 5 2011, 9:27 AM

This bug is closely related to bug 30216.

Reedy added a comment.Via ConduitAug 5 2011, 1:34 PM

The patch seems to work fine for the moment

Applied in r93968

Add Comment