Refer the design being drafted at https://docs.google.com/document/d/11fFVBcu190u8J4uVJdyrghuHx5BdWrRHRZvd7fArwE0
Description
Description
Details
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Parallel corpora: Implement storage | mediawiki/extensions/ContentTranslation | master | +441 -31 |
Event Timeline
Comment Actions
Approach:
- On edit events(mw.cx.translation.change), mark the section dirty
- On save event handler( mw.cx.translation.save), collect all the sections that are dirty and post a json form of sectionid-sectiondata collections to API to save
- After save remove the dirty mark from the translation sections.
- While saving a translation section, collect its source section as well. But once source section is saved, mark it saved(some annotation on section markup will do). So that we save source sections only one
- When we restore, the first saves on translation sections will include its source sections as well, since there is a chance that source article changed
- The api should accept(POST) requests with more than one sectionid- section data so that we can send a collection of them to API.
- In this iteration, the above approach will generate a tech debt of draft translation send twice. One for parallel corpora and one for draft translations. This can be addressed with a followup to terminate using cx_drafts table.
- The JSON post data that the API accepts can have the type (source/translation) so that we can send mix of both in single request
- In addition to `mw.cx.translation.save, we also want to send the initial translations to the corpora. For that we can use mw.cx.translation.postMT events
Comment Actions
Change 257283 had a related patch set uploaded (by Santhosh):
Parallel corpora: Implement storage
Comment Actions
In this iteration, the above approach will generate a tech debt of draft translation send twice. One for parallel corpora and one for draft translations. This can be addressed with a followup to terminate using cx_drafts table.
See T124399: Migrate the draft translation restore mechanism to use data from cx_corpora table
Comment Actions
Parallel text at section level are capturing now. See https://www.mediawiki.org/wiki/Content_translation/Published_translations