Added autonyms directly to langdb.yaml

* Can add languages not in MW
* Can get rid of foo / bar names which include different scripts
* Can get rid of directionality marks
* PHP scripts to generate the jquery.uls.data.js is now independent of
  mediawiki and moved the scripts to lib/jquery.uls/data
* No pretty printing for the jquery.uls.data.js and added a 'do not edit' comment.
* Related changes in RL module definition and example html

Change-Id: I9a360dbdec4e9312aa5c76f801424ff95a8550d6
This commit is contained in:
Niklas Laxström
2012-08-12 19:28:23 +00:00
committed by Gerrit Code Review
parent 7414184593
commit 23763bd247
10 changed files with 579 additions and 1460 deletions

View File

@@ -0,0 +1,34 @@
<?php
/**
* Script to create the language data in JSON format for ULS.
*
* Copyright (C) 2012 Alolita Sharma, Amir Aharoni, Arun Ganesh, Brandon Harris,
* Niklas Laxström, Pau Giner, Santhosh Thottingal, Siebrand Mazeland and other
* contributors. See CREDITS for a list.
*
* UniversalLanguageSelector is dual licensed GPLv2 or later and MIT. You don't
* have to do anything special to choose one license or the other and you don't
* have to notify anyone which license you are using. You are free to use
* UniversalLanguageSelector in commercial projects as long as the copyright
* header is left intact. See files GPL-LICENSE and MIT-LICENSE for details.
*
* @file
* @ingroup Extensions
* @licence GNU General Public Licence 2.0 or later
* @licence MIT License
*/
include __DIR__ . '/spyc.php';
$data = file_get_contents( 'langdb.yaml' );
$parsed = spyc_load( $data );
$json = json_encode( $parsed );
$js = <<<JAVASCRIPT
// Please do not edit. This file is generated from data/langdb.yaml by ulsdata2json.php
( function ( $ ) {
$.uls = $.uls || {};
$.uls.data = $json;
} )( jQuery );
JAVASCRIPT;
file_put_contents( '../src/jquery.uls.data.js', $js );