Make grammar data loadable as an RL module and usable in JS
authorAmir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Sat, 26 Sep 2015 20:28:03 +0000 (23:28 +0300)
committerAmire80 <amir.aharoni@mail.huji.ac.il>
Fri, 21 Oct 2016 19:25:16 +0000 (12:25 -0700)
commitdf5a848de8fcc4a5bf4046ec83a8b0f10b6f8a2d
tree69e2b61c9dba2016d0329138b4768fe12fccd674
parentc7eb4d9c835c5cb73fda41ec57e933d0be27c74c
Make grammar data loadable as an RL module and usable in JS

* Load the data of this variable from a JSON file to the same
  data structure that ResourceLoader uses for digitTransformTable,
  pluralRules, etc.
* Change the JSON structure to ensure the order of the rules.
  Otherwise JavaScript processes the keys in a random order.
* Delete the grammar code from JS and replace it with
  the same logic that is used in PHP for processing the data.

For now this is done only for Russian.

The next step will be to make the PHP and JS
data processing logic reusable.

Bug: T115217
Change-Id: I6b9b29b7017f958d62611671be017f97cee73415
includes/resourceloader/ResourceLoaderLanguageDataModule.php
languages/Language.php
languages/classes/LanguageRu.php
languages/classes/data/grammar.ru.json [deleted file]
languages/data/grammarTransformations/ru.json [new file with mode: 0644]
resources/src/mediawiki.language/languages/ru.js