When mw.uls.getFrequentLanguageList() is requested sometimes
the language that is a redirect returned causing other codebases (like Wikibase)
to show an invalid language to the user.
Bug: T217770
Change-Id: I49c802d584081aa5992dd0ba76144059bcac56c8
'mw' are '$' are globals, always have been, and aren't going
anywhere. They're every bit as real as their longer versions.
If anything, the longer ones are less "real" or 'stable" because
they're not used internally by RL and easier to accidentally
replace or override. For anecdotes and history, see 91f950d6b0.
Change-Id: I526fb8c961d9477992d88f2780a0ff4cbdc51923
- Updated versions and order of checkers.
- Some consistency updates in Gruntfile.js.
- Updates to make jscs pass.
Change-Id: I7ed93596ff383dc713bd17af2da0472be934d59d
Tests were failing for two reasons: wrong modules as dependencies of the
test module and test timing out due to incorrect usage of QUnit.asyncTest
and QUnit.start() and QUnit.Stop.
While at it, did some small cleanups and converted the number of
assertions to use non-deprecated QUnit.expect() instead.
Options are saved using postWithToken of mw.API. This also rises minimum
MediaWiki version to 1.22. This allowed removing hundred lines of code.
MLEB is already 1.22 and above.
Change-Id: I46a1674e4ede48a0e331c8d201d1d847db51d9dd
This is a basic test that checks the writing preferences
does not result in an error.
It depends on I8fdc1a05 and I18a5ffb5.
It is very rudimentary: The saving test only checks that the API call
didn't result in an error. It should be enough to check for bug 41763,
but it doesn't really check that the options were written correctly.
It also doesn't do anything to distinguish anonymous and logged-in
users, the preferences for which work differently.
Change-Id: I417089eea64e8a84bd38a00bbb31cbb77dc5bd68
The 'als' is used in a non-standard way in MediaWiki -
it may be used to represent the Allemanic language,
the standard code of which is 'gsw', while 'als'
is ISO 639 3 refers to Tosk Albanian, which is
not currently used in any way in MediaWiki.
This local fix adds a redirect for it.
Also add a test to check that it works correctly.
Change-Id: Id904cab129eb58f8b96ce493e77d21da7c44ea8b
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
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
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
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
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
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
* Added new utility functions to return all languages by script group.
* Used that function to sort languages initially.
* Added tests.
Change-Id: I405cb73e6af13f59c307da5a7f2269049ecba698
* 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
* Clarified naming: separated regions from region groups.
* New utility functions for sorting and grouping languages.
* JSHint fixes.
* Added tests.
Change-Id: I8153a2b89fbc7b9a7d6b7deeb87208efc9f4d021
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
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
* 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