擴展:LocalisationUpdate
This extension has been removed in MediaWiki 1.38 per task T300498.
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. |
![]() 發佈狀態: 穩定版本 |
|
---|---|
实现 | 数据库 |
描述 | 讓本地化訊息盡可能地保持更新 |
作者 | Tom Maaswinkel (12wiki), Niklas Laxström |
最新版本 | 1.4.0 (2016-10-13) |
MediaWiki | 1.30+ |
Composer | mediawiki/localisation-update |
许可协议 | GNU通用公眾授權條款2.0或更新版本 |
下載 | Readme |
|
|
Quarterly downloads | 143 (Ranked 66th) |
Public wikis using | 1,809 (Ranked 69th) |
翻譯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
: 從此標誌的儲存庫中獲取翻譯
参见
这个扩展包含在以下包和/或维基农场: 这不是一个权威的名单。一些维基农场/主机可能包含这个extension,即使它们没有在这里列出。经常检查您的维基农场/主机或包来确认。 |