User:Ivan Štambuk/Template:lang-ex/doc

Purpose
This template is intended to provide a unified display of mentioned (particularly foreign-language) words or phrases. It supports transliteration, phonetic/phonemic transcription, meaning gloss, and linking to Wiktionary.

By default, this template will place articles into the relevant subcategory of.

Usage
The first positional parameter is mandatory and represents language code. Optionally, when ending language code with '+', a wikilink to language's article is generated. The second positional parameter is the word or phrase being mentioned. For example,
 * French:

Results in your browser:
 * French:

The first parameter should be italicized when applied to words or phrases written in Latin script, to maintain use–mention distinction when used in running text in English.

The third positional parameter is optional and represents transliteration. Transliteration is listed next to the mentioned word or phrase, and separated with a slash. For example, Results in:
 * Ukrainian:
 * Ukrainian:

The optional named parameter ipa= can be used to specify IPA phonemic transcription (within slashes //) or phonetic transcription (within square brackets []). If neither square brackets nor slashes are specified, the template by default uses slashes. For example, Results in:
 * Ukrainian:
 * Ukrainian:
 * Ukrainian:
 * Ukrainian:

The fourth positional parameter is optional and represents meaning gloss in English. For example, Results in:
 * Ukrainian:
 * Ukrainian:

Linking to Wiktionary and glosses as tooltips are regulated through opt= parameter (standing for optional). opt=wikt generates a link to Wiktionary page with the same name as the first parameter. For example, Results in: Additionally, since Wiktionary page names exclude diacritics used for marking accents, vowels and similar, optional parameter wikt-link= is used to specify the linked page name, when the second positional parameter is used with diacritics. For example, Results in:
 * Ukrainian:
 * Ukrainian:
 * Ukrainian:
 * Ukrainian:

Glosses as tooltips are enabled with opt=tooltip parameter. Optional parameters specified within opt= such as wikt and tooltip can be combined, yielding combinations such as wikt-tooltip or tooltip-wikt. For example, Results in:
 * Ukrainian:
 * Ukrainian:
 * Ukrainian:
 * Ukrainian:

Custom styling for script used to display the word or phrase is supported with sc= parameter, which takes ISO 15924 code, just like the template. For example, Results in:
 * Arabic:
 * Arabic:
 * Arabic:
 * Arabic:

Possible improvements

 * When phonemic/phonetic transcription is provided, automatically wikilink the transcription to the help page where IPA symbols for that language are explained. E.g. for Ukrainian that should be Help:IPA for Ukrainian.
 * Most languages not written in Latin script have several transliteration schemes. Often these transliterations (or Romanizations in general) have their own articles. If transliteration is provided, it would be helpful to automatically wikilink it to the related article, if it exists. E.g. for Ukrainian that would be Romanization of Ukrainian.