Make the code for grammar data processing common
authorAmir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Mon, 28 Sep 2015 10:26:08 +0000 (13:26 +0300)
committerAmire80 <amir.aharoni@mail.huji.ac.il>
Fri, 16 Dec 2016 13:52:14 +0000 (15:52 +0200)
commit6b03e2e88ec09b9886c1bf0b177de80b65dc5af5
tree42d40a5d0c50bcc3228a60d6034a2405419c5717
parent9ac29c74edda2f457814a1ed634a19f9a44fd0a5
Make the code for grammar data processing common

This makes the code for processing JSON files with
grammar transformations reusable by different languages
and applies the same logic to Russian and Hebrew.
It will be done to other languages in further patches.

This patch is not supposed to change any functionality,
and the tests are intact (except a comment in the test
for Hebrew - the class doesn't exist any longer).

PHP:
* Move the JSON grammar transformation data processing logic
  from LanguageRu.php to convertGrammar() in Language.php.
  By default all these data files are supposed to be
  processed identically, so the code should be common.
  If there is no JSON data file, nothing new happens.
* LanguageRu's own convertGrammar() method is removed.
* The LanguageHe class is removed, now that all its functionality
  is handled by generic JSON data processing in the Language class.
  LanguageHe.php file is removed from the repo and from autoloading.

JavaScript:
* Move the JSON grammar transformation data processing logic
  from ru.js to mediawiki.language.js.
* JavaScript grammar code files he.js and ru.js are removed
  from the repo and from Resources.php, because all the data
  is in JSON, and the default logic in mediawiki.language.js
  works for both languages.

Bug: T115217
Change-Id: I5e75467121c3d791bb84f9e6fdfcf07c1840f81a
autoload.php
languages/Language.php
languages/classes/LanguageHe.php [deleted file]
languages/classes/LanguageRu.php
languages/data/grammarTransformations/he.json [new file with mode: 0644]
resources/Resources.php
resources/src/mediawiki.language/languages/he.js [deleted file]
resources/src/mediawiki.language/languages/ru.js [deleted file]
resources/src/mediawiki.language/mediawiki.language.js
tests/phpunit/languages/classes/LanguageHeTest.php