Template:MultiPage

来自Valve Developer Community
跳转至: 导航搜索



Icon-Important.png重要:We are currently working on a new Template:Page that does not require the creation of many language subpages, eliminates all expensive functions, replacing them with simpler ones, reduces page loading time, categorizes articles by translation level, etc. Please stop using {{MultiPage}}, because when you move the content to the English subpage, the change history is also transferred, and it is impossible to return it back to the main page without the necessary rights (which regular users do not have).

If you disagree with something or have suggestions for improving the new page format, I advise you to write about it on the discussion page of the new template before this template begins to be used en masse.



Warning.png警告:Do not use this template on template pages! We are working towards having universal templates for all languages, meaning that we no longer need "<template name>:<lang code>", and we can just use an automatically translated template. Using this translation method would undermine all the work we have been putting in for months now. Instead, use {{Autolang}} for translations, and for previewing languages on template pages, uses "{{Uselangflags}}" with noinclude. This will allow for automatically changing the language used in the template while not creating 8 different pages for one template.
Icon-Bug.png错误:Causes some pages, such as List of Team Fortress 2 console commands and variables to not render because of too many templates included.
PlacementTip.png解决方案: Copy/Paste the following instead of {{MultiPage}} on the affected pages:
{{ulf|en=1|<other languages used>|multipageworkaround=1}} {{:{{FULLPAGENAME}}/{{uselang}}}}

This will allow the page to display properly and give the illusion of visual parity with other MultiPage pages. Make sure to visit {{Uselangflags}} for documentation about this template.

This SHOULD NOT be used unless absolutely necessary! This is only a temporary fix until we find a way to fix this issue!

