Jump to content

Extension:PerPageLanguage

From mediawiki.org
This page is a translated version of the page Extension:PerPageLanguage and the translation is 78% complete.
This extension is professionally maintained by the WikiTeq team.
WikiTeq provides official support for MediaWiki LTS releases only. It may work with other MediaWiki releases.
MediaWiki扩展手册
PerPageLanguage
发行状态: 稳定版
实现 MyWiki
描述 依據設定的頁面語言更改本地化界面消息語言。
作者 Vedmaka
维护者 WikiTeq team
最新版本 1.0.0 (2021年6月)
兼容性政策 对于每个有长期支持的MediaWiki发行版本,扩展内都有对应的分支。
MediaWiki 1.35, 1.39
数据库更改
许可协议 GNU通用公眾授權條款2.0
下載
  • $wgPerPageLanguageIgnoreUserSetting
季度下載量 3 (Ranked 129th)
前往translatewiki.net翻譯PerPageLanguage扩展
問題 开启的任务 · 报告错误

The PerPageLanguage extension allows a multi-lingual wiki to display each page in the same language as its contents. It allows for the page's defined content language, a feature built into MediaWiki, to also define what language the user interface should use. Unlike UniversalLanguageSelector, it changes the language used for the user interface based on the page's content language, not what the user selects. This extension can be thought of as using ?uselang= based on the page content language. (For more information on the difference between user interface language and page content language, see Manual:Language.)

This extension was created for WikiWorks.

用法

A page's content language can be defined at Special:PageLanguage if $wgPageLanguageUseDB is set to true. If this is defined, then PerPageLanguage will change the user interface language to match the page content language for anyone who navigates to that page.

下載

此扩展可直接从Git检索到 [?]:

  • 浏览代码
  • 部分扩展有稳定版本标签。
  • 每个分支与过去的MediaWiki发布版本相关联。 这里也有一个“主线”分支,包含最新alpha版本(可能需要MediaWiki的alpha版本)。

提取快照,并将它放置在您的MediaWiki安装副本的extensions/PerPageLanguage/目录中。

如果您对git熟悉,并且拥有您服务器的shell访问权,您也可以通过以下方法获得扩展:

cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/PerPageLanguage.git

安裝

  • 下载文件,并将解压后的PerPageLanguage文件夹移动到extensions/目录中。
    开发者和代码贡献人员应从Git安装扩展,输入:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/PerPageLanguage
  • 将下列代码放置在您的LocalSettings.php 的底部:
    wfLoadExtension( 'PerPageLanguage' );
    $wgPageLanguageUseDB = true;
    $wgGroupPermissions['sysop']['pagelang'] = true;
    
  • Configure as required
  • Yes 完成 – 在您的wiki上导航至Special:Version,以验证已成功安装扩展。

配置

  • $wgPerPageLanguageIgnoreUserSetting - If true, disregards the language chosen by the user's own preferences and forces the page to be displayed in the same language as the page content language.

參見