साँचा:IPA audio filename/doc
{{
साँचा:namespace detect
| type = notice
| image =
| imageright =
| class =
| style = margin-bottom:1.0em;
| textstyle =
| text = साँचा:strong for साँचा:terminate sentence
It contains usage information, categories and other content that is not part of the original साँचा page.
| small =
| smallimage =
| smallimageright =
| smalltext =
| subst =
| date =
| name =
}}
This template produces the filename of an IPA sound sample (not the sound itself). It can be determined, by default, from the IPA symbol. Example: साँचा:tlx
→ साँचा:yesno
. Optionally, a filename can be entered directly. Also optionally, the existence of the file can be checked, and any error can be overridden by any text or a blank.
Usage
Full input list is:
{{IPA audio filename | ipa symbol = | soundfile = | checkexist = | errortext = }}
- First parameter or ípa symbol= This first parameter (or named parameter ipa symbol=)is for the IPA symbol. The symbol is translated into the name of the sound (using the list in साँचा:tl) and adding the extension
.ogg
. When the parameter is not used, the inputsoundfile=
should be used. For any symbol, the default name can be permanently overruled through the list (see below). - soundfile= (optional, default=none) This parameter allows for entering any literal filename. Input here bypasses (overwrites) the first parameter. It can be used to enter a filename that does not have a default name as साँचा:tl produces. Note: when used, this input should have the extension.
- checkexist= (optional, default=no) Can be "yes" or "no". When entered "yes", and the filename is not an error, the template checks for the existence of the filename. If itdoes not exist, an error is produced. Note: Checking for existance is called an "expensive" function, in that it requires serious server-side action. The number of file checks per page is limited.
- errortext= (optional, default=none) The errortext entered here overwrites any possible error-output. If there is no error, this errortext is not used. The tradeoff is: it hides any error information, but is cleans up the output. The errortext can be a blank, like साँचा:tlx.
Permanent altered from default name
Some IPA symbols have soundfiles available in Wikipedia that are not the default name. These alternate names can be entered in this template, and will show up in the output. साँचा:ambox
Subtemplate साँचा:tlx contains the list of alternate names. Example:
- kʼ is named
velar ejective
, so this would yield default name:velar ejective.ogg
The filename however differs from that default name. The list in साँचा:tlx produces that different name:
Currently, the next nine non-default names are in the list:
- voiceless labio-velar approximant = voiceless labio-velar fricative.ogg (from: ʍ)
- alveolar ejective = alveolar ejective plosive.ogg (from: tʼ)
- uvular ejective = uvular ejective plosive.ogg (from: qʼ)
- bilabial ejective = bilabial ejective plosive.ogg (from: pʼ)
- sje-sound = voiceless dorso-palatal velar fricative.ogg (from: ɧ)
- velar ejective = velar ejective plosive.ogg (from: kʼ)
- labial-velar nasal = labial-velar nasal stop.ogg (from: ŋ͡m)
- epiglottal plosive = voiceless_epiglottal_plosive.ogg (from: ʡ)
- velar approximant = voiced velar approximant.ogg (from: ɰ)
- near-close near-back vowel = near-close near-back rounded vowel.ogg (from:ʊ)
- R-colored vowel=Regular and r-colored vowels.ogg (from:ɚ)
Possible errors
Three error situations are covered:
- No IPA symbol entered (and no soundfile name):
- The IPA symbol may not be defined in साँचा:tlx:
- Checkexist=yes is asked, and the file does not exist:
{{IPA audio filename|ⱱ̟|checkexist=yes}}
→ साँचा:yesno
These error outputs can be overridden by using errortext=
. This can be blank. This only has effect on the output, it does not alter the existing error situation.
Technical background
- The template uses nested sub-templates to prevent re-caculation of repeated data. e.g. the name from साँचा:tlx is calculated only once, and then passed through to the next subtemplate in the nest. This is more important for the check on existence {{#ifexist:}}, which is "expensive" and should be performed only once. The nesting has three levels: साँचा:tlx calls साँचा:tlx calls साँचा:tlx.
- Error texts are passed through unaltered. At the end, in
/main2
, any error is enveloped with the errortext (if provided). - Check existence is performed only when the filename is not an error in itself.
Issues
- Todo: the template should accept input "|ipa symbol=...", overriding current unnamed param #1.
Subtemplates used: