跳转到内容

Template:IPA/doc

维基百科,自由的百科全书

这个模板用于确保国际音标(IPA)转写的正确显示。它还可以自动提供语言标签,并链接到解释指南。根据是否提供多个未命名参数,其行为会发生显著变化。对于英语的宽式转写,请改用 {{IPAc-en}}。

用法

[编辑]

该模板的行为会根据是否提供多个未命名参数而发生显著变化。

代码 效果
{{IPA|/ˌlɔːrəm ˈɪpsəm/}}

/ˌlɔːrəm ˈɪpsəm/

{{IPA|la|ˌloːrɛm ˈɪpsʊm}}

拉丁語發音:[ˌloːrɛm ˈɪpsʊm]

基本模式

[编辑]

该模板的基本用法是将国际音标(IPA)转写作为第一个参数,例如:

代码 效果
{{IPA|/ˌlɔːrəm ˈɪpsəm/}}

/ˌlɔːrəm ˈɪpsəm/

Which might not look different from just the transcription without the template (/ˌlɔːrəm ˈɪpsəm/), but it actually outputs:

<span class="IPA nowrap" lang="und-Latn-fonipa" title="國際音標(IPA)表示法">/ˌlɔːrəm<span class="wrap"> </span>ˈɪpsəm/</span>

That is, it adds

  • the IPA class, allowing registered users to assign a typeface of their choice (see Help:IPA § Rendering issues for how);
  • an IETF language tag indicating IPA as the writing system (see Template:Lang § Rationale for more);
  • a title attribute, which appears as a tooltip when the mouse hovers over the transcription;
  • the nowrap class, preventing line wrapping at inappropriate places like after / or ˌ;
  • the wrap class to whitespace characters, allowing wrapping to occur at appropriate places.

All IPA text should be placed in the template, even if it consists entirely of ASCII characters, as in {{IPA|/mi/}}. This allows users to format all examples of IPA text consistently, and software like screen readers to interpret them accurately. If a substantial portion of a page uses IPA, post notice of that fact with {{IPA notice}}.

可选参数

[编辑]
lang
IETF language tag (e.g. ar, pt-BR) to be followed by -Latn-fonipa, replacing und (undetermined).
tooltip
Replaces the default tooltip "Representation in the International Phonetic Alphabet (IPA)". Leaving it blank means no tooltip.

Guide-linking mode

[编辑]

If more than one unnamed parameter is given, the first one is recognized as a language code and the second as the transcription. The transcription is automatically linked to one of the language-specific keys if a corresponding one exists, or to Help:IPA if not, and preceded by a label with the name of the language, as in {{langx}}. Unlike in the basic mode, brackets are automatically added so need not be included in the input.

代码 效果
{{IPA|la|ˌloːrɛm ˈɪpsʊm}}

拉丁語發音:[ˌloːrɛm ˈɪpsʊm]

{{IPA|pt-BR|sɐ̃w̃ ˈpawlu|lang|Br-SaoPaulo.ogg}}

巴西葡萄牙语:[sɐ̃w̃ ˈpawlu]

{{IPA|ki|ɣēkōjó|link=yes}}

Notice the transcriptions are linked to language-specific keys in the first two examples, and to the generic guide in the rest. The language name and article link are automatically taken from Module:Lang by passing the language tag, unless overridden in Module:IPA/data.

The behavior in this mode mimics {{IPA-xx}} templates that were created for a number of languages. {{IPA}} consolidates and replaces those templates for better maintenance and consistency.

参数

[编辑]
First unnamed parameter
IETF language tag (e.g. ar, pt-BR). See Template:Lang for more.
Second unnamed parameter
Transcription, without brackets.
Third unnamed parameter
Label code. Leave it blank to have no label at all. The label "[language name] pronunciation:" is used if the input is not empty but none of the below.
  • lang: "[language name]:"
  • ipa: "IPA:"
  • pron: "發音:"
  • also: "又作:"
  • alsolang: "[language name]又作:"
  • langalso: "[language name]又作:"
  • local: "本地發音:"
  • localpron: "本地發音:"
Fourth unnamed parameter
Name of an audio file to accompany the transcription. Ignored if |audio= is given.
label
Text that precedes the transcription. Takes precedence over the third unnamed parameter.
link
If set to yes, the language name in the label will be linked to the article about the language.
small
If set to no, the label appears in the same size as the surrounding text. Be sure to use this where the text is already smaller, per MOS:SMALLTEXT (references, infoboxes, and navboxes are excluded by default).
generic
If set to yes, the transcription is linked not to the language-specific key but to the generic Help:IPA. This is required if the transcription does not adhere to the conventions laid out in the language-specific key, such as with non-standard dialects.

List of keys

[编辑]

These are defined in Module:IPA/data.

