Commit Graph

35 Commits

Author SHA1 Message Date
Niklas Laxström
8b52247b22 Remove incorrect comment 2016-07-26 16:19:40 +03:00
Santhosh Thottingal
ed2427ba2d Remove regionfilter related utility methods
Change-Id: I1ab96280fa71cac3745eb7e7210b15a1e5bc78f8
2016-05-17 15:25:53 +05:30
Santhosh Thottingal
8b3d77dae1 Support language codes that are redirects
Addressing issue #207

Such language codes were not listed in ULS language list.

Root cause was $.uls.data.getLanguagesByScriptGroup was returning
a map of script groups, which contained only resolved language codes.
And later in append method of jquery.uls.lcd.js, there is a check if
that language code is part of languages list passed as option to uls()
call. This test fails and the language code does not get added to display.

Change-Id: Iec914a9694a46eef5750ef3af7346d66e052ab77
2016-04-05 09:17:09 +05:30
Siebrand Mazeland
078448a659 Update code formatting
Changes suggested by CodeSniffer.
2013-08-02 15:38:12 +02:00
Amir E. Aharoni
986831b124 Add Zyyy for an undetermined script and use it accordingly 2013-04-25 18:10:45 +03:00
Amir E. Aharoni
9695cc1b68 Better adherence to coding conventions 2013-01-13 23:05:40 +02:00
Amir E. Aharoni
66a50931a5 Prevent appearance of redirects in the rendered list
utils.getLanguagesByScriptGroup() runs on the object's languages
property and not on all the langdb languages. This caused
the redirects to be counted as languages. I fixed this,
and added a test to prevent it.

Also update JS langdb, because it went out of sync in of
the previous commits.
2013-01-09 12:59:58 +02:00
Santhosh Thottingal
0e61876af5 Merge branch 'extra_languages' of git://github.com/amire80/jquery.uls into amire80-extra_languages
Conflicts:
	src/jquery.uls.data.js
	src/jquery.uls.data.utils.js

Change-Id: I9c321891707b0d68328f4e4c8be1bd451794072d
2013-01-07 15:45:48 +05:30
Amir E. Aharoni
1f91a4c40c Whitespace 2013-01-02 18:28:14 +02:00
Amir E. Aharoni
829c827483 Adding a special region
This is supposed to allow adding special languages.

This region's section is hidden by default and can be enabled by
passing different options to the lcd object.
2013-01-02 12:58:29 +02:00
Siebrand Mazeland
d2d287fbc4 Update docs 2012-12-27 21:58:54 +01:00
Santhosh Thottingal
38d5826b72 Remove all deprecated methods
Change-Id: I8f6507f264ace851483d317af38733be46c51091
2012-12-24 16:18:26 +05:30
Amir E. Aharoni
22112fefbf Add missing semicolon 2012-12-17 10:45:30 +02:00
Amir E. Aharoni
13e249907a Skip redirects in util functions 2012-12-17 10:45:30 +02:00
Amir E. Aharoni
8f75d69997 Add aliases and tests for isRedirect 2012-12-17 10:45:30 +02:00
Amir E. Aharoni
bdb1ef3b47 Add isRedirect (from an old Gerrit commit) 2012-12-17 10:45:30 +02:00
Amir E. Aharoni
5f9a0c4a17 Double quotes -> single quotes 2012-12-17 10:45:30 +02:00
Amir E. Aharoni
9aa9f3ee01 Replaced the deprecated languagesInScripts function 2012-10-15 16:26:51 +02:00
Amir E. Aharoni
c40caf4a29 Update the remaining calls to deprecated functions 2012-10-08 08:27:50 +02:00
Amir E. Aharoni
faeac72491 .languagesByScript* -> .getLanguagesByScript* 2012-10-08 08:13:34 +02:00
Amir E. Aharoni
bd355b249d .allRegions -> .getAllRegions 2012-10-08 08:13:34 +02:00
Amir E. Aharoni
5e16abf26d .autonym -> .getAutonym 2012-10-08 08:13:34 +02:00
Amir E. Aharoni
7d48ec230b .regions -> .getRegions 2012-10-08 08:13:34 +02:00
Amir E. Aharoni
17f525f510 Replace .script with .getScript 2012-10-08 08:13:34 +02:00
Amir E. Aharoni
c007ba3427 (bug 39963) Add "get" to function names
Kept the old names and gave them simple deprecation marking.
2012-10-08 08:13:34 +02:00
amire80
9ce06d2112 Whitespace in jquery.uls.data.utils.js 2012-09-24 17:34:53 -07:00
amire80
7f16137efc Fix whitespace 2012-09-24 16:51:03 -07:00
amire80
f9e3e148e3 Add basic support for dir and lang attributes for autonyms
Added a util function for getting the language's direction.

Added lang and dir attributes for every language item in the list.
2012-09-24 16:34:06 -07:00
Santhosh Thottingal
298c91a68f Misc jshint fixes
* Move the invocation into the parens that contain the function.
* unescaped regex
* Do not wrap function literals in parens unless they are to be
  immediately invoked.

Change-Id: Ib3360f88fb7674af0e857d8a84a91fdac1fd8487
2012-09-04 16:02:28 +05:30
Amir E. Aharoni
790065a1f9 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
ee3cd5c8d1 Add basic information and utils for RTL scripts
Change-Id: Ie01b58cd3627e8f0bf726f0bb296bffb25efcbb5
2012-08-22 18:16:01 +03:00
Santhosh Thottingal
85373c1ac1 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
Niklas Laxström
a2e3671a26 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
2012-08-14 10:19:38 +00:00
Santhosh Thottingal
063805538b Implement visual language grouping in ULS
Added a utility callback function to sort languages by autonym.
Added CSS fix for group separatos.

Change-Id: I73c7c6518a85e4ea7999be3ef92a121e877610e8
2012-08-07 13:42:20 +05:30
Santhosh Thottingal
0a681a85fe Rearranging Files
* Seperating standalone jQuery ULS plugin and extension related code
* lib/jquery.uls can be submodule, but not now.

Change-Id: I7d9cb47daa88dd1a27ceda602a08cab0073caf33
2012-08-03 12:24:04 +05:30