Extension:UniversalLanguageSelector
|
UniversalLanguageSelector Release status: stable |
|
|---|---|
| Implementation | User interface, Skin |
| Description | Tool that allows users to select a language and configure its support in an easy way. |
| Author(s) | (Santhosh.thottingaltalk) |
| MediaWiki | 1.20.4 or later |
| License | GNU General Public Licence 2.0 or later, MIT license |
| Download | Included in Language Extension Bundle |
| Check usage and version matrix; stats | |
| Bugs: list open list all report | |
The Universal Language Selector is a tool that allows users to select a language and configure its support in an easy way. Where used, it also ships the functionality of both WebFonts and Narayam extensions. See Universal Language Selector for background and additional information.
Contents |
Usage[edit]
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:
- Flexible and easy way to select a language from a large set of languages.
- Selection can be based on geographical region based browsing, searching.
- Search can be based on ISO language code, language name written in current user interface language or in its own script(autonym)
- Cross language search - search language names using any script
- Autocompletion of language names
- Auto correction of spelling mistakes in search strings
- Geo IP based language suggestions
- Language selection based on users browser/OS language
- Input methods
- An easily selectable input method collection, readily available in every editable field
- Provides a large set of input methods for wide range of languages
- An outdated list is available at Extension:Narayam#Supported schemes
- Per-language input method preferences
- Webfonts
- A large collection of fonts to choose for each language to use as embedded font for the page
- An outdated list is available at Extension:WebFonts#Supported languages
- Per-language font preferences
- A large collection of fonts to choose for each language to use as embedded font for the page
Adding support for a new languages fonts[edit]
Follow the instructions on the WebFonts page, but file requests in the UniversalLanguageSelector bugzilla component.
Adding support for a new key mapping (input method)[edit]
Follow the instructions on the Narayam page, but file requests in the UniversalLanguageSelector bugzilla component.
Download[edit]
You can download the extension directly from the MediaWiki source code repository (browse code). You can get:
- One of the extensions tags
Not all extensions have tags. Some extensions have tags for each release, in which case those tags have the same stability as the release. To download a tag
- Go to the tags list
- Click the name of the tag you want to download
- Click "snapshot"
- The latest version of one of the extensions branches
Each extension has a master branch containing the latest code (might be unstable). Extensions can have further branches as well.
- Go to the branches list
- Click the branch name
- Click "snapshot"
- A snapshot made during the release of a MediaWiki version.
This might be unstable and is not guaranteed to work with the associated MediaWiki version.
After you've got the code, save it into the extensions/UniversalLanguageSelector directory of your wiki.
If you are familiar with git and have shell access to your server, you can obtain the extension, with all its tags and branches, as follows:
cd extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/UniversalLanguageSelector.git
Installation[edit]
- Download and extract the files in a directory called "
UniversalLanguageSelector" in your extensions/ folder. - Add the following code to your LocalSettings.php (at the bottom)
require_once( "$IP/extensions/UniversalLanguageSelector/UniversalLanguageSelector.php" );
Done – Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.
Updating LanguageNameIndex[edit]
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[edit]
The following variables are created automatically during initialization and can be used from JavaScript using mw.config.get( NAME ):
wgULSLanguages- an associative array where the keys are language codes and the values are language names in English.wgULSAcceptLanguageList- an array of language codes from the user's Accept-Language value. These are the languages selected in the user's browser preferences.wgULSGeoService- 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 $wgExtensionAssetsPath 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
The following variables can also be configured:
$wgULSGeoService$wgULSEnable$wgULSAnonCanChangeLanguage$wgULSIMEEnabled$wgULSPosition
See also[edit]
| This extension is being used on one or more Wikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia's CommonSettings.php and InitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki's Special:Version page. |