擴展:LocalisationUpdate
Jump to navigation
Jump to search
此扩展已绑定在MediaWiki 1.21及以上版本 因此您不需要再次下载。 然而,您仍需要跟随提供的其他指示。
LocalisationUpdate 发布状态: 稳定版 |
|
---|---|
实现 | 資料庫 |
描述 | 讓本地化訊息盡可能地保持更新 |
作者 | Tom Maaswinkel (12wiki), Niklas Laxström (maintainer) |
最新版本 | 1.4.0 (2016-10-13) |
兼容性方针 | Master maintains backwards compatibility. |
MediaWiki | 1.30+ |
许可协议 | GNU通用公眾授權條款2.0或更新版本 |
下载 | 包括于语言扩展链
Readme |
例子 | Wikipedia |
|
|
翻譯LocalisationUpdate擴充功能如在translatewiki.net可用 | |
问题 | 尚未完成的工作 · 回報錯誤 |
LocalisationUpdate擴展讓你可以隨時更新MediaWiki訊息,而不需要升級MediaWiki軟體。
安装
- 下载文件,并将其放置在您
extensions/
文件夹中的LocalisationUpdate
目录内。 - 将下列代码放置在您的LocalSettings.php的底部:
wfLoadExtension( 'LocalisationUpdate' ); $wgLocalisationUpdateDirectory = "$IP/cache";
- 在安裝目錄下建立
cache
資料夾,並確保伺服器有權限可以寫入。 完成 – 在您的wiki上导航至Special:Version,以验证扩展已成功安装。
配置
$wgLocalisationUpdateDirectory
用來儲存快取檔案的目錄,如果沒有設定則使用預設值$wgCacheDirectory 。 LocalisationUpdate需要一些地方來儲存檔案才能使用;如果$wgLocalisationUpdateDirectory和$wgCacheDirectory都沒有設定,則LocalisationUpdate腳本不會運作。
$wgLocalisationUpdateDirectory默认为false。
$wgLocalisationUpdateRepository
獲取翻譯的預設儲存庫來源。 GitHub被設定為預設儲存庫。 這在版本1.1加入。
$wgLocalisationUpdateRepositories
用來獲取MediaWiki核心及擴展的本地化訊息的儲存庫URL陣列。 預設為Github的MediaWiki Git儲存庫,除非你知道你在做什麼,否則不要更改它。這在版本1.1加入。
使用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%'
);
本地檔案系統設定的範例
$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
MediaWiki版本: | ≥ 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'
);
用法
當你想要執行更新時,在命令行執行php extensions/LocalisationUpdate/update.php
或設定cron任務。
LocalisationUpdate不會自動更新翻譯
如果你使用類unix系統,你應該添加LocalisationUpdate到crontab:
crontab -e # Add the following line @daily php /path/to/your/wiki/extensions/LocalisationUpdate/update.php --quiet
如果本地化更新看起來沒有到來,你或許要執行
php maintenance/rebuildLocalisationCache.php --force
。腳本参数
--repoid
: 從此標誌的儲存庫中獲取翻譯
参见
![]() | 此扩展被用于一个或多个维基媒体项目上。 这可能意味着扩展稳定且工作良好,足以用在同等高流量的网站上。 请在维基媒体的CommonSettings.php和InitialiseSettings.php配置文件中寻找此扩展名称以查看安装它的网站。 详细的已安装扩展的完整列表可在wiki的Special:Version页面找到。 |
Categories:
- Extensions bundled with MediaWiki 1.21/zh
- Stable extensions/zh
- Database extensions/zh
- GPL licensed extensions/zh
- Extensions in Wikimedia version control/zh
- LocalisationCacheRecache extensions/zh
- LocalisationCacheRecacheFallback extensions/zh
- All extensions/zh
- Extensions used on Wikimedia/zh
- Localisation extensions/zh