User:Ivan Štambuk/Template:lang-ex/doc
This is a documentation subpage for User:Ivan Štambuk/Template:lang-ex. It may contain usage information, categories and other content that is not part of the original user template page. |
Purpose
[edit]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 Category:Articles containing non-English-language text.
Usage
[edit]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: {{lang-ex|fr|''Je suis française.''}} * {{lang-ex|fr+|''Je suis française.''}}
Results in your browser:
- French: [Je suis française.] Error: {{Lang}}: text has italic markup (help)
- French: [Je suis française.] Error: {{Lang}}: text has italic markup (help)
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,
* Ukrainian: {{lang-ex|uk|бéрег|béreh|}}
Results in:
- Ukrainian: бéрег/béreh
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,
* Ukrainian: {{lang-ex|uk|бéрег|béreh|ipa=[ˈbɛreɦ]}} * Ukrainian: {{lang-ex|uk|бéрег|béreh|ipa=ˈbɛrɛɦ}}
Results in:
- Ukrainian: бéрег/béreh ([ˈbɛreɦ])
- Ukrainian: бéрег/béreh (/ˈbɛrɛɦ/)
The fourth positional parameter is optional and represents meaning gloss in English. For example,
* Ukrainian: {{lang-ex|uk|бéрег|béreh|ipa=[ˈbɛreɦ]|shore}}
Results in:
- Ukrainian: бéрег/béreh ([ˈbɛreɦ], “shore”)
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,
* Ukrainian: {{lang-ex|uk|берег|béreh|ipa=[ˈbɛreɦ]|shore|opt=wikt}}
Results in:
- Ukrainian: берег/béreh ([ˈbɛreɦ], “shore”)
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,
* Ukrainian: {{lang-ex|uk|бéрег|béreh|ipa=[ˈbɛreɦ]|shore|opt=wikt|wikt-link=берег}}
Results in:
- Ukrainian: бéрег/béreh ([ˈbɛreɦ], “shore”)
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,
* Ukrainian: {{lang-ex|uk|бéрег|béreh|ipa=[ˈbɛreɦ]|shore|opt=tooltip-wikt|wikt-link=берег}} * Ukrainian: {{lang-ex|uk|бéрег|béreh|ipa=[ˈbɛreɦ]|shore|opt=tooltip}}
Results in:
- Ukrainian: бéрег/béreh ([ˈbɛreɦ])
- Ukrainian: бéрег/béreh ([ˈbɛreɦ])
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 {{Script}}. For example,
* Arabic: {{lang-ex|ar|أبجدية عربية}} * Arabic: {{lang-ex|ar|sc=Arab|أبجدية عربية}}
Results in:
- Arabic: أبجدية عربية
- Arabic: أبجدية عربية
Possible improvements
[edit]- 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.
See also
[edit]