MediaWiki:如何解析通过 API 检索到的 "descriptionmsg" 值?
MediaWiki: How to resolve "descriptionmsg" value retrieved via API?
通过 http://en.wikipedia.org/w/api.php?action=query&meta=siteinfo&formatversion=2&format=json&siprop=extensions you can retrieve information about the MediaWiki extensions installed. The result format is documented at https://www.mediawiki.org/wiki/API:Siteinfo 并声明每个分机 descriptionmsg
包含一个系统消息名称。这不是描述本身,而是描述字符串的键。
我的问题是:我有来自 descriptionmsg
的密钥,现在如何获取描述字符串(通过 API)?
您可以检索 https://en.wikipedia.org/wiki/MediaWiki:[descriptionmsg_value]
的内容
用实际值替换[descriptionmsg_value]
。例如给定 "descriptionmsg":"timedmediahandler-desc"
相关页面是 https://en.wikipedia.org/wiki/MediaWiki:timedmediahandler-desc.
获取页面内容的方法有多种。有关详细信息,请参阅 API:Get the contents of a page。
MediaWiki 在其操作 API 中有一个名为 allmessages 的 API 模块,可以这样调用 https://en.wikipedia.org/w/api.php?action=query&format=json&meta=allmessages&ammessages=centralauth-desc
通过 http://en.wikipedia.org/w/api.php?action=query&meta=siteinfo&formatversion=2&format=json&siprop=extensions you can retrieve information about the MediaWiki extensions installed. The result format is documented at https://www.mediawiki.org/wiki/API:Siteinfo 并声明每个分机 descriptionmsg
包含一个系统消息名称。这不是描述本身,而是描述字符串的键。
我的问题是:我有来自 descriptionmsg
的密钥,现在如何获取描述字符串(通过 API)?
您可以检索 https://en.wikipedia.org/wiki/MediaWiki:[descriptionmsg_value]
的内容用实际值替换[descriptionmsg_value]
。例如给定 "descriptionmsg":"timedmediahandler-desc"
相关页面是 https://en.wikipedia.org/wiki/MediaWiki:timedmediahandler-desc.
获取页面内容的方法有多种。有关详细信息,请参阅 API:Get the contents of a page。
MediaWiki 在其操作 API 中有一个名为 allmessages 的 API 模块,可以这样调用 https://en.wikipedia.org/w/api.php?action=query&format=json&meta=allmessages&ammessages=centralauth-desc