Template:t/documentation
- Template:t+/documentation, Template:t-check/documentation and Template:t+check/documentation redirect here.
Use this template in the Translations section to format a translation of an English entry.
There are several translation templates:
{{t}}
is the default, and is the one that human editors should use most when adding a translation.{{t-check}}
marks translations which need attention.{{t+}}
and{{t+check}}
are the same as{{t}}
and{{t-check}}
, respectively, except that they add a superscript link to the corresponding entry on the foreign-language Wiktionary. (For example,{{t+|fr|le}}
has a link to fr:le.) Various automated tools will change{{t}}
to{{t+}}
or{{t-check}}
to{{t+check}}
if the translation has an existing entry on the foreign-language Wiktionary. You can also do this manually, if you like, if you know that the entry exists.{{no equivalent translation}}
when a language has no corresponding term and only an unidiomatic translation is provided. However, if it is the sole commonly used translation in that language, then one of the above templates should be used instead.{{no attested translation}}
when no term which would pass WT:CFI exists in the language. Most commonly used for concepts which would be foreign to speakers of the language, who would have to employ code-switching to discuss the term. If a term is unadapted from the source language but nevertheless would pass WT:CFI, then one of the above templates should be used instead.{{not used}}
when a language lacks the term. Most commonly used for grammatical words absent in other languages such as the, though not limited to such.{{t-needed}}
to request a missing translation.{{tt}}
,{{tt+}}
,{{tt-check}}
and{{tt+check}}
are logically equivalent to{{t}}
,{{t+}}
,{{t-check}}
and{{t+check}}
(respectively), but only work inside of{{multitrans}}
.{{multitrans}}
is able to achieve major reductions in memory usage to help combat ongoing issues with Lua memory errors, but requires these special templates in order to work properly.
The implementation of these templates is performed by Module:translations.
Parameters
[edit]|1=
(required)- Language code. See Wiktionary:Languages.
|2=
(required)- Entry name of the translated word. This supports all the features that
{{l}}
does: diacritics will be removed automatically from words in certain languages, embedded wikilinks will be processed properly, and the script and transliteration will be handled automatically if not provided. |3=
,|4=
,|5=
, … (all optional)- Gender/number specification(s), using the codes provided by Module:gender and number; If multiple codes are used (separated by a "|"), they will be displayed in the order given.
|sc=
(optional)- Specifies a script code, see Wiktionary:Scripts. This is only needed if the script used in the translation is not one of the normal scripts of the language, or if script detection fails to detect the script correctly.
|tr=
(optional)- Specifies the transliteration into roman (Latin) script, as also shown in the example below. A transliteration may be automatically generated for certain languages, if none was provided. Use
|tr=-
if you don't want a transliteration to be automatically generated (you shouldn't really ever do this in an entry). - Note that transliterations should be in the Latin script. Japanese entries are discouraged to have kana transliteration, see example below.
|alt=
(optional)- Specifies an alternate form of the word, not the pagename, to be displayed.
|lit=
(optional)- Adds a literal translation for the term.
|id=
(optional)- Links to a
{{senseid}}
tag on the target page.
Examples
[edit]Below are some examples in the entry butterfly. Translation entries should be introduced with a bulleted list and the language name. Language variants (such as dialects of Arabic and Chinese), scripts (such as Serbo-Croatian in Latin and Cyrillic), and written standards (such as Norwegian Bokmål and Nynorsk) may be introduced with indented bullets.
* Arabic: {{t|ar|فَرَاشَة|f}}
* Bengali: {{t|bn|প্রজাপতি|tr=projapoti, prajapati}}
* Chinese:
*: Cantonese: {{t|yue|蝴蝶|tr=wu4 dip6-2}}
*: Mandarin: {{t+|cmn|蝴蝶|tr=húdié}}
* Dhuwal: {{t+|dwu|buurnba}}
* Japanese: {{t+|ja|胡蝶|tr=kochō}}, {{t+|ja|チョウ|tr=chō}}
* Javanese: {{t+|jv|ꦏꦸꦥꦸ}}
* Latin: {{t|la|pāpiliō}}
* Russian: {{t+|ru|ба́бочка|f}}
* Serbo-Croatian:
*: Cyrillic: {{t|sh|ле̏птӣр|m}}
*: Latin: {{t|sh|lȅptīr|m}}
* Tamil: {{t+|ta|வண்ணத்துப்பூச்சி|lit=color insect}}
* Yoruba: {{t|yo|labalábá}}
- Arabic: فَرَاشَة f (farāša)
- Bengali: প্রজাপতি (projapoti, prajapati)
- Chinese:
- Dhuwal:
- Japanese: 胡蝶 (ja) (kochō), チョウ (ja) (chō)
- Javanese: ꦏꦸꦥꦸ (jv) (kupu)
- Latin: pāpiliō
- Russian: ба́бочка (ru) f (bábočka)
- Serbo-Croatian:
- Tamil: வண்ணத்துப்பூச்சி (ta) (vaṇṇattuppūcci, literally “color insect”)
- Yoruba: labalábá
Technical explanation of the {{multitrans}}
templates
[edit]This is a technical explanation for the four {{multitrans}}
templates, {{tt}}
, {{tt+}}
, {{tt-check}}
and {{tt+check}}
, which use complex and highly obfuscated template code which is difficult to understand:
{{((}}
expands to{{
.{{))}}
expands to}}
.{{!}}
expands to|
.- All parameters except for
1
use{{#if:}}
, meaning they are only present on expansion if they are specified and not blank, since the preceding|
is only included if the parameter is present; e.g.{{#if:{{{foo|}}}|{{!}}foo={{{foo}}}}}
becomes|foo=foo
on expansion. - Parameter 1 is passed to
{{multitrans}}
as the empty string if blank/unspecified, as this is the format expected bygetByCode
in Module:languages. - Parameters 3+ are converted into a comma-separated list, with any gaps removed, which is faster to parse.
{{padleft:}}
is used to trim; e.g.{{padleft: foo }}
expands tofoo
.
Template Data
[edit]TemplateData for t
Links a translation; meant to be used in between {{trans-top}} and {{trans-bottom}}.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Language | 1 | Wiktionary language code for the language of translation
| Line | required |
Term | 2 | The word or phrase being linked to, that translates the word
| Line | required |
Script code | sc | Specifies a Wiktionary script code. This is only needed if the script used in the translation is not one of the normal scripts of the language, or if script detection fails to detect the script correctly.
| Line | optional |
Transliteration | tr | Specifies the transliteration into Latin script, as also shown in the example below. A transliteration may be automatically generated for certain languages, if none was provided. | Line | optional |
Alternate term displayed | alt | Specifies an alternate form of the word, not the pagename, to be displayed.
| Line | optional |
Literally | lit | A literal translation for the term
| String | optional |
Sense ID | id | Links to a {{temp|senseid}} tag on the target page. | Line | optional |
See also
[edit]{{trans-top}}
{{trans-bottom}}