跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
最近更改
随机页面
MediaWiki帮助
代码酷
搜索
搜索
中文(中国大陆)
外观
创建账号
登录
个人工具
创建账号
登录
未登录编辑者的页面
了解详情
贡献
讨论
编辑“︁
模板:Lang/doc
”︁(章节)
模板
讨论
大陆简体
阅读
编辑源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
编辑源代码
查看历史
常规
链入页面
相关更改
特殊页面
页面信息
外观
移至侧栏
隐藏
警告:
您没有登录。如果您进行任何编辑,您的IP地址会公开展示。如果您
登录
或
创建账号
,您的编辑会以您的用户名署名,此外还有其他益处。
反垃圾检查。
不要
加入这个!
== Syntax and usage == {{in5}}{{tlx|lang|{{var|language tag}}|{{var|text}}}} The {{var|language tag}} should consist of an [[ISO-639]] language code. See the [[List of ISO 639-1 codes|list of ISO 639-1 codes]] for two-letter codes; if you don't find the language you seek, then refer to the [[List of ISO 639-3 codes|list of ISO 639-3 codes]]. The template also supports properly formatted [[IETF language tag]]s using subtags that identify the language's script, region, and/or variant. The ISO 639 language code is a two- or three-letter abbreviation, in lowercase, of the language's name. French, for example, has the code <code>fr</code>: * <code><nowiki>She said: "{{lang|fr|Je suis française.}}"</nowiki></code> → She said: "{{lang|fr|Je suis française.}}" Because all languages represented by two-letter codes in [[ISO 639-1]] can also be represented by their three-letter equivalents in [[ISO 639-2]] and above, it is recommended to use the shortest language tag possible that sufficiently describes the target language.<ref>[https://www.w3.org/International/articles/language-tags/index.en "Language tags in HTML and XML"] at [[World Wide Web Consortium]]</ref> So while French could be represented by ISO 639-2's <code>fra</code> code, use the ISO 639-1 code <code>fr</code> instead. Likewise, script, region, and variant information should be included only when they provide a necessary distinction. For an up-to-date list of available language, script, region, and variant codes, please refer to the [[Internet Assigned Numbers Authority|IANA]]'s [http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry language subtag registry]. By default, this template will place articles into the relevant subcategory of {{category link|Articles containing non-English-language text}}. To suppress this – e.g. when using {{tlf|lang}} within a [[Help:Link#Wikilinks|wikilink]] or the ''title'' parameter of a citation – add the parameter {{para|cat|no}}. === Formatting === ==== Automatic italics ==== {{tld|lang}} automatically applies italic styling <span style="font-weight: normal;">when the text in {{param|2}} is written entirely in the <code>Latn</code> script (the Latin alphabet and its extensions), either when that is the default encoding for the language or when it is triggered by a <code>{{var|xx}}-Latn</code> language code{{colon}}</span> * <syntaxhighlight lang="wikitext" inline>{{lang|fr|Je suis française.}}</syntaxhighlight> → {{lang|fr|Je suis française.}} * <syntaxhighlight lang="wikitext" inline>''{{lang|fr|Je suis française.}}''</syntaxhighlight> → ''{{lang|fr|Je suis française.}}'' – external markup is ignored * <syntaxhighlight lang="wikitext" inline>{{lang|he-Latn|la'az}} ({{lang|he|לעז}})</syntaxhighlight> → {{lang|he-Latn|la'az}} ({{lang|he|לעז}}) * <code><nowiki>''{{lang|he-Latn|la'az}}''</nowiki> ({{!mxt|<nowiki>''{{lang|he|לעז}}''</nowiki>}})</code> → ''{{lang|he-Latn|la'az}}'' ({{!mxt|''{{lang|he|לעז}}''}}) – external markup is ignored around the <code>he-Latn</code> text, but will incorrectly italicize the Hebrew-character material. When <code>Latn</code> script should not be italicized, there are multiple approaches{{colon}} {{para|italic|no}} <span style="font-weight: normal;">– renders {{param|2}} in upright font; italic markup around the template is ignored; italic markup inside the template causes an error message{{colon}}</span> * <syntaxhighlight lang="wikitext" inline>{{lang|fr|Je suis française.|italic=no}}</syntaxhighlight> → {{lang|fr|Je suis française.|italic=no}} * <syntaxhighlight lang="wikitext" inline>''{{lang|fr|Je suis française.|italic=no}}''</syntaxhighlight> → ''{{lang|fr|Je suis française.|italic=no}}'' * <syntaxhighlight lang="wikitext" inline>''{{lang|fr|Je suis ''française''.|italic=no}}''</syntaxhighlight> → ''{{lang|fr|Je suis ''française''.|italic=no|cat=no}}'' – italic markup in conflict with {{para|italic|no}} {{para|italic|unset}} <span style="font-weight: normal;">– disables template-provided styling; {{param|2}} is styled according to external or internal wiki markup{{colon}}</span> * <syntaxhighlight lang="wikitext" inline>{{lang|fr|Je suis française.|italic=unset}}</syntaxhighlight> → {{lang|fr|Je suis française.|italic=unset}} * <syntaxhighlight lang="wikitext" inline>''{{lang|fr|Je suis française.|italic=unset}}''</syntaxhighlight> → ''{{lang|fr|Je suis française.|italic=unset}}'' * <syntaxhighlight lang="wikitext" inline>{{lang|fr|''Je suis'' English.|italic=unset}}</syntaxhighlight> → {{lang|fr|''Je suis'' English.|italic=unset}} {{tlx|noitalic}} <span style="font-weight: normal;">can also be used{{colon}}</span> * <syntaxhighlight lang="wikitext" inline>{{lang|fr|Je suis {{noitalic|English}}.}}</syntaxhighlight> → {{lang|fr|Je suis {{noitalic|English}}.}} {{hatnote|{{crossreference|See table "[[#italic parameter|lang {{!}}italic{{=}} parameter operation]]".}}}} ==== Prefixed language template ==== There is a version of this template, {{tl|langx}}, which is intended to be used the first time a language appears in an article. These templates will print the language's name and, when appropriate, italicize their content: * <syntaxhighlight lang="wikitext" inline>A '''kremlin''' ({{langx|ru|кремль}}, 'castle') is a major fortified central complex ...</syntaxhighlight> → A '''kremlin''' ({{langx|ru|кремль}}, 'castle') is a major fortified central complex ... While the {{tnull|langx}} template outputs text in italics for languages with Latin-based scripts, if plain text is required, such as for proper names, {{para|italic|no}} or {{tlx|noitalic}} may be used: * <syntaxhighlight lang="wikitext" inline>the border town of Ventimiglia ({{langx|fr|Vintimille}})</syntaxhighlight> → the border town of Ventimiglia ({{langx|fr|Vintimille}}) * <syntaxhighlight lang="wikitext" inline>the border town of Ventimiglia ({{langx|fr|italic=no|Vintimille}})</syntaxhighlight> → the border town of Ventimiglia ({{langx|fr|italic=no|Vintimille}}) * <syntaxhighlight lang="wikitext" inline>the border town of Ventimiglia ({{langx|fr|{{noitalic|Vintimille}}}})</syntaxhighlight> → the border town of Ventimiglia ({{langx|fr|{{noitalic|Vintimille}}}}) When formatting foreign-language text to match style guidelines, it is best to exclude the styling markup from the template, so that any extraneous markup which is not from the foreign language does not receive incorrect metadata for that language. This includes: English-language quotation marks around titles of works in languages that use other quotation character glyphs; italicization of titles in languages which do not use that convention; and emphasis that is not found (in one style or another) in the original foreign text; among other cases. If in doubt, put such markup outside the template when possible. {{See also|Wikipedia:Manual of Style/Text formatting#Foreign terms}} ==== Proto-languages ==== * {{tlx|lang|cel-x-proto|kal-|_show_result=yes}} * {{tlx|lang|cel-x-proto|kal-|proto{{=}}no|_show_result=yes}} * {{tlx|langx|cel-x-proto|kal-|_show_result=yes}} * {{tlx|langx|cel-x-proto|kal-|proto{{=}}no|_show_result=yes}} * {{tlx|lang|en|accidently|_show_result=yes}} * {{tlx|lang|en|accidently|proto{{=}}yes|_show_result=yes}} === Right-to-left languages === To embed a string of right-to-left text (such as [[Arabic]] or [[Hebrew language|Hebrew]]) within the usual left-to-right context, {{para|rtl|yes}} should be added to correctly communicate writing direction. To mark a whole paragraph of right-to-left text, {{tl|rtl-para}} should be used instead. Any of these approaches will wrap the text in a container with the <code>dir="rtl"</code> attribute. In order to ensure correct rendering in browsers that do not fully support [[HTML5]] [[bidirectional text|bidirectional isolation]], a [[left-to-right mark]] is also added to the end of the text (see the [http://www.w3.org/International/articles/inline-bidi-markup W3C] for details). Note that text direction does not need to be specified when using the {{tnull|lang-{{var|xx}}}} templates, as this is implied by the template's language.
摘要:
请注意,所有对代码酷的贡献均被视为依照知识共享署名-非商业性使用-相同方式共享发表(详情请见
代码酷:著作权
)。如果您不希望您的文字作品被随意编辑和分发传播,请不要在此提交。
您同时也向我们承诺,您提交的内容为您自己所创作,或是复制自公共领域或类似自由来源。
未经许可,请勿提交受著作权保护的作品!
取消
编辑帮助
(在新窗口中打开)