擴展:LocalisationUpdate

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Extension:LocalisationUpdate and the translation is 38% complete.

Other languages:
English • ‎dansk • ‎中文 • ‎日本語
此扩展已绑定在MediaWiki 1.21及以上版本 因此您不需要再次下载。 然而,您仍需要跟随提供的其他指导。
MediaWiki扩展手册
OOjs UI icon advanced.svg
LocalisationUpdate
发布状态: 稳定版
实现 資料庫
描述 讓本地化訊息盡可能地保持更新
作者 Tom Maaswinkel (12wiki), Niklas Laxström (maintainer)
最新版本 1.4.0 (2016-10-13)
兼容性方针 主线(master)
MediaWiki 1.30+
数据庫更新
许可协议 GNU通用公眾授權條款2.0 or later
下载 包括于语言扩展链

Readme
例子 Wikipedia
翻译LocalisationUpdate扩展如果在translatewiki.net可用
检查使用和版本矩阵。
问题 开放的工作 · 报告错误

The LocalisationUpdate extension allows to update the localizations for MediaWiki messages at any time, without needing to upgrade the MediaWiki software.

安装

  • 下载文件,并将其放置在您extensions/文件夹中的LocalisationUpdate目录内。
  • 将下列代码放置在您的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.
  • Yes 完成 – 在您的wiki上导航至Special:Version,以验证扩展已成功安装。

配置

$wgLocalisationUpdateDirectory

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默认为false。

$wgLocalisationUpdateRepository

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

$wgLocalisationUpdateRepositories

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%'
);

用法

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

LocalisationUpdate不會自動更新翻譯

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
If localization updates don't seem to come through, you may need to run php maintenance/rebuildLocalisationCache.php --force.

腳本参数

--repoid: Fetch translations from repositories identified by this

参见