Commit Graph

27 Commits

Author SHA1 Message Date
Amir E. Aharoni
5a4667c3fd Delete utils.data tests - they were moved to the jQuery component
Change-Id: Iead160c5845a64d4c0106037c2c7cf4d51eadae7
2012-10-10 16:27:20 +05:30
Siebrand Mazeland
e1a4f7f0cb After training the PHPStorm code formatter.
See https://github.com/siebrand/MediaWiki-PHPStorm

Issue remains with anonymous functions in JavaScript.

Change-Id: I2b520f8df127452acf02deb659277a6465e6ca59
2012-09-17 17:10:59 -07:00
Santhosh Thottingal
6e1f652abc Update test cases and remove references to AU region
AU region does not exist, It was merged with PA

Change-Id: Icb0e8ec92b85db3b771d32c8728c02fd09c29a41
2012-09-14 22:17:15 -07:00
Amir E. Aharoni
de3abc3315 (bug 38679) Replacing regions NA, LA, SA with AM
Change-Id: Ib484dd9cb0453ec1bd214e0196119b14d96ac128
2012-09-01 10:09:16 +03:00
Amir E. Aharoni
8974e61984 Fix tests after regions renumbering
Change-Id: I7bcb561508d6410334d1d4e1c4508911820fc537
2012-08-30 21:04:18 +03:00
Amir E. Aharoni
ca411138c7 Adding language presence by territory to langdb
A very simple mechanism for importing per-country language lists
from CLDR to ULS' langdb.

If I understand correctly, we only need languages spoken in a country
ordered by number of speakers. The CLDR data already has it and it should be
mostly useful.

Also added a utility function and a test.

Some tweaks to override the CLDR data are still needed:

* The data as it is omits some useful languages. For example, Amharic is not
  listed in Eritrea.
* Some countries have a very large number of languages. Ideally it's right,
  but is not practical currently, for example India with 75. Maybe
  hand-picking or limiting the choice to top X languages can be useful,
  but requires thought.
* Some language codes are standard, but different from Wikipedia practice,
  for example "pa_Guru" (we just write "pa"). Maybe a mapping of codes
  is needed.

Change-Id: I3c0cd5a9118997ba39a4f3695978e359f3de6956
2012-08-26 10:40:52 +03:00
Amir E. Aharoni
67dd765e13 Add basic information and utils for RTL scripts
Change-Id: Ie01b58cd3627e8f0bf726f0bb296bffb25efcbb5
2012-08-22 18:16:01 +03:00
Amir E. Aharoni
05a878ba9f Added French to NA (Quebec), SA (Guiana) and WW
Also updated tests accordingly.
Patch originally proposed by Aude.

Change-Id: Id83f6fb80d394e6fac4d7486ba2feae9e9c5bd99
2012-08-15 09:37:16 +03:00
Santhosh Thottingal
8f7382b242 Introduce languages options to ULS
Default value of this option will be $.uls.data.autonyms().
It can be set to limit language selection to a set of languages.

Updated examples, used a config variable wgULSLanguages to set this.

Change-Id: Ia322cbdcdb14f08619d2e4df5b23e2702841d147
2012-08-15 08:52:46 +03:00
Amir E. Aharoni
3d2e85664f Partly reverting the langdb
Multiple scripts and autonyms are not currently supported by ULS utils.
I commented out the problematic lines and left the current de-facto
situation in Wikipedia.
This is a TODO item, but it needs proper specification.

Also updated the tests somewhat.

Change-Id: I8cdc6ae430f5bb5af4b1890abf6e71a91b6beb3d
2012-08-14 16:46:11 +03:00
Amir E. Aharoni
7382813788 Add a test for checking that all languages have autonyms
DRAFT
Some languages don't yet have autonyms, but probably all languages should
have them. It currently fails, because there are many such languages and
I am not aware of a nice way to skip it in QUnit (there is a proper skipping
mechanism in Perl testing, for example).

Also change orphanScripts() to return all scripts without groups.

Change-Id: I21c13d7bba89f3b991bc340e6ff6e040c704beb8
2012-08-09 16:04:02 +03:00
Amir E. Aharoni
3a6e45e364 Add a test for autonym sorting
Change-Id: Ib323ad3ac88bf69487eefb340cfc0fb687a35f70
2012-08-08 16:17:44 +03:00
Santhosh Thottingal
af3f6ac58d Loop optimization and cleanup
Reduced the complexity of search loops
And some cleanup.