Languages with dedicated keys
KeyLanguageCode
Help:漢志阿拉伯語國際音標Australian languagesaus
Colonia Tovar Germangct
Eastern Arrernteaer
Gheg Albanianaln
Isantts
K'iche'quc
Lacandonlac
Old Englishang
Orizaba Nahuatlnlv
Phu Thaipht
Pitjantjatjarapjt
Q'anjob'alkjb
Southern Thaisou
Standard Arabicarb
Tosk Albanianals
Walserwae
Warlpiriwbp
世界語eo
中部方言vi-VN-26
vi-VN-DN
丹麥語da
亞塞拜然語az
亞美尼亞語hy
他加祿語tl
伊努克提圖特語iu
依努庇亞克語ik
俄語ru
保加利亞語bg
倫巴第語lmo
傣仂語khb
克里米亞韃靼語crh
冰島語is
加利西亞語gl
加泰隆尼亞語ca
ca-valencia
匈牙利語hu
北部方言vi-VN-HN
北部泰語nod
南部方言vi-VN-SG
南非語af
卡拉布里亞語scn-IT-78
印地語hi
印尼語id
印度斯坦语hns
古典希臘語grc-x-classic
古典拉丁語la-x-classic
古典納瓦特爾語nci
古吉拉特語gu
古希臘語grc
史瓦濟語ss
吳語wuu
哈薩克語kk
喬治亞語ka
土庫曼語tk
土耳其語tr
坦米爾語ta
埃及阿拉伯語arz
塔吉克語tg
夏威夷語haw
奇楚瓦語qu
奧克語oc
奧里亞語or
威尼斯語vec
威爾斯語cy
孟加拉語bn
寮語lo
尼泊爾語ne
巴利語pi
巴斯克語eu
巴西葡萄牙语pt-BR
市區東挪威語no-NO-03
布列塔尼語br
希伯來語he
希臘語el
康諾特愛爾蘭語ga-IE-C
德語de-CH
de
de-AT
意第緒語yi
愛沙尼亞語et
愛爾蘭語ga
拉丁美洲西班牙語es-419
拉丁語la
拉脫維亞語lv
挪威語no
捷克語cs
提格利尼亞語ti
撣語shn
教会拉丁语la-x-church
斐濟語fj
斯洛伐克語sk
斯洛維尼亞語sl
斯瓦希里語sw
施瓦本方言swg
旁遮普語pa
日語ja
曼島語gv
柏柏爾語ber
梵語sa
標準藏語bo
歐洲葡萄牙語pt-PT
法語fr
波斯語fa
波蘭語pl
泰語th
海地克里奧爾語ht
漢志阿拉伯語acw
烏克蘭語uk
烏爾都語ur
烏茲別克語uz
現代標準漢語cmn
瑞典語sv
瑪雅語系myn
瓦斯特克纳瓦特尔语nhe
瓦隆語wa
白俄羅斯語be
皮埃蒙特语pms
盧森堡語lb
祖魯語zu
科薩語xh
科西嘉語co
突尼斯阿拉伯語aeb
立陶宛語lt
粵語yue
納瓦特爾語nah
納瓦荷語nv
緬甸語my
羅曼什語rm
羅馬尼亞語ro
義大利語it
聖經希伯來語hbo
芒斯特愛爾蘭語ga-IE-M
芬蘭瑞典語sv-FI
芬蘭語fi
英語en-US
en-GB
en
荷蘭語nl-BE
nl
菲士蘭語fy
菲律賓語fil
葡萄牙語pt
蒙古語mn
薩丁尼亞語sc
薩倫托語scn-IT-75
蘇格蘭蓋爾語gd
西班牙語es
西西里語scn
越南語vi
達利語prs
那不勒斯語nap
閩南語nan-TW
阿勒曼尼語gsw
阿姆哈拉語am
阿拉伯語ar
阿提卡希臘語grc-x-attic
阿爾巴尼亞語sq
阿爾斯特愛爾蘭語ga-x-ulster
阿薩姆語as
阿迪格語ady
韃靼語tt
韓語ko
馬來西亞語zsm
馬來語ms
馬其頓語mk
馬拉提語mr
馬拉雅拉姆語ml
馬爾他語mt
馬紹爾語mh
馬達加斯加語mg
高棉語km
黎巴嫩阿拉伯語apc-LB
Help:阿斯圖里亞斯-萊昂語國際音標Extremaduranext
Mirandesemwl
Southern Kurdishsdh
中库尔德语ckb
克羅埃西亞語hr
北库尔德语kmr
塞爾維亞-克羅埃西亞語sh
塞爾維亞語sr
庫德語ku
法兰克-普罗旺斯语frp
波斯尼亞語bs
萊昂語ast-ES-LE
蒙特內哥羅語cnr
阿斯圖里亞斯語ast
Help:IPA/Central Italian中部意大利語it-IT-55
it-IT-57
托斯卡納語it-IT-52
罗马方言it-IT-RM
Help:IPA/Colognian科隆方言ksh
Help:IPA/Emilian-RomagnolEmilianegl
Romagnolrgn
Help:IPA/Greenlandic格陵蘭語kl
Help:IPA/HmongHmonghmn
Help:IPA/Igbo伊博語ig
Help:IPA/Insular Catalan巴利阿里加泰羅尼亞語ca-ES-IB
阿爾蓋羅語ca-IT
Help:IPA/Jin Chinese晋语cjy
Help:IPA/Kyrgyz吉爾吉斯語ky
Help:IPA/Lakota拉科塔语lkt
Help:IPA/Ligurian利古里亚語lij
Help:IPA/Māori毛利語mi
Help:IPA/Mauritian Creole毛里求斯克里奥尔语mfe
Help:IPA/Pashto普什圖語ps
Help:IPA/Sorbian上索布語hsb
下索布語dsb
索布語wen
Help:IPA/SylhetiSylhetisyl
Help:IPA/Telugu泰盧固語te
Help:IPA/Xiang ChineseXiang Chinesehsn
Help:IPA/Yoruba約魯巴語yo
Help:IPA/Zhuang壯語za

