Extension:LocalisationUpdate
![]() | This feature was removed completely in version 1.38. This extension has been abandoned and thus no longer bundled in MediaWiki 1.38. See task T300498 for more information. |
![]() Release status: stable |
|
---|---|
Implementation | Database |
Description | Allows to keep the localized messages as up to date as possible |
Author(s) | Tom Maaswinkel (12wiki), Niklas Laxström |
Latest version | 1.4.0 (2016-10-13) |
MediaWiki | 1.30+ |
Composer | mediawiki/localisation-update |
License | GNU General Public License 2.0 or later |
Download | Readme |
|
|
Quarterly downloads | 118 (Ranked 82nd) |
Public wikis using | 989 (Ranked 223rd) |
Translate the LocalisationUpdate extension if it is available at translatewiki.net | |
Issues | Open tasks · Report a bug |
The LocalisationUpdate extension allows to update the localizations for MediaWiki messages at any time, without needing to upgrade the MediaWiki software.
Installation[edit]
- Download and place the file(s) in a directory called
LocalisationUpdate
in yourextensions/
folder. - Add the following code at the bottom of your
LocalSettings.php
:wfLoadExtension( 'LocalisationUpdate' ); $wgLocalisationUpdateDirectory = "$IP/cache";
- Create a
cache
folder in the installation directory, and be sure the server has permissions to write on it. Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Configuration[edit]
$wgLocalisationUpdateDirectory[edit]
Directory to store 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 know what you're doing. This is added with version 1.1.
Example for using github
$wgLocalisationUpdateRepositories['github'] = array(
'mediawiki' =>
'https://raw.github.com/wikimedia/mediawiki/master/%PATH%',
'extension' =>
'https://raw.github.com/wikimedia/mediawiki-extensions-%NAME%/master/%PATH%',
'skin' =>
'https://raw.github.com/wikimedia/mediawiki-skins-%NAME%/master/%PATH%'
);
Example for local filesystem configuration
$wgLocalisationUpdateRepositories['local'] = array(
'mediawiki' =>
'file:///resources/projects/mediawiki/master/%PATH%',
'extension' =>
'file:///resources/projects/mediawiki-extensions/extensions/%NAME%/%PATH%',
'skin' =>
'file:///resources/projects/mediawiki-skins/skins/%NAME%/%PATH%'
);
$wgLocalisationUpdateHttpRequestOptions[edit]
MediaWiki version: | ≥ 1.35 |
Options to pass to Http::get()
.
Possible keys for the array: (see HttpRequestFactory::create()
).
- timeout
- Timeout length in seconds or 'default'
- connectTimeout
- Timeout for connection, in seconds (curl only) or 'default'
- postData
- An array of key-value pairs or a url-encoded form data
- proxy
- The proxy to use. Otherwise it will use $wgHTTPProxy (if set) Otherwise it will use the environment variable "http_proxy" (if set)
- noProxy
- Don't use any proxy at all. Takes precedence over proxy value(s).
- sslVerifyHost
- Verify hostname against certificate
- sslVerifyCert
- Verify SSL certificate
- caInfo
- Provide CA information
- maxRedirects
- Maximum number of redirects to follow (defaults to 5)
- followRedirects
- Whether to follow redirects (defaults to false). Note: this should only be used when the target URL is trusted, to avoid attacks on intranet services accessible by HTTP.
- userAgent
- A user agent, if you want to override the default MediaWiki/$wgVersion
- logger
- A \Psr\Logger\LoggerInterface instance for debug logging
- username
- Username for HTTP Basic Authentication
- password
- Password for HTTP Basic Authentication
- originalRequest
- Information about the original request (as a WebRequest object or an associative array with 'ip' and 'userAgent').
Example for using GitHub with HTTP Basic Authentication
$wgLocalisationUpdateHttpRequestOptions = array(
'followRedirects' => true,
'username' => 'YOUR_GITHUB_USERNAME',
'password' => 'YOUR_GITHUB_PERSONAL_ACCESS_TOKEN'
);
Usage[edit]
Whenever you want to run an update, run php extensions/LocalisationUpdate/update.php
on the command line, or set up a cron job.
If you are on a unix-like system, you should add LocalisationUpdate to crontab:
crontab -e # Add the following line @daily php /path/to/your/wiki/extensions/LocalisationUpdate/update.php --quiet
php maintenance/rebuildLocalisationCache.php --force
.Script parameters[edit]
--repoid
: Fetch translations from repositories identified by this
See also[edit]
- Localisation
- Technical details about how this runs on Wikimedia projects.
![]() | This extension is included in the following packages and/or wiki farms: This is not an authoritative list. Some wiki farms/hosts may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |
- MediaWiki deprecated or obsolete features
- Stable extensions
- Database extensions
- Extensions supporting Composer
- GPL licensed extensions
- Extensions in Wikimedia version control
- LocalisationCacheRecache extensions
- LocalisationCacheRecacheFallback extensions
- All extensions
- Extensions included in BlueSpice
- Extensions included in semantic::core
- Localisation extensions