Change-Id: I772b02abd14d50ad1965e933d8dbb6d3eb4e0b1d
2012-07-25 16:14:16 +03:00
Amir E. Aharoni
7f3b3b1210 Save source files as UTF-8
Non-ASCII characters broke the functionality.
Saving as UTF-8 fixes this.

Also removed an unneded <?php statement from a JS file and replaced
non-ASCII pretty apostrophes with straight ASCCI.

Change-Id: Ic6719fe0863bc5d8ae19abbf01cfbb7b2b714f12
2012-07-18 15:29:17 +03:00
Siebrand Mazeland
6cc7c75458 Merge "Implement dual license GPLv2 and MIT." 2012-07-18 05:35:30 +00:00
Amir E. Aharoni
2775e6f5b3 Update tests and sync DBs after reordering regions
Followup I6fcf34dd

Change-Id: I2369f97ec978892a8db9fa15c17885de9cc841ec
2012-07-15 15:35:46 +00:00
Siebrand Mazeland
4041e7dca1 Implement dual license GPLv2 and MIT.
Should only be merged after +1 by all current contributors that are added as
reviewers.

Change-Id: Ie0480019524fa7b45ec6635d92b63e8b7880a2a0
2012-07-13 15:16:06 -04:00
Amir E. Aharoni
704a54647b Fixed a test that checks Greek script languages
Tests about the Greek script failed because new languages were added to
the language database. Also, it had to be deepEqual and not strictEqual.
I fixed the tests.

Change-Id: I68cf0593354d71bd35c53bac5afe7cabd25182a1
2012-07-10 09:55:26 -04:00
Siebrand Mazeland
fcbcf1a2a9 Merge "Updates for language database (~75 codes added)." 2012-07-03 15:00:15 +00:00
Amir E. Aharoni
31e483a19e Sort languages by script in the initial view
* Added new utility functions to return all languages by script group.
* Used that function to sort languages initially.
* Added tests.

Change-Id: I405cb73e6af13f59c307da5a7f2269049ecba698
2012-07-03 17:26:03 +03:00
Siebrand Mazeland
78ccbc57e6 Updates for language database (~75 codes added).
* Added codes used on translatewiki.net.
* Uncommented and updated a few codes.
* Put a few comments on a separate line, because when trailing, the conversion script b0rks.
* Updated the script groups with new scripts.
* Corrected the tests.

Change-Id: Ia53195834c2afc908d57d2f396bc317fadb2c7a9
2012-07-03 17:02:25 +03:00
Amir E. Aharoni
607abaa201 Sorting languages by script.
* Clarified naming: separated regions from region groups.
* New utility functions for sorting and grouping languages.
* JSHint fixes.
* Added tests.

Change-Id: I8153a2b89fbc7b9a7d6b7deeb87208efc9f4d021
2012-07-03 13:59:00 +03:00
Santhosh Thottingal
7a9b801a79 Introduce Language Category Display (LCD)
Introduce $.fn.lcd - displaying languages by categories.

Added the jquery.viewport.js module by Mika Tuupola (MIT license).

More tests for language utils.

Change-Id: I804b6da8ab0a2d518e17ae8bbd35e1c1da4bab3f
2012-07-02 10:20:16 +05:30
Amir E. Aharoni
43d7604203 Adding utility functions for the ULS langdb
* More functions for making useful queries to the langdb.
* Tests.

Change-Id: I29a3a25ef1b15d5925df2aa3d06f9221f8e5231e
2012-06-29 08:11:16 +03:00
Amir E. Aharoni
03df48a609 Created script groups, introduce $.uls.data
Gave script groups clear names and sorted them.
Documentation in comments.
Add tests to check that no script has been left behind.
Corrected Lath to Latn (thanks to testing).

Rename langdb.js to ext.uls.data.js

Add ResourceLoader module ext.uls.data

Change-Id: I91fafa94ffd1eaf2d12c954fe3a71064276533f9
2012-06-27 15:08:07 +05:30
Amir E. Aharoni
93ca0e5a48 Actually enabled running the JS tests
Change-Id: I5e66be0b5307024e6d21eaedf918ffcbd03d5ed3
2012-06-27 08:13:18 +03:00
Santhosh Thottingal
8527e33475 Skeleton extension for Universal Language Selector
* Basic extension code with i18n
* Adds a link to personal links to trigger ULS
* Core uls javascript code, to plug to the given trigger.
* Qunit, PHPUnit framework in place.
* and lot of TODOs and FIXMEs

Patch set 2:
* A tiny whitespace fix.

Change-Id: I300647a21e0b7f65b7d9dc6101014ea9389c9f2a
2012-06-15 10:49:18 +03:00