模板:Native name

模板頁面
文檔圖示 模板文件[檢視] [編輯] [查看歷史] [清除快取]

模板介紹

Convenience template to indicate what language a native name of a place (like that of a country or town) belongs to, appending the language name in an icon. Uses 模板連結:{{lang}} and 模板連結:{{language icon}}. It makes the native name appear in italics by default, although this can be overridden, as can the language icon be excluded. Therefore, the template may make no visible changes to the text, but it does add a span tag with language attributes around the native name to the page's source code, which can help web browsers choose the right font, screen readers use the right pronunciation and more.

使用方法

{{native name|language tag|text[|icon=no][|italic=no]}}
('[...]' means 'optional', do not include the square brackets when using this template)

where

  • language tag is the code for the native language (see the list of ISO 639 codes);
  • text is the native name;
  • icon is an optional parameter to exclude the language icon by setting the value to "no";
  • italic is an optional parameter to prevent the name from appearing in italics by setting the value to "no".

範例

{{Infobox settlement
 |name=The Hague
 |native_name={{native name|nl|Den Haag}}
}}

results in

The Hague
Den Haag荷蘭語

while

{{Infobox settlement
 |name=French Republic
 |native_name={{native name|fr|République française|icon=no}}
}}

results in

French Republic
République française

 

注意事項

When both the icon and italic parameters are set to "no" this template is equivalent to the 模板連結:{{lang}} template.

參見

給模板編輯者的說明

模板結構

實現方法

編輯注意

上述文檔內容嵌入自Template:Native name/doc編輯 | 歷史
編者可以在本模板的沙盒創建 | 鏡像和測試樣例創建頁面進行實驗。
請將模板自身所屬的分類添加在文檔中。本模板的子頁面