跳转到内容

模板:CURRENTCONTENTLANGUAGE:修订间差异

来自天灾之下:危险连接资料站
wiki>AKlapper (WMF)
小 9 revisions imported from meta:Template:CURRENTCONTENTLANGUAGE: See phab:T231001
 
小 导入1个版本
 
(没有差异)

2025年12月16日 (二) 16:40的最新版本

zh-cn

模板文档

Usage

This template returns the "content language" of the current page; more precisely it checks if the current title ends with a language code, and if it is the case it returns this language code, else {{CONTENTLANGUAGE}} (the default content language; on this wiki: "zh-cn" for Chinese (China)).

Examples

  • on "Bar/foo", this template returns "zh-cn";
  • on "Bar/foo/hu", this template returns "hu".

(Note: there could be false positive: e.g. on "Foo/bar" it returns "bar" because "bar" is the language code for Bavarian; "foo" is not a language code; very small (2 or 3 letters) last words can be a problem as seen here.)

This template takes no argument, and acts as a magic word.

Alternative magic word

Since the creation of this template, the magic word {{PAGELANGUAGE}} has been created and can be used instead of this template (see Phabricator:T59603).