Template:IPA/doc

From the AARoads Wiki: Read about the road before you go
Jump to navigation Jump to search

This template ensures proper display of a transcription in the International Phonetic Alphabet (IPA). It can also automatically provide a label indicating the language being transcribed and link to an explanatory guide. Its behavior changes drastically depending on whether more than one unnamed parameter is given. For broad transcriptions of English, use {{IPAc-en}} instead.

Usage

The behavior of this template changes drastically depending on whether more than one unnamed parameter is given.

Markup Renders as
{{IPA|/ˌlɔːrəm ˈɪpsəm/}}

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

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

Latin pronunciation: [ˌloːrɛm ˈɪpsʊm]

Basic mode

The basic usage of this template is just to pass an IPA transcription as the first argument, as in:

Markup Renders as
{{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="Representation in the International Phonetic Alphabet (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 w: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}}.

Optional parameters

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 corrseponding one exists, or to Help:IPA if not, and preceded by a label with the name of the language, as in {{lang-xx}}. Unlike in the basic mode, brackets are automatically added so need not be included in the input.

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

Latin pronunciation: [ˌloːrɛm ˈɪpsʊm]

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

Brazilian Portuguese: [sɐ̃w̃ ˈpawlu] <phonos file="Br-SaoPaulo.ogg"></phonos>

{{IPA|ki|ɣēkōjó}}

Gikuyu pronunciation: [ɣēkōjó]

{{IPA|und|ʔ|}}

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:Language 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 those templates for better maintenance and consistency, and is now the recommended template.

Parameters

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: "pronounced"
  • also: "also"
  • alsolang: "also [language name]:"
  • langalso: "[language name] also"
  • local: "locally"
  • localpron: "local pronunciation:"
Fourth unnamed parameter
Name of an audio file to accompany the transcription.
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.

List of keys

These are defined in Module:IPA/data.

Languages with dedicated keys
KeyLanguageCode
w:Help:IPA/AdygheAdygheady
w:Help:IPA/AfrikaansAfrikaansaf
w:Help:IPA/AlbanianAlbaniansq
Gheg Albanianaln
Tosk Albanianals
w:Help:IPA/Alemannic GermanAlemannic Germangsw
Colonia Tovar Germangct
Swabianswg
Walserwae
w:Help:IPA/AmharicAmharicam
w:Help:IPA/ArabicArabicar
w:Help:IPA/ArmenianArmenianhy
w:Help:IPA/AssameseAssameseas
w:Help:IPA/Astur-LeoneseAsturianast
Extremaduranext
Leoneseast-ES-LE
Mirandesemwl
w:Help:IPA/Australian languagesAustralian languagesaus
Eastern Arrernteaer
Pitjantjatjarapjt
Warlpiriwbp
w:Help:IPA/AzerbaijaniAzerbaijaniaz
w:Help:IPA/BasqueBasqueeu
w:Help:IPA/BelarusianBelarusianbe
w:Help:IPA/BengaliBengalibn
w:Help:IPA/BerberBerber languagesber
w:Help:IPA/BretonBretonbr
w:Help:IPA/BulgarianBulgarianbg
w:Help:IPA/BurmeseBurmesemy
w:Help:IPA/CantoneseCantoneseyue
w:Help:IPA/CatalanCatalanca
Valencianca-valencia
w:Help:IPA/Central ItalianCentral Italianit-IT-55
it-IT-57
Romanescoit-IT-RM
Tuscanit-IT-52
w:Help:IPA/ColognianColognianksh
w:Help:IPA/CorsicanCorsicanco
w:Help:IPA/CzechCzechcs
w:Help:IPA/DanishDanishda
w:Help:IPA/DutchDutchnl
Flemishnl-BE
w:Help:IPA/Egyptian ArabicEgyptian Arabicarz
w:Help:IPA/Emilian-RomagnolEmilianegl
Romagnolrgn
w:Help:IPA/EnglishEnglishen
American Englishen-US
British Englishen-GB
w:Help:IPA/EsperantoEsperantoeo
w:Help:IPA/EstonianEstonianet
w:Help:IPA/FijianFijianfj
w:Help:IPA/FinnishFinnishfi
w:Help:IPA/Franco-ProvençalFranco-Provençalfrp
w:Help:IPA/FrenchFrenchfr
w:Help:IPA/GalicianGaliciangl
w:Help:IPA/GeorgianGeorgianka
w:Help:IPA/GreekGreekel
Ancient Greekgrc
Attic Greekgrc-x-attic
Classical Greekgrc-x-classic
w:Help:IPA/GreenlandicGreenlandickl
w:Help:IPA/GujaratiGujaratigu
w:Help:IPA/Haitian CreoleHaitian Creoleht
w:Help:IPA/HawaiianHawaiianhaw
w:Help:IPA/HebrewHebrewhe
Biblical Hebrewhbo
w:Help:IPA/Hejazi ArabicHejazi Arabicacw
w:Help:IPA/Hindi and UrduHindihi
Hindustanihns
Urduur
w:Help:IPA/HmongHmonghmn
w:Help:IPA/HungarianHungarianhu
w:Help:IPA/IcelandicIcelandicis
w:Help:IPA/IgboIgboig
w:Help:IPA/Insular CatalanAlghereseca-IT
Balearic Catalanca-ES-IB
w:Help:IPA/InuktitutInuktitutiu
w:Help:IPA/InupiaqInupiaqik
w:Help:IPA/IrishIrishga
Connacht Irishga-IE-C
Munster Irishga-IE-M
Ulster Irishga-x-ulster
w:Help:IPA/ItalianItalianit
w:Help:IPA/JapaneseJapaneseja
w:Help:IPA/Jin ChineseJin Chinesecjy
w:Help:IPA/KazakhKazakhkk
w:Help:IPA/KhmerKhmerkm
w:Help:IPA/KoreanKoreanko
w:Help:IPA/KurdishKurdishku
Central Kurdishckb
Northern Kurdishkmr
Southern Kurdishsdh
w:Help:IPA/KyrgyzKyrgyzky
w:Help:IPA/LakotaLakotalkt
w:Help:IPA/LaoLaolo
Isantts
Phu Thaipht
w:Help:IPA/LatinLatinla
Classical Latinla-x-classic
Ecclesiastical Latinla-x-church
w:Help:IPA/LatvianLatvianlv
w:Help:IPA/Lebanese ArabicLebanese Arabicapc-LB
w:Help:IPA/LigurianLigurianlij
w:Help:IPA/LithuanianLithuanianlt
w:Help:IPA/LombardLombardlmo
w:Help:IPA/LuxembourgishLuxembourgishlb
w:Help:IPA/MacedonianMacedonianmk
w:Help:IPA/MalagasyMalagasymg
w:Help:IPA/MalayMalayms
Indonesianid
Malaysianzsm
w:Help:IPA/MalayalamMalayalamml
w:Help:IPA/MalteseMaltesemt
w:Help:IPA/MandarinMandarincmn
w:Help:IPA/ManxManxgv
w:Help:IPA/MāoriMāorimi
w:Help:IPA/MarathiMarathimr
w:Help:IPA/MarshalleseMarshallesemh
w:Help:IPA/Mauritian CreoleMauritian Creolemfe
w:Help:IPA/MayanMayan languagesmyn
w:Help:IPA/MongolianMongolianmn
w:Help:IPA/NahuatlNahuatl languagesnah
Classical Nahuatlnci
Huasteca Nahuatlnhe
Orizaba Nahuatlnlv
w:Help:IPA/NavajoNavajonv
w:Help:IPA/NeapolitanNeapolitannap
w:Help:IPA/NepaliNepaline
w:Help:IPA/NguniSwaziss
Xhosaxh
Zuluzu
w:Help:IPA/Northern ThaiNorthern Thainod
w:Help:IPA/NorwegianNorwegianno
Urban East Norwegianno-NO-03
w:Help:IPA/OccitanOccitanoc
w:Help:IPA/OdiaOdiaor
w:Help:IPA/Old EnglishOld Englishang
w:Help:IPA/PersianPersianfa
Dariprs
Tajiktg
w:Help:IPA/PiedmontesePiedmontesepms
w:Help:IPA/PolishPolishpl
w:Help:IPA/PortuguesePortuguesept
Brazilian Portuguesept-BR
European Portuguesept-PT
w:Help:IPA/PunjabiPunjabipa
w:Help:IPA/QuechuaQuechuaqu
w:Help:IPA/RomanianRomanianro
w:Help:IPA/RomanshRomanshrm
w:Help:IPA/RussianRussianru
w:Help:IPA/SanskritSanskritsa
Palipi
w:Help:IPA/SardinianSardiniansc
w:Help:IPA/Scottish GaelicScottish Gaelicgd
w:Help:IPA/Serbo-CroatianSerbo-Croatiansh
Bosnianbs
Croatianhr
Montenegrincnr
Serbiansr
w:Help:IPA/Shan and Tai LueShanshn
Tai Luekhb
w:Help:IPA/SicilianSicilianscn
Calabrianscn-IT-78
Salentinoscn-IT-75
w:Help:IPA/SlovakSlovaksk
w:Help:IPA/SloveneSlovenesl
w:Help:IPA/SorbianSorbian languageswen
Lower Sorbiandsb
Upper Sorbianhsb
w:Help:IPA/SpanishSpanishes
Latin American Spanishes-419
w:Help:IPA/Standard GermanGermande
Austrian Germande-AT
Swiss Standard Germande-CH
w:Help:IPA/SwahiliSwahilisw
w:Help:IPA/SwedishSwedishsv
Finland Swedishsv-FI
w:Help:IPA/SylhetiSylhetisyl
w:Help:IPA/TagalogTagalogtl
Filipinofil
w:Help:IPA/Taiwanese HokkienTaiwanese Hokkiennan-TW
w:Help:IPA/TamilTamilta
w:Help:IPA/TatarTatartt
Crimean Tatarcrh
w:Help:IPA/TeluguTelugute
w:Help:IPA/ThaiThaith
Southern Thaisou
w:Help:IPA/TibetanStandard Tibetanbo
w:Help:IPA/TigrinyaTigrinyati
w:Help:IPA/Tunisian ArabicTunisian Arabicaeb
w:Help:IPA/TurkishTurkishtr
w:Help:IPA/TurkmenTurkmentk
w:Help:IPA/UkrainianUkrainianuk
w:Help:IPA/UzbekUzbekuz
w:Help:IPA/VenetianVenetianvec
w:Help:IPA/VietnameseVietnamesevi
w:Help:IPA/WalloonWalloonwa
w:Help:IPA/WelshWelshcy
w:Help:IPA/West FrisianWest Frisianfy
w:Help:IPA/Wu ChineseWu Chinesewuu
w:Help:IPA/Xiang ChineseXiang Chinesehsn
w:Help:IPA/YiddishYiddishyi
w:Help:IPA/YorubaYorubayo
w:Help:IPA/ZhuangZhuangza

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).

Tracking categories

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

TemplateData

<templatedata>{ "description": "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.", "params": { "1": { "label": "Transcription or language code", "description": "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.", "type": "string", "required": true, "example": "[ɛɡzɑ̃pl], en" }, "2": { "label": "Transcription", "description": "Without brackets.", "example": "ɛɡzɑ̃pl", "type": "string" }, "3": { "label": "Label code", "description": "Replaces the default label \"[language name] pronunciation:\" with another canned one. Leave it blank to have no label.", "type": "string", "suggestedvalues": [ "lang", "ipa", "pron", "also", "alsolang", "langalso", "local", "localpron" ] }, "audio": { "aliases": [ "4" ], "label": "Audio file", "description": "Name of an audio file to accompany the transcription.", "type": "wiki-file-name" }, "label": { "label": "Label", "description": "Text that precedes the transcription. Unlike \"Label code\", this displays any wikitext as entered.", "type": "line" }, "link": { "description": "\"yes\" links the language name in the label to the article about the language.", "type": "string", "suggestedvalues": [ "yes" ] }, "small": { "description": "\"no\" cancels the reduction of the label size.", "type": "string", "suggestedvalues": [ "no" ] }, "generic": { "description": "\"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.", "type": "string", "suggestedvalues": [ "yes" ] }, "wrap": { "description": "\"none\" prevents wrapping anywhere in the transcription. \"all\" cancels the prevention of wrapping after non-space characters in the transcription.", "type": "string", "suggestedvalues": [ "none", "all" ] }, "class": { "description": "Additional HTML class(es) for the transcription.", "type": "string" }, "lang": { "label": "Language code", "description": "IETF language tag when the first parameter is a transcription.", "example": "en", "type": "string" }, "tooltip": { "label": "Tooltip", "description": "Tooltip to replace the default one with. Leave it blank to have no tooltip.", "type": "string" }, "cat": { "description": "\"no\" cancels the categorization of the page into \"Pages with [language name] IPA\".", "type": "string", "suggestedvalues": [ "no" ] } }, "paramOrder": [ "1", "2", "3", "audio", "label", "link", "small", "generic", "wrap", "class", "lang", "tooltip", "cat" ], "format": "inline" }</templatedata>

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}} (uses) {{IPAc-yue|h|ung|2|.|z|i|2}} [hoŋ˧˥.tsiː˧˥]
Hungarian {{IPAc-hu}} (uses) {{IPAc-hu|'|m|a|gy|a|r}} [ˈmɒɟɒr]
Mandarin {{IPAc-cmn}} (uses) {{IPAc-cmn|zh|ong|1|h|ua|2|-|r|en|2|m|in|2|-|g|ong|4|h|e|2|g|uo|2}} [ʈʂʊ́ŋxwǎ ɻə̌nmǐn kʊ̂ŋxɤ̌kwǒ]
Polish {{IPAc-pl}} (uses) {{IPAc-pl|'|sz|cz|e|ć|i|n}} [ˈʂt͡ʂɛt͡ɕin]

Some other conversion templates have also been created, but they haven't been vetted by the community and may not produce output complying with the respective keys.