扩展:维基媒体消息
发行状态: 稳定版 |
|
|---|---|
| 实现 | 用户界面 |
| 描述 | 添加维基媒体基金会特定消息及语法,以及维基媒体基金会特定的覆盖许可证或法律相关的消息 |
| 作者 |
|
| MediaWiki | 1.25+ |
| 数据库更改 | 否 |
| 许可协议 | GNU通用公眾授權條款2.0或更新版本 |
| 下載 | |
|
|
|
|
| 前往translatewiki.net翻譯WikimediaMessages扩展 | |
| 問題 | 开启的任务 · 报告错误 |
维基媒体消息(WikimediaMessages)添加维基媒体基金会特定消息及语法,以及维基媒体基金会特定的覆盖许可证或法律相关的消息
安裝
- 下载文件,并解压
WikimediaMessages文件夹到extensions/目录中。
开发者和代码贡献人员应改从Git安装此扩展,输入:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/WikimediaMessages
- 請新增下列代码到您的LocalSettings.php文件的底部:
wfLoadExtension( 'WikimediaMessages' );
完成 – 請导航至您的wiki上的Special:Version,以验证此扩展已成功安装。
Responsibilities
WikimediaMessages has several responsibilities which are documented here.
Cross-project message modification
The WikimediaMessages extension can be used to alter messages so they apply across sites.
For example, to set the donate URL to point to "https://donate.wikimedia.org/" the sitesupport-url message can be modified by editing MediaWiki:sitesupport-url, however this will only apply to one wiki. The WikimediaMessages allows you to set the message for all wikis without needing to modify every site.
注意: after changing a message you may need to rebuild the localization cache.
Defining new messages
You can define messages that are not defined in any other repository by modifying the associated language JSON files in i18n/wikimedia .
注意: if you want to override a message defined elsewhere, follow the guidelines for overrides.
Overriding existing messages
If a message exists in a repo and you want to override the message:
- Define these messages in the wikimediaoverrides folder. Make sure to append the message key of the message you want to override with "wikimedia-". For example: The message "foo" can be overridden using a key "wikimedia-foo"
- Update the hook onMessageCacheFetchOverrides in Hook.php so that the message for overriding is in the array of messages to override. Make sure to list the key of the message you are wanting to override (e.g. without the "wikimedia-" prefix)
Contact page styles
The WikimediaMessages extension adds the ext.wikimediamessages.contactpage module which adds Wikimedia-specific customisation to Extension:ContactPage.
Site admin helper
Many templates and associated styles were defined over a decade ago, and in many cases for many projects lack maintainers.
The ext.wikimediamessages.styles module allows shipping of global styles for common templates across Wikimedia to apply 对维基媒体wiki的深色模式兼容性建议 and 維基媒體維基上對移動版條目友善的建議. The expectation is that community members at their own pace should upstream styles from this module into their own templates.
Finding styles
The styles provided are listed in the modules/ext.wikimediamessage.styles folder.
Each file name corresponds with a "key".
The styles are expressed using LESS which is not available on wiki but an administrator can adapt these styles locally.
Disabling styles
In some cases styles won't apply to a project.
For example the navbox and hatnote styles are not applicable to a project which uses neither of these templates. To disable the styles in hatnote.less and navbox.less an interface administrator can modify MediaWiki:wikimedia-styles-exclude with the text hatnote|navbox.
When disabling styles we recommend understanding what the styles are doing and first upstreaming relevant styles first.
To disable all styles provided by Wikimedia (not recommended unless you know what you are doing) the message can be set to:
ambox|hatnote|infobox|navbox|theme-night-mainpage|theme-night|theme-night-portal
Applying styles only to specific skins
If you want the styles to not apply to a certain skin, you generate the raw stylesheet prior to disabling a package of styles and copy and paste relevant styles to one of the skin site CSS pages e.g. MediaWiki:Minerva.css, MediaWiki:Vector-2022.css etc..
You can generate the full list of styles by visiting /w/load.php?lang=en&modules=ext.wikimediamessages.styles&debug=1&only=styles on your wiki. For example on English Wikipedia: https://en.wikipedia.org/w/load.php?lang=en&modules=ext.wikimediamessages.styles&debug=1&only=styles .
| 此扩展用于一个或多个维基媒体项目。 这可能意味着扩展足够稳定、运作足够良好,可以用在这样的高流量的网站上。 请在维基媒体的CommonSettings.php和InitialiseSettings.php配置文件中查找此扩展的名称以查看哪些网站安装了该扩展。 特定wiki上的已安装的扩展的完整列表位于Special:Version页面。 |
- Stable extensions/zh
- User interface extensions/zh
- GPL licensed extensions/zh
- Extensions in Wikimedia version control/zh
- CampaignEventsGetPolicyMessageForRegistration extensions/zh
- CampaignEventsGetPolicyMessageForRegistrationForm extensions/zh
- DiscussionToolsTermsOfUseMessages extensions/zh
- EditPageCopyrightWarning extensions/zh
- FlowTermsOfUseMessages extensions/zh
- MessageCacheFetchOverrides extensions/zh
- OutputPageBeforeHTML extensions/zh
- ResourceLoaderRegisterModules extensions/zh
- SidebarBeforeOutput extensions/zh
- SkinAddFooterLinks extensions/zh
- SkinCopyrightFooterMessage extensions/zh
- SkinTemplateNavigation::Universal extensions/zh
- SpecialPageBeforeExecute extensions/zh
- TorBlockBlockedMsg extensions/zh
- UploadForm:initial extensions/zh
- All extensions/zh
- Extensions used on Wikimedia/zh
- Wiki-specific extensions/zh
