Valve Developer Community:Zh/Alternative Languages: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (otherlang2'd - finishtranslation)
(updated language links, page still needs translated though)
Line 38: Line 38:
表示既有使用当前页语言也有目标页语言所书写的文本,并提供目标页的链接。
表示既有使用当前页语言也有目标页语言所书写的文本,并提供目标页的链接。


== Creating language tag templates ==
== Adding links ==
Creating templates for alternative languages is easy. Simply copy the code for existing templates, and put them into templates replaced with your correct language code. Please be sure to put your target language's name in both your language and the target language's.


Example ([[:Template:otherlang:es:en|Spanish]]):
[[Template:Otherlang2]] generates a row of flags in the top-right of the page. Use it like this:
Inglés (English)


A template can be modified by going to <code>Template:''name''</code>; for example, the <code>otherlang:pl:en</code> template can be modified by going to <code>Template:otherlang:pl:en</code>.
<pre><nowiki>
 
{{otherlang2|
The code for <code>otherlang:'''''xx'''''</code> is:
es = Destination page:es|
<nowiki><br style="clear:both;" /></nowiki>
de = Destination page:de|
<nowiki>----</nowiki>
jp = Destination page:jp
&lt;small>'''''translation1''''': &lt;/small>
}}
 
</nowiki></pre>
The code for <code>otherlang:'''''xx''''':'''''yy'''''</code> is:
<nowiki><small>[[{{{1}}}|</nowiki>'''''translation2''''' ('''''translation3'''''<nowiki>)]]</small></nowiki>
Where:
* '''''xx''''' is the language code of your language
* '''''yy''''' is the language code of the other language
* '''''translation1''''' is the phrase "This page is also available in", translated to your language
* '''''translation2''''' is the name of the other language, translated to your language
* '''''translation3''''' is the name of the other language, translated to its own language
 
Examples:
* [[Template:otherlang:en]] (written in English)
* [[Template:otherlang:en:es]] (says "Spanish" in English and Spanish)
* [[Template:otherlang:es]] (written in Spanish)
* [[Template:otherlang:es:en]] (says "English" in Spanish and English)
 
* [[Template:otherlang:en]] (written in English)
* [[Template:otherlang:en:sv]] (says "Swedish" in English and Swedish)
* [[Template:otherlang:sv]] (written in Swedish)
* [[Template:otherlang:sv:en]] (says "English" in Swedish and English)


The template '''must''' be the first text on the page! You should also do your best to update all the other translated pages, not just your own and English.
== 可用语言 ==
== 可用语言 ==
已知语言可在此处找到 [[:Category:Languages|Languages category]]。
已知语言可在此处找到 [[:Category:Languages|Languages category]]。

Revision as of 01:40, 9 March 2011

Template:Otherlang2

Info content.png
This page has not been fully translated.
You can help by finishing the translation.
If this page cannot be translated for some reason, or is left untranslated for an extended period of time after this notice is posted, the page should be requested to be deleted.
Also, please make sure the article complies with the alternate languages guide.(en)

本页面是关于在Valve开发者社区争取多语言支持。

翻译页面

如果你精通某一门语言,翻译页面对你来说应该很容易。本文不会深入探讨文章翻译的内容。

推荐的命名规则

推荐保留英文原标题,然后分别添加冒号再加所需语言代码。 ISO 639-2 alpha-2

例: Command Line Options:jp

需要注意的是英语文档通常作为原稿因此不需要加 :en 标签。

其他语言模版

模版用于标记某一页面已翻译为其他语言版本,因此这些模版可被任意语言所利用。

例如某英文页面有日语的译文:

{{otherlang:en}}
{{otherlang:en:jp|Destination page:jp}}

例如某西班牙语页面有英语和德语的译文:

{{otherlang:es}}
{{otherlang:es:en|Destination page}},
{{otherlang:es:de|Destination page:de}}

语法构成

你应该注意到了,创建这样的声明需要各部分应用不同的模版。第一部分,

{{otherlang:当前语言代码}}

表示本页也有其他版本:。其后安排一个或多个下列的声明

{{otherlang:当前语言代码:目标语言代码|目标页面}}

表示既有使用当前页语言也有目标页语言所书写的文本,并提供目标页的链接。

Adding links

Template:Otherlang2 generates a row of flags in the top-right of the page. Use it like this:

{{otherlang2|
es = Destination page:es|
de = Destination page:de|
jp = Destination page:jp
}}

The template must be the first text on the page! You should also do your best to update all the other translated pages, not just your own and English.

可用语言

已知语言可在此处找到 Languages category

如果你想要让你所使用语言的类目出现在主语言类目中,将下面的内容添加到你的语言类目的文档中。

[[Category:Languages]]

写在最后

这篇指南不具有权威性,但是如果大家能遵循这种利用模版的方法会让工作更加简单,也只有这样才能让wiki中的各语言保持和谐。

补充:你可以以编辑方式打开某个有多语言支持的页面,通常多语言页的支持代码都加在了最后,从中应该可以学习到一些。