Extension:UILangCode/en

From Linux Web Expert

Revision as of 01:59, 21 October 2020 by imported>FuzzyBot (Updating to match new version of source page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

MediaWiki extensions manual
UILangCode
Release status: stable
Implementation Parser extension
Description Implements {{UILANGCODE}} magic word to get interface language of the current user
Author(s) Niklas Laxström (Nikerabbittalk)
Latest version 1.0.0
Compatibility policy Snapshots releases along with MediaWiki. Master is not backward compatible.
MediaWiki 1.29+
Database changes No
License No license specified
Download
Example Translatewiki.net
Quarterly downloads Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Public wikis using Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Translate the UILangCode extension if it is available at translatewiki.net

The UILangCode extension implements the {{UILANGCODE}} magic word to get interface language of the current user.

Download

<translate> The extension can be retrieved directly from Git</translate> [?]:

  • <translate> Browse code</translate>
  • <translate> Some extensions have tags for stable releases.</translate>
  • <translate> Each branch is associated with a past MediaWiki release.</translate> <translate> There is also a "master" branch containing the latest alpha version (might require an alpha version of MediaWiki).</translate>

<translate> Extract the snapshot and place it in the <tvar name=name>extensions/UILangCode/</tvar> directory of your MediaWiki installation.

If you are familiar with Git and have shell access to your server, you can also obtain the extension as follows: </translate>

cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/UILangCode.git

Installation

  • <translate> [[<tvar name=2>Special:ExtensionDistributor/UILangCode/en</tvar>|Download]] and move the extracted <tvar name=name>UILangCode/en</tvar> folder to your <tvar name=ext>extensions/</tvar> directory.</translate>
    <translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/UILangCode%2Fen
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    wfLoadExtension( 'UILangCode/en' );
    
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

Usage

{{UILANGCODE}}

This will make the parser cache vary per user language, greatly decreasing hit rate and increasing storage.

See also