模板:IPA
![]() | 此模板被引用于约51,000个页面。 为了避免造成大规模的影响,所有对此模板的编辑应先于沙盒、测试样例或您的沙盒上测试。 测试后无误的版本可以一次性地加入此模板中,但是修改前请务必于讨论页发起讨论。 模板引用数量会自动更新。 |
![]() | 此模板使用Lua语言: |
语言模板 |
---|
语言名称(ISO 639) |
|
维基词典链接 |
外语文本 |
|
其他 |
|
这个模板用于确保国际音标(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
, replacingund
(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.
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. thewrap
class is not added to spaces). If set toall
, no wrapping prevention takes place (i.e. thenowrap
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).
追踪分类
- A subcategory of Category:Pages with IPA (if this is a red link, create it with the content
{{IPA language category}}
) - Category:IPA template errors – added if more than one parameter is given and the first is an invalid language tag
- Category:Pages including recorded pronunciations – added if the transcription has audio
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.
|
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.