Unlike freegeoip it also works with https
Also moved the getCountryCode function to init, as it should be
available regardless of whether we load the optional geoclient
module.
Bug: 40965
Change-Id: Ia18130890d09f86a93b5b61f7da7c48fcfa480c7
This allows us to enable web fonts and input methods for all
users by disabling just the interface language selection.
Updated the documentation of the variables to make it clearer
what each does. Summary:
* Enabling: $wgULSEnable and $wgULSEnableAnon
* Workarounds: $wgULSAnonCanChangeLanguage and $wgULSLanguageDetection
Cleaned up hooks, in particular rewritten getLanguage to separate
the logged in vs. logged out steps for easier understanding.
A followup commit is needed to disable language selection UI for
anon if $wgULSAnonCanChangeLanguage is false.
Change-Id: Ia8d21c394ff5efac0ce94664710c97dc3b74ec18
ULS is disabled for anonymous users on WMF projects. But to provide
rest of the features - apis, language database, language selection for
many use cases, we need to provide a minimal ULS. RL module
ext.uls.init does that job now.
For using ULS as interface language selection tool, new RL module
ext.uls.interface is introduced. That will add UI language selection,
webfonts, ime features, if enabled.
Change-Id: I796a7c9cce0de42bf8aa06b26e383e0075dbe1dd
Allow the cache-breaking toolbar and cookie-based user language
selection features to be disabled, while still allowing Wikibase to have
its language autocompletion drop-downs on special pages.
Change-Id: Iba18f666fdcf5b87b7068ab6b1537c868c8fe861
* It can be a user preference using the ULS Input method settings
* It can be a mediaWiki configuration $wgULSIMEEnabled
Change-Id: Ic5fb4932d62ab18db5d3b10ca81c0f6bfe9fd29e
* Update jquery.i18n - if messageLocationResolver returns false for
a locale, no server hit will be attempted
* Refactor i18n preparation code to a new method
* Use the ULS RL hooks to find out to which locales it is localized,
pass that list to js to avoid hitting server.
* Also avoid directory scanning in each request by putting
the locale list in cache
Fixes Bug 41454
Change-Id: I0c923b35db01b884e2dd55873dd5fb7384434645
Exception from line 124 of /www/w/includes/StubObject.php: Unstub loop detected on call of $wgLang->getCode
from Message::inLanguage
[28-Aug-2012 07:45:20] PHP Notice: Undefined variable: validLanguages in /www/w/extensions/UniversalLanguageSelector/UniversalLanguageSelector.hooks.php on line 80
[28-Aug-2012 07:45:20] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /www/w/extensions/UniversalLanguageSelector/UniversalLanguageSelector.hooks.php on line 80
Change-Id: I6ab332ce344c753a8ea5894fd9c45721a5835909
* The jQuery selectors should be referring to the menu for the current
ULS instance rather than querying on the page. This allows multiple
instances of ULS present in the page
* Keep the HTML template with the plugin. No more HTML added from hooks.
* Updated the example based on above change.
* Updated the hooks code.
* Some more documentation.
Change-Id: I48e2e167bc2c09b8653a142c50317c22e8ba1362
* Update .gitignore to ignore .idea.
* Removed unused local variables.
* use local context and Message class instead of deprecated wfMsg* methods.
* Remove redundant px in CSS where possible.
* Combine CSS statements where possible.
* Replace b by strong.
Change-Id: I9d5ed7b7ce585a1c101044254bcbdfc33d42afc1
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
This does not add much functionality. That will come in
future commits.
This commit has many cleanup, refactoring on the display settings,
language settings code.
Change-Id: I7fbc3ebb9b67c1afd80f159c2d82cd2a1c6bea74
* use setlang parameter to change language preference
* language preference will be persistant for all users
* for anonymous users, cookie 'language' will be used
* for logged in users, preference 'language' will be used
* uselang parameter can be used for temporary switching
* language codes will be sanitized.
Change-Id: I2472aee9a7dcd824b622edd38e83f20212f09945
Provide atocopletion capabilities to the search box: showing the remaining
part of the matching element and allow user selection with keyboard.
Change-Id: Ic591c3c87632fb56af16b9b15ecedbf9558d674a
Provide a view showing:
- A feedback message where the current search term is displayed.
- Suggested options: based on likely languages and languages with one
additional level of editing distance than the used in the search algorithm.
- Instructions for search and browse including links to all the sub-regions
available.
* Introduced success, noresults callbacks for language and region filters
* Region filter can be a link for a region alone.
Change-Id: I713b62911bb32e1b1427320ced767b144180c5c4
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
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
RegionFilter is a basic jquery plugin to work with ULS
to select languages based on regions.
PS2: Added a css class for elements with regionfilter.
Used it for visual indication of selection. Plus some
clean up.
Change-Id: Ib01b4077435f98665075310e285e68f8538eeb4e