Page MenuHomePhabricator

Bot for update localized files on Commons
Open, HighPublic


ProveIt uses localizations stored as JSON files at Commons (example). These localizations are updated and expanded at TranslateWiki, but once the translations are pushed to the repo, the files at Commons need to be MANUALLY updated.

Currently translations at Commons are far behind the ones at the repo or TranslateWiki. Maybe we should set up a bot for automatically updating the translations.

Event Timeline

Iniquity created this task.Jan 18 2019, 7:47 PM
Sophivorus added subscribers: Aklapper, Sophivorus.EditedJan 20 2019, 1:23 PM

If only we could get the code directly from the repo, using Commons wouldn't be necessary and this task/bot wouldn't be necessary either. But it seems like getting the raw file from Gitiles is an old missing feature (see this issue). The closest we can get is this.

However, we CAN get the code directly from the GitHub mirror. The problem is that GitHub is a third party, so using it would go against standard Wikimedia policies. But maybe this kind of usage is reasonable and may be an exception? What do you think? What does @Aklapper or @Krinkle think?

Setting up a bot would be a solution but I'm not sure if there are any similar bots in place (that update a wiki based on changes to a repo) so it may need coding from zero, going through review and deploy procedures, all very complicated. Still may be worth it, specially because of future potential, but I would exhaust all other options first.

Sophivorus updated the task description. (Show Details)Jan 20 2019, 1:26 PM

I think that the way to go is T121470 and I do not know which exact "standard Wikimedia policies" you have in mind (links welcome).

Sophivorus added a comment.EditedJan 20 2019, 2:57 PM

Hm, I searched a bit but couldn't find any docs. I think it was in the Jerusalem Hackathon that I heard that we shouldn't be using external code on Wikimedia projects, basically to protect user privacy and data.

So are you saying that loading code directly from the GitHub mirror would be acceptable, @Aklapper? Because that would make me very happy, at least until the Central Global Repository is available.

Though now that I think about it, mw.loader.load cannot load JSON files, or even files external to Wikimedia wikis... *sigh*

I am not a lawyer; I just asked where your assumption comes from. :) Could you avoid Github by having your bot do cat | base64 -d and drop the output into ?

Thanks for that idea Aklapper! For future reference, I leave here the tested equivalents of your command:

wget -O ru.txt
base64 -D ru.txt -o ru.json
rm ru.txt

@Iniquity, I will probably request a quick grant for this bot and the many other ProveIt requests that accumulated. Again, it may take some weeks, but we'll get there.

Sophivorus triaged this task as High priority.Jan 20 2019, 8:24 PM
Iniquity added a comment.EditedJan 21 2019, 10:04 AM

@Iniquity, I will probably request a quick grant for this bot and the many other ProveIt requests that accumulated. Again, it may take some weeks, but we'll get there.

I happy to hear it :) Can you make this bot open (source)? I think it will be useful for future global gadgets.

That goes without saying! I'll make it as generic as possible so that others can re-use it.

Oh, thanks a lot :)