Difference between revisions of "Template:Lang/doc"

From Moegirlpedia
Jump to: navigation, search
m (Meaning of the template: Additions)
 
(3 intermediate revisions by the same user not shown)
Line 10: Line 10:
 
* <code><nowiki>{{</nowiki>lang|ja|蓬莱山輝夜}}</code> → {{lang|ja|蓬莱山輝夜}}
 
* <code><nowiki>{{</nowiki>lang|ja|蓬莱山輝夜}}</code> → {{lang|ja|蓬莱山輝夜}}
  
== Template data ==
+
==Meaning of the template==
<templatedata>
+
The same word or character has different fonts in different countries and regions. Expecially in Chinese character culture circle of East Asia for the following example.
{
+
* If you see that the glyphs of the same line of words in the following example are exactly the same, your browser version might be too old. <del>Or the default font compatibility of the website is poor.</del>
"params": {
+
{| class="wikitable" style="text-align:center"
"1": {
+
!width="20%"| General meaning of the character
"label": "Language tag",
+
!width="20%"| Chinese Simplify (Mainland China)
"description": "A language tag, or an ISO 639 language code.",
+
!width="20%"| Chinese Traditional (Taiwan)
"example": "ja",
+
!width="20%"| Japanese
"type": "string",
+
!width="20%"| Korean
"required": true
+
|-style="font-size:1.5em"
},
+
| [https://hanziyuan.net/#骨 bone] ||{{Lang|zh-CN|骨}} || {{Lang|zh-TW|骨}} || {{Lang|ja|骨}} || {{Lang|ko|骨}}
"2": {
+
|-style="font-size:1.5em"
"label": "Text",
+
| [https://hanziyuan.net/#送 send] ||{{Lang|zh-CN|送}} || {{Lang|zh-TW|送}} || {{Lang|ja|送}} || {{Lang|ko|送}}
"description": "The text belonging to the language specified.",
+
|-style="font-size:1.5em"
"type": "string",
+
| [https://hanziyuan.net/#耀 shine] ||{{Lang|zh-CN|耀}} || {{Lang|zh-TW|耀}} || {{Lang|ja|耀}} || {{Lang|ko|耀}}
"required": true,
+
|}
"example": "蓬莱山輝夜"
+
 
}
+
==Common language code list==
},
+
*<span style="color: #C00000;">'''ATTENTION''': Standard ISO 639-3 is incompatible with some fonts, please use it with caution.</span>
"description": "Indicate that a given span of text belongs to a particular language. Allows browsers to correctly present and pronounce foreign languages."
+
<div style="display:flex; column-gap: .5em;">
}
+
{| class="wikitable" style="text-align: center;"
</templatedata>
+
!width="50%" rowspan="2"| Names of languages and their variants
 +
!width="50%" colspan="2"| Language code
 +
|-
 +
! ISO 639-1 !! ISO 639-3
 +
|-
 +
| [[wikipedia:Chinese language|Chinese]] || <code>zh</code> || <code>zho</code>
 +
|-
 +
| [[wikipedia:Simplified Chinese characters|Simplified Chinese]] || <code>zh-Hans</code> || <code>zho-Hans</code>
 +
|-
 +
| [[wikipedia:Traditional Chinese characters|Traditional Chinese]] || <code>zh-Hant</code> || <code>zho-Hant</code>
 +
|-
 +
| [[wikipedia:Simplified Chinese characters|Chinese (Mainland China)]] || <code>zh-CN</code> || <code>zho-CN</code>
 +
|-
 +
| [[wikipedia:Traditional Chinese characters|Chinese (Taiwan)]] || <code>zh-TW</code> || <code>zho-TW</code>
 +
|-
 +
| [[wikipedia:Traditional Chinese characters|Chinese (Hong Kong)]] || <code>zh-HK</code> || <code>zho-HK</code>
 +
|-
 +
| [[wikipedia:English language|English]] || <code>en</code> || <code>eng</code>
 +
|-
 +
| [[wikipedia:Zhuang languages|Chuang (Zhuang)]] || <code>za</code> || <code>zha</code>
 +
|-
 +
| [[wikipedia:Tibetic languages|Tibetan]] || <code>bo</code> || <code>bod</code>
 +
|-
 +
| [[wikipedia:Mongolian language|Mongolian]] || <code>mn</code> || <code>mon</code>
 +
|-
 +
| [[wikipedia:Uyghur language|Uyghur]] || <code>ug</code> || <code>uig</code>
 +
|-
 +
| [[wikipedia:Yue Chinese|Yue Chinese (Cantonese)]] || - || <code>yue</code>
 +
|-
 +
| [[wikipedia:Korean language|Korean]] || <code>ko</code> || <code>kor</code>
 +
|-
 +
| [[wikipedia:Japanese language|Japanese]] || <code>ja</code> || <code>jpn</code>
 +
|-
 +
| [[wikipedia:Thai language|Thai]] || <code>th</code> || <code>tha</code>
 +
|-
 +
| [[wikipedia:Arabic|Arabic]] || <code>ar</code> || <code>ara</code>
 +
|-
 +
| [[wikipedia:Hindi|Hindi]] || <code>hi</code> || <code>hin</code>
 +
|}
 +
{| class="wikitable" style="text-align: center;"
 +
!width="50%" rowspan="2"| Names of languages and their variants
 +
!width="50%" colspan="2"| Language code
 +
|-
 +
! ISO 639-1 !! ISO 639-3
 +
|-
 +
| [[wikipedia:Indonesian language|Indonesian]] || <code>id</code> || <code>ind</code>
 +
|-
 +
| [[wikipedia:Russian language|Russian]] || <code>ru</code> || <code>rus</code>
 +
|-
 +
| [[wikipedia:Spanish language|Spanish]] || <code>es</code> || <code>spa</code>
 +
|-
 +
| [[wikipedia:Portuguese language|Portuguese]] || <code>pt</code> || <code>por</code>
 +
|-
 +
| [[wikipedia:French language|French]] || <code>fr</code> || <code>fra</code>
 +
|-
 +
| [[wikipedia:German language|German]] || <code>de</code> || <code>deu</code>
 +
|-
 +
| [[wikipedia:Italian language|Italian]] || <code>it</code> || <code>ita</code>
 +
|-
 +
| [[wikipedia:Polish language|Polish]] || <code>pl</code> || <code>pol</code>
 +
|-
 +
| [[wikipedia:Ukrainian language|Ukrainian]] || <code>uk</code> || <code>ukr</code>
 +
|-
 +
| [[wikipedia:Turkish language|Turkish]] || <code>tr</code> || <code>tur</code>
 +
|-
 +
| [[wikipedia:Serbian language|Serbian]] || <code>sr</code> || <code>srp</code>
 +
|-
 +
| [[wikipedia:Danish language|Danish]] || <code>da</code> || <code>dan</code>
 +
|-
 +
| [[wikipedia:Sanskrit|Sanskrit]] || <code>sa</code> || <code>san</code>
 +
|-
 +
| [[wikipedia:Siddhaṃ|Siddhaṃ script]] || <code>sa-Sidd</code> || <code>san-Sidd</code>
 +
|-
 +
| [[wikipedia:Greek language|Greek]] || <code>el</code> || <code>ell</code>
 +
|-
 +
| [[wikipedia:Ancient Greek|Ancient Greek (to 1453)]] || - || <code>grc</code>
 +
|-
 +
| [[wikipedia:Latin|Latin]] || <code>la</code> || <code>lat</code>
 +
|}
 +
</div>
 +
* For more language code, you can go to [[wikipedia:ISO 639|Wikipedia]] or [https://iso639-3.sil.org/code_tables/639/data SIL International] to search for.
 +
 
 
<includeonly>[[Category:Language templates]]</includeonly>
 
<includeonly>[[Category:Language templates]]</includeonly>

Latest revision as of 12:45, 11 September 2021

The purpose of this template is to indicate that a span of text belongs to a particular language.

Usage

{{lang|language tag|text}}

The language tag should consist of an ISO 639 language code.

The ISO 639 language code is a two- or three-letter abbreviation, in lowercase, of the language's name. Japanese, for example, has the code ja:

  • {{lang|ja|蓬莱山輝夜}}蓬莱山輝夜

Meaning of the template

The same word or character has different fonts in different countries and regions. Expecially in Chinese character culture circle of East Asia for the following example.

  • If you see that the glyphs of the same line of words in the following example are exactly the same, your browser version might be too old. Or the default font compatibility of the website is poor.
General meaning of the character Chinese Simplify (Mainland China) Chinese Traditional (Taiwan) Japanese Korean
bone
send
shine 耀 耀 耀 耀

Common language code list

  • ATTENTION: Standard ISO 639-3 is incompatible with some fonts, please use it with caution.
Names of languages and their variants Language code
ISO 639-1 ISO 639-3
Chinese zh zho
Simplified Chinese zh-Hans zho-Hans
Traditional Chinese zh-Hant zho-Hant
Chinese (Mainland China) zh-CN zho-CN
Chinese (Taiwan) zh-TW zho-TW
Chinese (Hong Kong) zh-HK zho-HK
English en eng
Chuang (Zhuang) za zha
Tibetan bo bod
Mongolian mn mon
Uyghur ug uig
Yue Chinese (Cantonese) - yue
Korean ko kor
Japanese ja jpn
Thai th tha
Arabic ar ara
Hindi hi hin
Names of languages and their variants Language code
ISO 639-1 ISO 639-3
Indonesian id ind
Russian ru rus
Spanish es spa
Portuguese pt por
French fr fra
German de deu
Italian it ita
Polish pl pol
Ukrainian uk ukr
Turkish tr tur
Serbian sr srp
Danish da dan
Sanskrit sa san
Siddhaṃ script sa-Sidd san-Sidd
Greek el ell
Ancient Greek (to 1453) - grc
Latin la lat