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.
发行状态: 稳定版
实现 MyWiki
描述 依據設定的頁面語言更改本地化界面消息語言。
作者 Vedmaka
维护者 WikiTeq team
最新版本 1.0.0 (2021年6月)
兼容性政策 对于每个有长期支持的MediaWiki发行版本,扩展内都有对应的分支。
MediaWiki 1.35, 1.39
许可协议 GNU通用公眾授權條款2.0
  • $wgPerPageLanguageIgnoreUserSetting
季度下載量 0
問題 开启的任务 · 报告错误

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版本)。



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
  •   完成 – 在您的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.