Extension:LangCodeOverride

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
Crystal Clear action run.svg
LangCodeOverride
Release status: beta
Screenshot-LangCodeOverride-2018-11-15.png
Implementation Skin
Description Provide overrides of language codes in the sidebar
Author(s) John Erling Blad (Jebladtalk)
Latest version 2018-11-08
Database changes No
License GNU General Public License 3.0 or later
Download
README
Hooks used
SkinTemplateGetLanguageLink
Translate the LangCodeOverride extension
Check usage and version matrix.

The LangCodeOverride extension provide overrides of language codes in the sidebar, as some of them are wrong of historical reasons.

Installation[edit]

  • Download and place the file(s) in a directory called LangCodeOverride in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php:
    wfLoadExtension( 'LangCodeOverride' );
    
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Further notes about installation can be found in the install file.

Features[edit]

In the config section of extension.json it is one constant; Codes.

Codes 
are at the first level an object structure consisting of groups as keys, and at the second level an object structure with language code replacement pairs.

Vagrant[edit]

This extension can use a plain Mediawiki-Vagrant, with two exceptions, the instance must have definitions in the interwiki tables for the links it shall override and an entry in the sites table for its own group membership.

Note that for a Vagrant box the following must be done from inside the instance.

The most straight forward solution to populate the interwiki table is by reusing the data from English Wikipedia

php maintenance/populateInterwiki.php --source https://en.wikipedia.org/w/api.php

A Vagrant box will have a `$wgDBname` of `wiki`, so create a site entry

php maintenance/addSite.php wiki wiki

This will then work with an example config like the following

  "Codes": {
    "wiki" : {
      "no": "nb"
    }
  }

Further notes about installation can be found in the install file.