Jump to content

User:KartikMistry/Extension:LocalisationUpdate

From mediawiki.org
This extension is bundled with MediaWiki 1.21 and above. Thus you do not have to download it again.
MediaWiki extensions manual
LocalisationUpdate
Release status: stable
Implementation Database
Description Extension to keep the localized messages as up to date as possible
Author(s) Tom Maaswinkel (12wiki), Niklas Laxström (maintainer)
Latest version 1.0
MediaWiki 1.19+
License GPL v2 or later
Download Included in Language Extension Bundle
Readme
Example Wikipedia
Translate the KartikMistry/Extension:LocalisationUpdate extension if it is available at translatewiki.net

What does this extension do

[edit]

This extension can update the localizations for MediaWiki messages at any time, without needing to upgrade the MediaWiki software.

Download

[edit]

The extension can be retrieved directly from Git [?]:

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

Extract the snapshot and place it in the extensions/KartikMistry/Extension:LocalisationUpdate/ 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:

cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/KartikMistry%2FExtension%3ALocalisationUpdate.git

Installation

[edit]
  • Download and move the extracted KartikMistry folder to your extensions/ directory.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/KartikMistry
  • Add the following code at the bottom of your LocalSettings.php file:
    require_once "$IP/extensions/KartikMistry/KartikMistry.php";
    $wgLocalisationUpdateDirectory = "$IP/cache";
    
  • Create a cache folder in the installation directory, and be sure the server has permissions to write on it.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Note Note: If localization updates don't seem to come through, you may need to run php maintenance/rebuildLocalisationCache.php --force.

Configuration

[edit]

$wgLocalisationUpdateDirectory

[edit]

Directory to store serialized cache files in, if not set then it uses default $wgCacheDirectory. LocalisationUpdate requires some place to store files in to work; if neither $wgLocalisationUpdateDirectory nor $wgCacheDirectory is set, LocalisationUpdate's update.php script will not work.

$wgLocalisationUpdateDirectory is set to false by default.

$wgLocalisationUpdateRepository

[edit]

Default repository source to fetch translation. Github is set to default repository. This is added with version 1.1.

$wgLocalisationUpdateRepositories

[edit]

Array of repositories URLs from which to retrieve localisations for core MediaWiki and extensions. Default is set to Github's MediaWiki Git repositories and you should not change this unless you're using this performance improvement or otherwise know what you're doing. This is added with version 1.1.

Running an update

[edit]

Whenever you want to run an update, run php extensions/LocalisationUpdate/update.php on the command line, or set up a cron job.

NOTE: LocalisationUpdate does not update automatically. If you want to update your localizations regularly, you need to setup a cron job yourself.

Script parameters

[edit]

With version 1.1,

:--repoid: Fetch translations from repositories identified by this

Known issues

[edit]

If you enable this extension directly from the web installer, it doesn't configure the $wgLocalisationUpdateDirectory variable, so if you don't configure it explicitly, it would throw an exception when viewing any page (bug 46885). You must manually configure that variable after installing the extension.

See also

[edit]