Extension:LocalisationUpdate/LUv2

LUv2: A generic, efficient localisation update service

 * Public URL: https://www.mediawiki.org/wiki/Extension:LocalisationUpdate/LUv2
 * Bugzilla report:
 * Announcement:

Identity and Contact

 * Name: Konarak Ratnakar
 * Email: konarak.11 at google dot com
 * Typical working hours: 0930 to 2130 UTC
 * IRC: kondi
 * Location: Ahmedabad, India

Project Outline
Wikimedia wikis use the LocalisationUpdate extension to get the updated localised messages from translatewiki.net. To accomplish this, the extension downloads the translation files for mediawiki and installed extensions, stores them to local cache and then processes them to check which messages that can be updated.

The described flow is not very efficient since not all the wikis require support for ~300 languages and the extension downloads complete files instead of only downloading the deltas. This process consumes quite some time. Plus the extension requires setting up cron jobs and other manual configuration which can be avoided.

LUv2 aims to fix this with creation of a new service which will keep track of the updates and make them accessible via a push interface and a RESTful api.


 * Possible mentors: Kartik Mistry, Niklas Laxström

Deliverables
The main component of the project is the LUv2 service.

Service
The service comprises an database update mechanism and an api. The service will store the latest version of the translation messages and make them available to clients via the api. The service will be written in node.js and it'll use redis as database.

API
There will be two api endpoints. One with which the clients will communicate in order to fetch the updates and the second endpoint will be used to trigger the database update. The first endpoint will require the clients to provide the project_id, language_id, message_id->message pairs. It'll find out the messages that client needs to update and respond with the message_id->message pairs.

Database Update
To automate database updates the post-receive hook on the projects' remote repo will be configured to hit an api endpoint. This will trigger the database update process. The update script will download the modified/new files to a temporary directory, parse and compare them with the old files, and insert/update the messages in the database. This script will ideally support all the formats that are currently supported by the translate extension.

In case one server goes down the clients should have a secondary source that they can query. Having a read only replica would solve this.

The database will primarily store the following data:


 * last modified timestamp
 * project identifier
 * message identifier
 * language code of the message
 * message string

This service will ideally work with all the projects that are hosted on translatewiki.net. The service will primarily be beneficial to web applications. Using this service these applications will be able to serve the latest translation messages instead of depending on software updates.

Extension
The Localisation Update extension will be rewritten to fetch the updates from the new service.

Future
I plan on maintaining the service and the extension after the gsoc period ends. I'd work with other projects willing to use this service. The proposal doesn't address the requirement to set up cron jobs. Eliminating this requirement will be beneficial to other mediawiki users since not all shared hosting providers let users set up cron jobs. Push based solution will be best suited for this which will have to be heavily scrutinized in terms of security.

About you
I'm based out of Ahmedabad and currently I'm pursuing a diploma in engineering in information technology. I've been involved in various wikimedia activities since early 2012, mostly outreach. I've contributed to English and Gujarati wikipedias, Wikidata and Commons.

Read somewhere on the internet.
 * How did you hear about this program?

I'll have exams in late May. Apart from that I'll be mostly working on the project itself, if selected.
 * Will you have any other time commitments, such as school work, another job, planned vacation, etc., during the duration of the program?

Participation
I keep a log of `in progress` or `done` tasks, I plan on doing the same for this project. I'll publish these updates on mediawiki.org.
 * Progress tracking

I'll regularly publish the source code on a public git repository, either on gerrit or git.
 * Source code

I'm almost always online on IRC, particularly active on #wikipedia-en and #mediawiki-i18n. Emailing me would be the second best way to get a quick response.
 * Communication

Past experience
I've mostly been a consumer of open source software to this day and I wish to contribute code now, hopefully starting with this project. I've recently fixed a parsoid bug and gotten myself familiar with mediawiki's development process.
 * Please describe your experience with any other FOSS projects as a user and as a contributor:

Other than this project, I'm very much interested in the mediawiki api and wikidata.
 * What project(s) are you interested in (these can be in the same or different organizations)?