跳转到内容

模板: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-DN
vi-VN-26
丹麦语da
亚美尼亚语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
奥地利德语de-AT
奥里亚语or
威尼斯语vec
威尔士语cy
孟加拉语bn
老挝语lo
尼泊尔语ne
巴利语pi
巴斯克语eu
巴西葡萄牙语pt-BR
市区东挪威语no-NO-03
布列塔尼语br
希伯来语he
希腊语el
康诺特爱尔兰语ga-IE-C
德语de
de-CH
意第绪语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
美国英语en-US
意大利语it
圣经希伯来语hbo
芒斯特爱尔兰语ga-IE-M
芬兰瑞典语sv-FI
芬兰语fi
英国英语en-GB
英语en
荷兰语nl
nl-BE
菲士兰语fy
菲律宾语fil
葡萄牙语pt
蒙古语mn
萨丁尼亚语sc
萨伦托语scn-IT-75
苏格兰盖尔语gd
西班牙语es
西西里语scn
越南语vi
达里语prs
那不勒斯语nap
闽南语nan-TW
阿勒曼尼语gsw
阿塞拜疆语az
阿姆哈拉语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
Southern Kurdishsdh
中库尔德语ckb
克罗地亚语hr
北库尔德语kmr
塞尔维亚-克罗地亚语sh
塞尔维亚语sr
库尔德语ku
法兰克-普罗旺斯语frp
波斯尼亚语bs
米兰达语mwl
莱昂语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.

参见

[编辑]