Extension:UniversalLanguageSelector

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

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