Extension:UniversalLanguageSelector

Usage
The primary aim is to allow users to select a language and configure its support in an easy way.

The extension provides the following features:


 * 1) Flexible and easy way to select a language from a large set of languages.
 * 2) Selection can be based on geographical region based browsing, searching.
 * 3) Search can be based on ISO language code, language name written in current user interface language or in its own script(autonym)
 * 4) Cross language search - search language names using any script
 * 5) Autocompletion of language names
 * 6) Auto correction of spelling mistakes in search strings
 * 7) Geo IP based language suggestions
 * 8) Language selection based on users browser/OS language
 * 9) Input methods
 * 10) An easily selectable input method collection, readily available in every editable field
 * 11) Provides a large set of input methods for wide range of languages
 * 12) Per-language input method preferences
 * 13) Webfonts
 * 14) A large collection of fonts to choose for each language to use as embedded font for the page
 * 15) Per-language font preferences



Updating LanguageNameIndex
For performing cross language search, searching autonyms, language data needs to be populated. ULS comes with a pre-populated language name index(data/langnames.ser). In case you want to update it, install Extension:CLDR and update the data with the following command. php ULS/data/LanguageNameIndexer.php

and verify that langnames.ser file gets generated in ULS/data/ folder.

Configuration
The following variables are created automatically during initialization and can be used from JavaScript using mw.config.get( NAME ):
 * - an associative array where the keys are language codes and the values are language names in English.
 * - an array of language codes from the user's Accept-Language value. These are the languages selected in the user's browser preferences.
 * - a address to geolocation service. Defaults to http://freegeoip.net/json/ and expects the same format. Set false to disable. Geolocation can still be provided by populating window.Geo.country.

ULS uses jquery.i18n to load translation in JSON format with XHR. If your is on different server this means it will attempt CORS (which means it is only supported on modern browsers). You need to configure Access-Control-Allow-Origin on your assets domain for this to work.

For serving fonts, you might want to add the following mime types to your webserver if not already there. This guide might help.


 * application/x-font-woff .woff
 * application/vnd.ms-fontobject .eot
 * application/x-font-ttf .ttf