Last modified: 2011-08-05 13:34:58 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T20634, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 18634 - Create API to fetch MediaWiki's language fallback tree structure
Create API to fetch MediaWiki's language fallback tree structure
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Roan Kattouw
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-30 14:30 UTC by merl
Modified: 2011-08-05 13:34 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
add listing of fallback language to SiteInfo/General (1.03 KB, patch)
2009-04-30 14:30 UTC, merl
Details

Description merl 2009-04-30 14:30:07 UTC
Created attachment 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.
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.
Comment 1 Roan Kattouw 2009-04-30 14:56:37 UTC
(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.
Comment 2 Niklas Laxström 2009-04-30 19:51:12 UTC
(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.

Comment 3 merl 2009-04-30 20:04:52 UTC
(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.
Comment 4 Sam Reed (reedy) 2010-05-10 22:45:13 UTC
Roan, Can this patch be used, or is it scrap?
Comment 5 Krinkle 2011-08-05 06:51:40 UTC
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.
Comment 6 Niklas Laxström 2011-08-05 09:27:39 UTC
This bug is closely related to bug 30216.
Comment 7 Sam Reed (reedy) 2011-08-05 13:34:58 UTC
The patch seems to work fine for the moment

Applied in r93968

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links