Blank image.png待完善: remove forced line break before page contents when text comes before this template.
Curly brackets white.png模板文档
Icon-translate.png
查看
编辑
页面历史
Icon-translate.png
本模板使用字符串子页面
请遵循该子页面上的格式添加翻译。
Warning.png警告:编辑者,请阅读这个!如果您移动了除了英语以外的 {{lang}} 页面,您必须移除原来的语言类别页面(比如以 Category:(Page Name):es 或 Category:(Page Name) 结尾的页面。
另外,如果您也移动了英语 {{Lang}} 界面,您必须将分类移动到主 ({{MultiPage}}) 页面以避免在分类上展示语言子页面。
Icon-Bug.png错误:如果用户改变在浏览器上改变字体大小(除了16px以外的大小),语言工具栏将与顶部图标(例如{{HLATools topicons}})重叠。这是MediaWiki软件本身的一个限制。
Blank image.png待完善: 给那些之前添加了MultiPage但忘记移除{{Lang}}的编辑者添加一条警告信息。

替代 {{Lang}}

这个模板会寻找翻译子页面以及根据接口语言加载其中一个翻译子页面。当翻译子页面不存在时,这个模板会加载英语版本并且显示一条信息。当没有任何翻译并且英语版本不存在时,这个模板只会显示一条信息。

创建一个新的页面

只需要创建一个空页面,输入{{MultiPage}},点击位于右上角的翻译按钮 ( Icon-translate.png ) 并且选择主要语言。选好之后,{{MultiPage}}会重定向到该语言子页面,你需要在这里编辑文本和模板 {{Language subpage}}

在一个已存在的页面上使用

在一个已存在的页面上使用这个模板之前,您应该确保你已经完成了下面这些步骤(以名为My Cute Article的页面为例):

  1. 将My Cute Article页面的英语内容移动到语言子页面My Cute Article/en
    Icon-Important.png重要:不要移动有关的讨论页面,但是如果有除英语之外的其他语言的讨论页面,您可以移动它们。
  1. 将翻译了My Cute Article的页面移动到语言子页面My Cute Article/<language code> (例如,将My Cute Article:zh-cn移动到My Cute Article/zh);
  2. 将英语页面的分类移动到基本(主)页面,即带有{{MultiPage}}的页面(例如,移动到My Cute Article页面);
  3. 将共享的或共通的模板移动到基本页面;
  4. 将位于所有语言子页面的语言后缀(:pt-br, |suf=:de)删除。这些后缀已弃用并且不再需要。
  5. 将位于所有语言子页面的语言分类(例如[[Category:My Cute Category:ru]])删除。这些分类弃用并且不再需要。
  6. {{Language subpage}}放到语言子页面的最上方。
  7. 如果这篇文章与某个实体相关,请将{{Entity}}模板移动到根页面。 实体模板会自动翻译。

在完成上述步骤后,在基础页面的分类部分之上加入{{MultiPage}},然后享受您所看到的内容。

Note.png注意:推荐清理并改善文章的代码。例如,你可以用{{Note}}替换掉原文的{{note}},添加制表符间距,并进行适当的换行。
Icon-Important.png重要:不要给语言子页面分类,并且当你看到这个情况时,请删掉它们。


使用参数 {{{no-en-subpage}}}

此参数允许您将英文内容保留在主页上,而不是将英文内容移动到子页面。

创建一个新的页面

只需像平常创建新页面一样,用英文编写您的内容。然后将模板放置在您的内容之前,并在内容末尾放置{{MultiPage/end}}——这是{{MultiPage}}的子模板。不要包含类别。例如:

{{MultiPage|no-en-subpage=1}} 内容 {{MultiPage/end}} [[Category:English]] [[Category:Level Design]]

为别的语言创建页面,只需要点击位于右上角的翻译按钮 ( Icon-translate.png ) 并选取你想要翻译的语言。来自英语的页面内容会自动填充到翻译子页面,这时你可以开始翻译它们。如果没有自动填充,你可能要手动复制英语页面上的内容。

在一个已存在的页面上使用

和前面类似,不过有一些不同:

  • 在英语的主页面中,内容前面添加{{MultiPage}},内容后面添加{{MultiPage/end}}(请参考上面的示例)不要将英语内容移动到它的子页面(/en)。
  • 其他语言的方法不需要改变。

参数和示例

参数 描述 示例
没有参数 放置模板
{{MultiPage}}
{{{title}}} 可选: 这个参数可以用来改变页面标题栏的文本(逻辑上,转化成应显示在页面语言中的文本。)。
Warning.png警告:在一些页面上你可以会遇到这个错误:Display title "env_cubemap" overrides earlier display title "<code>Env cubemap</code>". 这是由于页面使用别的已经设置好文章标题的模板。
{{MultiPage|title=Main Page}}
{{{margin-right}}} 可选: 位于右上方的按钮的右边距。
{{MultiPage|title=Main Page|margin-right=26px}}
{{{no-en-subpage}}} 可选: 如果你没有移动原来的英语页面到子页面/en,这让您能够保持在主页面原有的内容。将其指定为1 以使其生效。
Note.png注意:这个模板必须放在内容之前,不然无法生效。您必须将{{MultiPage/end}}放在内容之后。参考用例。
{{MultiPage|no-en-subpage=1}} {{Lorem}} {{MultiPage/end}}

用例

{{MultiPage}}
Note.png注意:如果你想要改变标题,在语言子页面中使用{{Language subpage}}的参数{{{title}}}以便于标题能够自动改变。另外,你可以对没有翻译标题的页面使用
{{MultiPage|title = My sweet page}}

其他

当前支持的语言
语言 页面名称 图标
英语 页面名称/en English (en)
加泰罗尼亚语 页面名称/ca Català (ca)
捷克语 页面名称/cs Čeština (cs)
德语 页面名称/de Deutsch (de)
希腊语 页面名称/el Ελληνικά (el)
世界语 页面名称/eo Esperanto (eo)
西班牙语 页面名称/es Español (es)
爱沙尼亚语 页面名称/et Eesti (et)
法语 页面名称/fr Français (fr)
希伯来语 页面名称/he עברית (he)
印度语 页面名称/hi हिन्दी (hi)
匈牙利语 页面名称/hu Magyar (hu)
意大利语 页面名称/it Italiano (it)
日语 页面名称/ja 日本語 (ja)
格鲁吉亚语 页面名称/ka ქართული (ka)
高棉语 页面名称/km ភាសាខ្មែរ (km)
韩语 页面名称/ko 한국어 (ko)
马来语 页面名称/ms Bahasa Melayu (ms)
荷兰语 页面名称/nl Nederlands (nl)
挪威语 页面名称/no Norsk (no)
波兰语 页面名称/pl Polski (pl)
葡萄牙语 页面名称/pt Português (pt)
葡萄牙语 (巴西) 页面名称/pt-br Português do Brasil (pt-br)
俄语 页面名称/ru Русский (ru)
瑞典语 页面名称/sv Svenska (sv)
土耳其语 页面名称/tr Türkçe (tr)
乌克兰语 页面名称/uk Українська (uk)
越南语 页面名称/vi Tiếng Việt (vi)
简体中文 (中国大陆) 页面名称/zh 中文 (zh)
繁体中文 (台湾) 页面名称/zh-tw 中文(台灣)‎ (zh-tw)