Content translation/Specification

Prototype
The prototype which acts as design reference too is present at http://pauginer.github.io/prototype-translate/content-translation.html

Architecture
See architecture documentation

Widgets
The CX UI consists of 4 component widgets - The header, source article widget, translation widget, translation tools widget.

Communication between Widgets
We separate the responsibilities and follow an event driven approach. Imagine it as a global single event dispatcher. widgets subscribe to events, widgets publish events(fire), widgets can attach and detach from the event registers Suppose you click on a word in source article. We wont call any methods of other widgets. we will pretend that the source article widget does not know about other widgets. On click of a word, the widget will raise/publish an event say mw.ex.source.word.select. Now, multiple consumers can subscribe to this event. One would be the translation column. Other will be the tools widget-inside tools we are going to have a lot of translation helpers

For event subscribe/publish pattern, we use mw.hook, which is a wrapper on top of $.Callbacks.

UI styling
LESS is used for the extension.

Naming conventions

 * ContentTranslaiton is abbreviated everywhere as cx.
 * All CSS class names should have a prefix cx
 * All RL modules have a prefix ext.cx
 * The jquery object namespace is mw.cx
 * CSS classes follow BEM naming conventions
 * Follows MW coding, naming conventions

Loading the source page
As of now, the entry point is by passing a page title using 'page' URL parameter to the Special:ContentTranslation page

Example : http://localhost/wiki/Special:ContentTranslation?page=MyTesTPage

Testing
GWT test cases are prepared in parallel with the development, Browser tests also get developed along with feature development.

Bug reports
Please report bugs to [//phabricator.wikimedia.org/maniphest/task/create/?projects=MediaWiki-extensions-ContentTranslation Phabricator using the "MediaWiki-extensions-ContentTranslation" project]. Don't worry about specifying version, severity, hardware, or OS if you don't know.