Template:Language/archives/Autolang/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (less messy)
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Doc/subpage}}
{{Doc/subpage}}
<!-- Please place categories where indicated at the bottom of this page.) -->
<!-- Please place categories where indicated at the bottom of this page.) -->
{{autolang|zh={{:User:1416006136/Signature|create=1}}}}
{{#switch: {{intlang}}|vi={{Updatetranslation}}}}
{{autolang
{{#switch: {{intlang}}
|This template can change the content automatically according to the language of the UI. Should use with {{tl|Uselangflags}}. The documentation of the template is written by using this template. <br>Also, if you encounter a bug that the text is missing, use {{code|"<nowiki>| 1 = Text</nowiki>"}} or try to remove atleast one pipe {{code|"<nowiki>|</nowiki>"}} as a workaround.
|#default = This template can change the content automatically according to the language of the page or the interface. Should use with {{T|Uselangflags}} or {{T|LanguageBar}}. The documentation of the template is written by using this template. <br>Also, if you encounter a bug that the text is missing, use {{code|"<nowiki>| 1 = Text</nowiki>"}} or try to remove atleast one pipe {{code|"<nowiki>|</nowiki>"}} as a workaround.
|vi=Cái mẫu này có thể đổi nội dung theo ngôn ngữ của giao diện. Phải sử dụng với {{tl|Uselangflags}}. Tài liệu của mẫu được viết bằng cách sử dụng mẫu này.
|vi=Cái mẫu này có thể đổi nội dung theo ngôn ngữ của giao diện. Phải sử dụng với {{T|Uselangflags}} hoặc {{T|LanguageBar}}. Tài liệu của mẫu được viết bằng cách sử dụng mẫu này. <br>Nếu bạn tìm thấy lỗi mất chữ, thử dùng {{code|"<nowiki>| 1 = Text</nowiki>"}} hoặc xóa một cột {{code|"<nowiki>|</nowiki>"}}.
|zh=该模板可以根据 UI 语言来自动更改显示的内容。应该与 {{tl|Uselangflags}} 一起使用。模板的文档是使用此模板编写的。<br>此外,如果你遇到了文本无法显示、丢失的 bug,请使用 {{code|"<nowiki>| 1 = Text</nowiki>"}} 解决。}}<!--
|zh=该模板可以根据页面语言或界面语言来自动更改显示的内容。应该与 {{T|Uselangflags}} 或 {{T|LanguageBar}} 一起使用。模板的文档是使用此模板编写的。<br>此外,如果你遇到了文本无法显示、丢失的 bug,请使用 {{code|"<nowiki>| 1 = Text</nowiki>"}} 解决。}}<!--






--><h2>{{autolang|Usage|vi=Cách sử dụng|zh=用法}}</h2><!--
--><h2>{{#switch: {{intlang}}|#default = Usage|vi=Cách sử dụng|zh=用法}}</h2><!--
--><h3>{{autolang|Parameters|vi=Thông số|zh=参数}}</h3><!--
--><h3>{{#switch: {{intlang}}|#default = Parameters|vi=Thông số|zh=参数}}</h3><!--


-->*{{param|1}} - {{autolang
-->
|(Unnamed parameter) the default value to show (when this language has not translated). It should be in English.
*{{param|1}} - {{#switch: {{intlang}}
|#default = (Unnamed parameter) the default value to show (when this language has not translated). It should be in English.
|vi=(Tham số chưa có tên) giá trị mặc định để hiển thị (nếu cải ngôn ngữ này chưa được dịch). Nó cần phải là Tiếng Anh.
|vi=(Tham số chưa có tên) giá trị mặc định để hiển thị (nếu cải ngôn ngữ này chưa được dịch). Nó cần phải là Tiếng Anh.
|zh=(未命名参数)要显示的默认值(当该语言没有翻译时)。它应该是用英语写的。}}<!--
|zh=(未命名参数)要显示的默认值(当该语言没有翻译时)。它应该是用英语写的。}}<!--


-->*{{param|<lang code>}} - {{autolang
-->
|The value should be the content of this language. See examples for details.
*{{param|<lang code>}} - {{#switch: {{intlang}}
|#default = The value should be the content of this language. See examples for details.
|vi=Giá trị phải là nội dung của ngôn ngữ này. Xem các ví dụ để biết chi tiết.
|vi=Giá trị phải là nội dung của ngôn ngữ này. Xem các ví dụ để biết chi tiết.
|zh=它的值应该是这个语言的内容。参见示例查看详情。}}<!--
|zh=它的值应该是这个语言的内容。参见示例查看详情。}}<!--


--><h3>{{autolang|Examples|vi=Ví dụ|zh=示例}}</h3>
-->
*{{param|int}} - {{#switch: {{intlang}}
|#default = The template should decide the language according to the interface language instead of page language if enbaled.
|zh=模板应根据界面语言决定语言而不是页面语言。}}
 
<h3>{{#switch: {{intlang}}|#default = Examples|vi=Ví dụ|zh=示例}}</h3>
{{ulf|en=1|de=1|ja=1|vi=1|ru=1|zh=1|old-right-align=1|transparent=1|noborder=1}}
{{ulf|en=1|de=1|ja=1|vi=1|ru=1|zh=1|old-right-align=1|transparent=1|noborder=1}}
{{autolang
{{#switch: {{intlang}}
|The buttons on the right can help you change the language of the UI easily.<br>
|#default = The buttons on the right can help you change the language of the UI easily.
|vi=Các nút bên phải có thể giúp bạn thay đổi ngôn ngữ của giao diện một cách dễ dàng.
|vi=Các nút bên phải có thể giúp bạn thay đổi ngôn ngữ của giao diện một cách dễ dàng.
|zh=右边的按钮可以帮助你更方便地切换 UI 的语言。}}<!--
|zh=右边的按钮可以帮助你更方便地切换 UI 的语言。}}<br><!--


-->
-->
{{Code|<nowiki>{{autolang|Document}}</nowiki>}} → {{autolang|Document}}<br>
{{Code|<nowiki>{{#switch: {{intlang}}|#default = Document}}</nowiki>}} → {{#switch: {{intlang}}|#default = Document}}<br>
{{Code|<nowiki>{{autolang|Document|zh=文档}}</nowiki>}} → {{autolang|Document|zh=文档}}<br>
{{Code|<nowiki>{{#switch: {{intlang}}|#default = Document|zh=文档}}</nowiki>}} → {{#switch: {{intlang}}|#default = Document|zh=文档}}<br>
{{Code|<nowiki>{{autolang|Document|ru=документ|zh=文档|de=Dokument|ja=文書|fr=Document|vi=Tài liệu}}</nowiki>}} → {{autolang|Document|ru=документ|zh=文档|de=Dokument|ja=文書|fr=Document|vi=Tài liệu}}<br>
{{Code|<nowiki>{{#switch: {{intlang}}|#default = Document|ru=документ|zh=文档|de=Dokument|ja=文書|fr=Document|vi=Tài liệu}}</nowiki>}} → {{#switch: {{intlang}}|#default = Document|ru=документ|zh=文档|de=Dokument|ja=文書|fr=Document|vi=Tài liệu}}<br>
{{CodeBlock|<nowiki>{{autolang
{{CodeBlock|<nowiki>{{#switch: {{intlang}}
| Document
| #default = Document
| ru = документ
| ru = документ
| zh = 文档
| zh = 文档
Line 42: Line 49:
| fr = Document
| fr = Document
| vi = Tài liệu
| vi = Tài liệu
}}</nowiki>}} → {{autolang
}}</nowiki>}} → {{#switch: {{intlang}}
| Document
| #default = Document
| ru = документ
| ru = документ
| zh = 文档
| zh = 文档
Line 51: Line 58:
| fr = Document
| fr = Document
| vi = Tài liệu
| vi = Tài liệu
}} ({{Autolang|Same as above, but with usage of line breaks and spacing to making it look less messy|zh=与上面一致,但使用了换行符和间距,使其看起来不那么凌乱}})<br>
}} ({{#switch: {{intlang}}|#default = Same as above, but with usage of line breaks and spacing to making it look less messy|zh=与上面一致,但使用了换行符和间距,使其看起来不那么凌乱}})<br>
<h2>{{autolang|See also|vi=Xem thêm|zh=另见}}</h2>
<h2>{{#switch: {{intlang}}|#default = See also|vi=Xem thêm|zh=另见}}</h2>
*{{tl|link=Uselangflags}}
*{{T|Uselangflags}}
*{{tl|link=uilang}}
*{{T|uilang}}
*{{tl|link=suflang}}
*{{T|suflang}}


{{Doc/Sandbox other|
{{Doc/Sandbox other|

Latest revision as of 17:58, 14 August 2024

Edit-copy.png
This is a documentation subpage for Template:Language.
Don't forget to purge the contents of the base page upon creating or editing this subpage.

This template can change the content automatically according to the language of the page or the interface. Should use with {{Uselangflags}} or {{LanguageBar}}. The documentation of the template is written by using this template.
Also, if you encounter a bug that the text is missing, use "| 1 = Text" or try to remove atleast one pipe "|" as a workaround.

Usage

Parameters

  • {{{1}}} - (Unnamed parameter) the default value to show (when this language has not translated). It should be in English.
  • {{{<lang code>}}} - The value should be the content of this language. See examples for details.
  • {{{int}}} - The template should decide the language according to the interface language instead of page language if enbaled.

Examples

English (en)Deutsch (de)日本語 (ja)Русский (ru)Tiếng Việt (vi)中文 (zh)

The buttons on the right can help you change the language of the UI easily.
{{#switch: {{intlang}}|#default = Document}} → Document
{{#switch: {{intlang}}|#default = Document|zh=文档}} → Document
{{#switch: {{intlang}}|#default = Document|ru=документ|zh=文档|de=Dokument|ja=文書|fr=Document|vi=Tài liệu}} → Document

{{#switch: {{intlang}} | #default = Document | ru = документ | zh = 文档 | hr = Dokument | de = Dokument | ja = 文書 | fr = Document | vi = Tài liệu }}

→ Document (Same as above, but with usage of line breaks and spacing to making it look less messy)

See also