Common parameters

[编辑]

These parameters can be used in either mode.

audio
Name of an audio file to accompany the transcription. Takes precedence over the fourth unnamed parameter.
wrap
If set to none, wrapping is prevented for the entire transcription (i.e. the wrap class is not added to spaces). If set to all, no wrapping prevention takes place (i.e. the nowrap class is not added to the transcription).
class
HTML class(es) added to the span element containing the transcription.
cat
If set to no, the page will not be categorized under Category:Pages with plain IPA (basic mode) or a language-specific subcategory of Category:Pages with IPA (guide-linking mode).

追踪分类

[编辑]

These are added only in Module:Category handler's default namespaces. If |debug=yes is given, the categories that would be added are shown as links, no matter the namespace. This is for testcases only.

模板数据

[编辑]
TemplateData

This template ensures proper display of transcriptions using the International Phonetic Alphabet (IPA). Its behavior changes drastically depending on whether more than one unnamed parameter is given. For dialect-neutral transcriptions of English, use IPAc-en instead.

模板参数

此模板首选参数不换行的行内格式。

参数描述类型状态
Transcription or language code1

Transcription including brackets ([...] for a phonetic transcription and /.../ for a phonemic one) if this template is being used just for formatting. IETF language tag if used for linking the transcription to a language-specific key or introductory guide.

示例值
[ɛɡzɑ̃pl], en
字符串必需
Transcription2

Without brackets.

示例值
ɛɡzɑ̃pl
字符串可选
Label code3

Replaces the default label "[language name] pronunciation:" with another canned one. Leave it blank to have no label.

推荐值
lang ipa pron also alsolang langalso local localpron
字符串可选
Audio fileaudio 4

Name of an audio file to accompany the transcription.

文件可选
Labellabel

Text that precedes the transcription. Unlike "Label code", this displays any wikitext as entered.

单行文本可选
linklink

"yes" links the language name in the label to the article about the language.

推荐值
yes
字符串可选
smallsmall

"no" cancels the reduction of the label size.

推荐值
no
字符串可选
genericgeneric

"yes" links the transcription to [[Help:IPA]] instead of a language-specific key. Required if the transcription does not adhere to the conventions of the language-specific key.

推荐值
yes
字符串可选
wrapwrap

"none" prevents wrapping anywhere in the transcription. "all" cancels the prevention of wrapping after non-space characters in the transcription.

推荐值
none all
字符串可选
classclass

Additional HTML class(es) for the transcription.

字符串可选
Language codelang

IETF language tag when the first parameter is a transcription.

示例值
en
字符串可选
Tooltiptooltip

Tooltip to replace the default one with. Leave it blank to have no tooltip.

字符串可选
catcat

"no" cancels the categorization of the page into "Pages with [language name] IPA".

推荐值
no
字符串可选

Conversion templates

[编辑]

Some language-specific templates allow you to enter ordinary letters (or conventional ASCII equivalents) in place of IPA characters, and convert them to the phonetic symbols used to transcribe the language.

Language Template Code example Result
Cantonese {{IPAc-yue}} {{IPAc-yue|h|ung|2|.|z|i|2}} [hǒŋ.tsǐː]
Hungarian {{IPAc-hu}} {{IPAc-hu|'|m|a|gy|a|r}} [ˈmɒɟɒr]
Mandarin {{IPAc-cmn}} {{IPAc-cmn|zh|ong|1|h|ua|2}} [tʂʊ́ŋxwǎ]
Polish {{IPAc-pl}} {{IPAc-pl|'|sz|cz|e|ć|i|n}} [ˈʂt​͡ʂɛt​͡ɕin]

Some other conversion templates have also been created (see list at Special:PrefixIndex/Template:IPAc-), but they haven't been vetted by the community and may not produce output complying with the respective keys.

参见

[编辑]