模板:IPA/doc

出自Local Chinese Wikipedia
跳至導覽 跳至搜尋

頁面Module:Message box/mbox.css沒有內容。

頁面Module:Message box/mbox.css沒有內容。

頁面Module:Message box/mbox.css沒有內容。

Template:Language templates 這個模板用於確保國際音標(IPA)轉寫的正確顯示。它還可以自動提供語言標籤,並鏈接到解釋指南。根據是否提供多個未命名參數,其行為會發生顯著變化。對於英語的寬式轉寫,請改用 {{IPAc-en}}。

用法[編輯]

該模板的行為會根據是否提供多個未命名參數而發生顯著變化。

頁面Template:Markup/styles.css沒有內容。

原始碼 效果Lua錯誤:expandTemplate: template "format item" does not exist。

基本模式[編輯]

該模板的基本用法是將國際音標(IPA)轉寫作為第一個參數,例如:

頁面Template:Markup/styles.css沒有內容。

原始碼 效果Lua錯誤:expandTemplate: template "format item" does not exist。

這看起來可能和沒有模板的轉寫(/ˌlɔːrəm ˈɪpsəm/)沒什麼區別,但實際上會輸出:

<strong class="error"><span class="scribunto-error mw-scribunto-error-b6308dd7">package.lua第80行Lua错误:module &#039;Module:IPA/config&#039; not found</span></strong>

即,會添加

  • 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}}.

可選參數[編輯]

頁面Module:Hatnote/styles.css沒有內容。

lang
IETF語言標籤 (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.

頁面Template:Markup/styles.css沒有內容。

原始碼 效果Lua錯誤:expandTemplate: template "format item" does not exist。

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.

參數[編輯]

頁面Module:Hatnote/styles.css沒有內容。

First unnamed parameter
IETF語言標籤 (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:SMALL (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.

腳本錯誤:沒有「IPA/overview」這個模塊。

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:含有純國際音標的頁面 (basic mode) or a language-specific subcategory of Category:含有國際音標的頁面 (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.

模板數據[編輯]

頁面Template:Collapse top/styles.css沒有內容。

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.

參見[編輯]

package.lua第80行Lua錯誤:module 'Module:Navbar/configuration' not found