Page MenuHomePhabricator

Shared repo APIs should include 'repo-sharedupload' and 'repo-name' messages
Closed, ResolvedPublic

Description


Version: unspecified
Severity: enhancement

Details

Reference
bz14981

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:12 PM
bzimport set Reference to bz14981.

I do not know if this is technically possible, but it would be great if the API could include two messages for internationalisation, that could be specified by each repository. I'm thinking specifically about a message like 'repo-name', which could contain the name of the repo, and a message like 'repo-sharedupload', to take the place of the normal 'sharedupload' (assuming bug 14980 is fixed) when it exists. This message could look something like the one used on a lot of Wikimedia projects to link to Wikimedia Commons, see e.g. [1]. (Eventually the message names could be something like '%reponame%-name' and '%reponame%-sharedupload' instead, which would make it possible to translate individual repositories' messages at Betawiki.)

I believe this would require changes to api.php and ImagePage.php, but I am not sure if it is possible to include messages this way in the API at all, so that makes it a bit difficult.

[1] http://no.wikipedia.org/wiki/MediaWiki:Sharedupload

Could you explain what you mean more clearly? I particularly don't understand what you mean by including messages in the API.

Exactly; I have no idea if it is possible to include (or define) messages in the API this way.

Ok, I'll give you a scenario.

We have three huge media repositories which are used for a lot of different wikis. One of those is Commons. So it would be great to have one message (localisable) for Commons, named 'repo-name' or soemthing, that contains the name "Wikimedia Commons"; this could then be used on all the small wikis that use images from Commons, by writing e.g. "We use files from {{int:repo-name}}" (particularly in other interface messages).

As for the 'repo-sharedupload' message, it could take the place of the normal 'sharedupload', and could be a lot more specific than the generic sharedupload message. See the generic one at [1] and a customized one at [2]. The one in [2] could be one definied per-repo in my idea.

[1] http://ff.wikipedia.org/wiki/Image:Flag_of_Nauru.svg?uselang=en
[2] http://no.wikipedia.org/wiki/Bilde:Flag_of_Nauru.svg

OK, so what does this have to do with the API? You can get a message's contents through the API (see below), so as long as you add such a message *somewhere*, it should show up there.

http://en.wikipedia.org/w/api.php?action=query&meta=allmessages&ammessages=sharedupload|monday&amlang=nl

Bryan.TongMinh wrote:

Something related to ForeignApiRepo. Component API => File/Repo