Template:Verse translation/doc: Difference between revisions

From Omniversalis
Content added Content deleted
(Created page with "{{Documentation subpage}} == Usage == This template may be used when a verse text in its original language and its translation into English are to be displayed together. It di...")
 
en>Centrist16
No edit summary
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
== Usage ==
== Usage ==
This template may be used when a verse text in its original language and its translation into English are to be displayed together. It displays the original text in italics and the translation in [[roman type]]. Optionally, it displays attributions for each text below. The main parameter set is the following:
This template may be used when a verse text in its original language and its translation into English are to be displayed together. It displays the original text in italics and the translation in {{W|roman type}}. Optionally, it displays attributions for each text below. The main parameter set is the following:


{{tlx|Verse translation|2=lang={{var|[[ISO 639]] language code or [[IETF language tag]]}}|3={{var|original text}}|4={{var|translation}}|5=attr1={{var|original text attribution}}|6=attr2={{var|translation attribution}}}}
{{tlx|Verse translation|2=lang={{var|{{W|ISO 639}} language code or {{W|IETF language tag}}}}|3={{var|original text}}|4={{var|translation}}|5=attr1={{var|original text attribution}}|6=attr2={{var|translation attribution}}}}


{{see|List of ISO 639-1 codes|List of ISO 639-2 codes}}
{{see|List of ISO 639-1 codes|List of ISO 639-2 codes}}
Line 40: Line 40:
Bist du sicher?
Bist du sicher?
|Do you speak German?
|Do you speak German?
Are you sure?.}}}}
Are you sure?}}}}
While {{para|lang|de}} is omitted from this minimal example, the {{para|lang}} parameter should be specified in normal use.
While {{para|lang|de}} is omitted from this minimal example, the {{para|lang}} parameter should be specified in normal use.


Line 46: Line 46:


===Full example===
===Full example===
The parameters {{para|attr1}} and {{para|attr2}} are optional, must be labelled, and do {{em|not}} preserve line breaks in the code. They are meant to contain the attributions for (1) the original text and (2) the translation. Either, both, or neither may be used. Their content will be displayed preceded by a dash and in slightly reduced text. These texts do {{em|not}} wrap automatically; if wrapping is required, {{code|lang=HTML|code=<br />}} can be used, as below. Also optional (though recommended by [[Wikipedia:Manual of Style/Accessibility#Other languages|Manual of Style/Accessibility § Other languages]]) is {{para|lang}}, which takes an [[IETF language tag]] or [[ISO 639]] language code in the same format as {{tl|lang}}. For example:
The parameters {{para|attr1}} and {{para|attr2}} are optional, must be labelled, and do {{em|not}} preserve line breaks in the code. They are meant to contain the attributions for (1) the original text and (2) the translation. Either, both, or neither may be used. Their content will be displayed preceded by a dash and in slightly reduced text. These texts do {{em|not}} wrap automatically; if wrapping is required, {{code|lang=HTML|code=<br />}} can be used, as below. Also optional (though recommended by {{W|Wikipedia:Manual of Style/Accessibility#Other languages|Manual of Style/Accessibility § Other languages}}) is {{para|lang}}, which takes an {{W|IETF language tag}} or {{W|ISO 639}} language code in the same format as {{tl|lang}}. For example:
{{Markup|
{{Markupv
<syntaxhighlight lang="HTML">
|markup=<syntaxhighlight lang="HTML">
{{Verse translation|lang=es|
{{Verse translation|lang=es|
¿Qué es la vida? — Una ilusión,
¿Qué es la vida? — Una ilusión,
Line 60: Line 60:
Since is life a dream at best,
Since is life a dream at best,
And even dreams themselves are dreams.<ref>''Calderon's Dramas'', pp. 78–79. London: Henry S. King & Co., 1873.</ref>
And even dreams themselves are dreams.<ref>''Calderon's Dramas'', pp. 78–79. London: Henry S. King & Co., 1873.</ref>
|attr1=[[Pedro Calderón de la Barca|Calderón]]: ''{{lang|es|[[La vida es sueño]]}}''<br />Act II, Scene 19, lines 1197–1201
|attr1={{W|Pedro Calderón de la Barca|Calderón}}: ''{{lang|es|{{W|La vida es sueño}}}}''<br />Act II, Scene 19, lines 1197–1201
|attr2=[[Denis Florence Mac-Carthy]]
|attr2={{W|Denis Florence Mac-Carthy}}
}}
}}
{{Reflist}}
{{Reflist}}
</syntaxhighlight>
</syntaxhighlight>
|{{Verse translation|lang=es|
|renders=<nowiki/>{{Verse translation|lang=es|
¿Qué es la vida? — Una ilusión,
¿Qué es la vida? — Una ilusión,
Una sombra, una ficción,
Una sombra, una ficción,
Line 76: Line 76:
Since is life a dream at best,
Since is life a dream at best,
And even dreams themselves are dreams.<ref>''Calderon's Dramas'', pp. 78–79. London: Henry S. King & Co., 1873.</ref>
And even dreams themselves are dreams.<ref>''Calderon's Dramas'', pp. 78–79. London: Henry S. King & Co., 1873.</ref>
|attr1=[[Pedro Calderón de la Barca|Calderón]]: ''{{lang|es|[[La vida es sueño]]}}''<br />Act II, Scene 19, lines 1197–1201
|attr1={{W|Pedro Calderón de la Barca|Calderón}}: ''{{lang|es|{{W|La vida es sueño}}}}''<br />Act II, Scene 19, lines 1197–1201
|attr2=[[Denis Florence Mac-Carthy]]
|attr2={{W|Denis Florence Mac-Carthy}}
}}
}}
{{Reflist}}
{{Reflist}}
Line 90: Line 90:
მელნად ვიხმარე გიშრის ტბა და კალმად მე ნა რხეული,
მელნად ვიხმარე გიშრის ტბა და კალმად მე ნა რხეული,
ვინცა ისმინოს, დაესვას ლახვარი გულსა ხეული.
ვინცა ისმინოს, დაესვას ლახვარი გულსა ხეული.
|attr1=[[Shota Rustaveli]]: from ''[[The Knight in the Panther's Skin]]''
|attr1={{W|Shota Rustaveli}}: from ''{{W|The Knight in the Panther's Skin}}''
|For ink I have used a lake of jet, and for pen a pliant crystal.
|For ink I have used a lake of jet, and for pen a pliant crystal.
Whoever hears, a jagged spear will pierce his heart.}}
Whoever hears, a jagged spear will pierce his heart.}}
Line 97: Line 97:
მელნად ვიხმარე გიშრის ტბა და კალმად მე ნა რხეული,
მელნად ვიხმარე გიშრის ტბა და კალმად მე ნა რხეული,
ვინცა ისმინოს, დაესვას ლახვარი გულსა ხეული.
ვინცა ისმინოს, დაესვას ლახვარი გულსა ხეული.
|attr1=[[Shota Rustaveli]]: from ''[[The Knight in the Panther's Skin]]''
|attr1={{W|Shota Rustaveli}}: from ''{{W|The Knight in the Panther's Skin}}''
|For ink I have used a lake of jet, and for pen a pliant crystal.
|For ink I have used a lake of jet, and for pen a pliant crystal.
Whoever hears, a jagged spear will pierce his heart.}}
Whoever hears, a jagged spear will pierce his heart.}}
}}
}}
===Right-to-left text===
===Right-to-left text===
If {{para|rtl1}} is set to {{em|any}} value, the first column's text is aligned right. This is useful for original texts in [[right-to-left]] languages like Arabic, as exemplified below:
If {{para|rtl1}} is set to {{em|any}} value, the first column's text is aligned right. This is useful for original texts in {{W|right-to-left}} languages like Arabic, as exemplified below:
{{Markup|
{{Markup|
<syntaxhighlight lang="moin">
<syntaxhighlight lang="moin">
Line 123: Line 123:
==Tips==
==Tips==
===Special characters===
===Special characters===
As with many other templates, if the characters <code>=</code> or <code><nowiki>|</nowiki></code> appear in the verse texts, they will break the template's display. The easiest solution is to replace them with <code>{{[[Template:=|=]]}}</code> or {{tlx|!}} respectively.
As with many other templates, if the characters <code>=</code> or <code><nowiki>|</nowiki></code> appear in the verse texts, they will break the template's display. The easiest solution is to replace them with <code>{{{{W|Template:=|=}}}}</code> or {{tlx|!}} respectively.


===Language markup===
===Language markup===
The {{para|lang}} parameter covers the first block of text in this template. It is good practice to enclose any other non-English text—such as in {{para|attr1}}—in the {{tl|lang}} template, as in the [[#Full example|full example above]].
The {{para|lang}} parameter covers the first block of text in this template. It is good practice to enclose any other non-English text—such as in {{para|attr1}}—in the {{tl|lang}} template, as in the {{W|#Full example|full example above}}.


===Indentation===
===Indentation===
Line 154: Line 154:
Although optimized for verse, the template works equally well for prose. For example:
Although optimized for verse, the template works equally well for prose. For example:
{{Verse translation|lang=la|
{{Verse translation|lang=la|
Gallia est omnis divisa in partes tres, quarum unam incolunt Belgae, aliam Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli appellantur. Hi omnes lingua, institutis, legibus inter se differunt. Gallos ab Aquitanis Garumna flumen, a Belgis Matrona et Sequana dividit. Horum omnium fortissimi sunt Belgae, propterea quod a cultu atque humanitate provinciae longissime absunt, minimeque ad eos mercatores saepe commeant atque ea quae ad effeminandos animos pertinent important, proximique sunt Germanis, qui trans Rhenum incolunt, quibuscum continenter bellum gerunt. Qua de causa Helvetii quoque reliquos Gallos virtute praecedunt, quod fere cotidianis proeliis cum Germanis contendunt, cum aut suis finibus eos prohibent aut ipsi in eorum finibus bellum gerunt.|attr1=[[Gaius Julius Caesar]], ''{{lang|la|[[Commentarii de Bello Gallico]]}}'' 1.1
Gallia est omnis divisa in partes tres, quarum unam incolunt Belgae, aliam Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli appellantur. Hi omnes lingua, institutis, legibus inter se differunt. Gallos ab Aquitanis Garumna flumen, a Belgis Matrona et Sequana dividit. Horum omnium fortissimi sunt Belgae, propterea quod a cultu atque humanitate provinciae longissime absunt, minimeque ad eos mercatores saepe commeant atque ea quae ad effeminandos animos pertinent important, proximique sunt Germanis, qui trans Rhenum incolunt, quibuscum continenter bellum gerunt. Qua de causa Helvetii quoque reliquos Gallos virtute praecedunt, quod fere cotidianis proeliis cum Germanis contendunt, cum aut suis finibus eos prohibent aut ipsi in eorum finibus bellum gerunt.|attr1={{W|Gaius Julius Caesar}}, ''{{lang|la|{{W|Commentarii de Bello Gallico}}}}'' 1.1
|All Gaul is divided into three parts, one of which the Belgae inhabit, the Aquitani another, those who in their own language are called Celts, in our Gauls, the third. All these differ from each other in language, customs and laws. The river Garonne separates the Gauls from the Aquitani; the Marne and the Seine separate them from the Belgae. Of all these, the Belgae are the bravest, because they are furthest from the civilization and refinement of [our] Province, and merchants least frequently resort to them, and import those things which tend to effeminate the mind; and they are the nearest to the Germans, who dwell beyond the Rhine, with whom they are continually waging war; for which reason the Helvetii also surpass the rest of the Gauls in valor, as they contend with the Germans in almost daily battles, when they either repel them from their own territories, or themselves wage war on their frontiers.|attr2=translated by W.A. McDevitte and W.S. Bohn}}
|All Gaul is divided into three parts, one of which the Belgae inhabit, the Aquitani another, those who in their own language are called Celts, in our Gauls, the third. All these differ from each other in language, customs and laws. The river Garonne separates the Gauls from the Aquitani; the Marne and the Seine separate them from the Belgae. Of all these, the Belgae are the bravest, because they are furthest from the civilization and refinement of [our] Province, and merchants least frequently resort to them, and import those things which tend to effeminate the mind; and they are the nearest to the Germans, who dwell beyond the Rhine, with whom they are continually waging war; for which reason the Helvetii also surpass the rest of the Gauls in valor, as they contend with the Germans in almost daily battles, when they either repel them from their own territories, or themselves wage war on their frontiers.|attr2=translated by W.A. McDevitte and W.S. Bohn}}


Line 215: Line 215:


<includeonly>{{sandbox other||
<includeonly>{{sandbox other||
[[Category:Quotation templates]]
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:Quotation templates]]}}</includeonly>
[[Category:Translation templates]]
}}</includeonly>

Revision as of 05:08, 3 April 2022

Usage

This template may be used when a verse text in its original language and its translation into English are to be displayed together. It displays the original text in italics and the translation in roman type. Optionally, it displays attributions for each text below. The main parameter set is the following:

{{Verse translation|lang=ISO 639 language code or IETF language tag|original text|translation|attr1=original text attribution|attr2=translation attribution}}
Full parameter set in horizontal format
{{Verse translation|lang=|italicsoff=|rtl1=|<!--original text-->|<!--translation-->|attr1=|attr2=}}
Full parameter set in vertical format
{{Verse translation
 | lang       = 
 | italicsoff = 
 | rtl1       = 
 | <!--original text-->
 | <!--translation-->
 | attr1      = 
 | attr2      = 
}}

Examples

Basic example

The first two parameters are required, unlabelled, and hold the two texts. For example:

Markup Renders as
{{Verse translation
|Sprechen Sie Deutsch?
Bist du sicher?
|Do you speak German?
Are you sure?}}

Sprechen Sie Deutsch?
Bist du sicher?

Do you speak German?
Are you sure?

While |lang=de is omitted from this minimal example, the |lang= parameter should be specified in normal use.

Line breaks in the code texts are preserved in the display. Extra markup like <br /> is not required, but will also be displayed if included. As shown below, correctly formatted inline references can also be added to both texts.

Full example

The parameters |attr1= and |attr2= are optional, must be labelled, and do not preserve line breaks in the code. They are meant to contain the attributions for (1) the original text and (2) the translation. Either, both, or neither may be used. Their content will be displayed preceded by a dash and in slightly reduced text. These texts do not wrap automatically; if wrapping is required, <br /> can be used, as below. Also optional (though recommended by Manual of Style/Accessibility § Other languages) is |lang=, which takes an IETF language tag or ISO 639 language code in the same format as {{lang}}. For example:

Markup
{{Verse translation|lang=es|
¿Qué es la vida? — Una ilusión,
Una sombra, una ficción,
Y el mayor bien es pequeño;
Que toda la vida es sueño,
Y los sueños sueño son.<ref>{{cite book|title=La vida es sueño|last=Calderón de la Barca|first=Pedro|author-link=Pedro Calderón de la Barca|editor-last=Comfort|editor-first=William Wistar|location=New York|publisher=American Book Company|date=1904|page=104|url=https://archive.org/details/lavidaessueo00comfgoog}}</ref>
|What is life? A thing that seems,
A mirage that falsely gleams,
Phantom joy, delusive rest,
Since is life a dream at best,
And even dreams themselves are dreams.<ref>''Calderon's Dramas'', pp. 78–79. London: Henry S. King & Co., 1873.</ref>
|attr1={{W|Pedro Calderón de la Barca|Calderón}}: ''{{lang|es|{{W|La vida es sueño}}}}''<br />Act II, Scene 19, lines 1197–1201
|attr2={{W|Denis Florence Mac-Carthy}}
}}
{{Reflist}}
Renders as

¿Qué es la vida? — Una ilusión,
Una sombra, una ficción,
Y el mayor bien es pequeño;
Que toda la vida es sueño,
Y los sueños sueño son.[1]

What is life? A thing that seems,
A mirage that falsely gleams,
Phantom joy, delusive rest,
Since is life a dream at best,
And even dreams themselves are dreams.[2]

Calderón: La vida es sueño
Act II, Scene 19, lines 1197–1201
Denis Florence Mac-Carthy
  1. ^ Lua error in Module:Citation/CS1 at line 1520: attempt to call field 'has_accept_as_written' (a nil value).
  2. ^ Calderon's Dramas, pp. 78–79. London: Henry S. King & Co., 1873.

Notice that the <ref>...</ref> markup is added before the attribution parameters.

Italic override

If |italicsoff= is set to any value, the first column's italics are turned off. This is useful for original texts in non-Latin scripts, for which italics may be neither useful nor appropriate:

Markup Renders as
{{Verse translation|lang=ka|italicsoff=y|
მელნად ვიხმარე გიშრის ტბა და კალმად მე ნა რხეული,
ვინცა ისმინოს, დაესვას ლახვარი გულსა ხეული.
|attr1={{W|Shota Rustaveli}}: from ''{{W|The Knight in the Panther's Skin}}''
|For ink I have used a lake of jet, and for pen a pliant crystal.
Whoever hears, a jagged spear will pierce his heart.}}

მელნად ვიხმარე გიშრის ტბა და კალმად მე ნა რხეული,
ვინცა ისმინოს, დაესვას ლახვარი გულსა ხეული.

For ink I have used a lake of jet, and for pen a pliant crystal.
Whoever hears, a jagged spear will pierce his heart.

Shota Rustaveli: from The Knight in the Panther's Skin

Right-to-left text

If |rtl1= is set to any value, the first column's text is aligned right. This is useful for original texts in right-to-left languages like Arabic, as exemplified below:

Markup Renders as
{{Verse translation|lang=ar|italicsoff=y|rtl1=y|
خل الذنوب صغيرهاو كبيرها ذاك التقى
و اصنع كماش فوق أرض الشوك يحذر ما يرى
لا تحقرن صغيرةً إن الجبال من الحصى
|Abandon sins, big and small – that is Tawqa
And be like the one who walks on a thorny path, he is cautious of what he sees
Do not belittle the small sins; truly mountains are made from pebbles}}

خل الذنوب صغيرهاو كبيرها ذاك التقى
و اصنع كماش فوق أرض الشوك يحذر ما يرى
لا تحقرن صغيرةً إن الجبال من الحصى

Abandon sins, big and small – that is Tawqa
And be like the one who walks on a thorny path, he is cautious of what he sees
Do not belittle the small sins; truly mountains are made from pebbles

Tips

Special characters

As with many other templates, if the characters = or | appear in the verse texts, they will break the template's display. The easiest solution is to replace them with {Template:=} or {{!}} respectively.

Language markup

The |lang= parameter covers the first block of text in this template. It is good practice to enclose any other non-English text—such as in |attr1=—in the {{lang}} template, as in the full example above.

Indentation

The indentation provided automatically in this template is approximately equal to <blockquote> and <poem> in the following examples:

Markup Renders as
Text.
<blockquote>Indented text.</blockquote>
More text.

Text.

Quoted text.

More text.

Markup Renders as
Text.
<poem style="margin-left: 3em; font-style:italic">Indented text.</poem>
More text.

Text.

Indented text.

More text.

Prose

Although optimized for verse, the template works equally well for prose. For example:

Gallia est omnis divisa in partes tres, quarum unam incolunt Belgae, aliam Aquitani, tertiam qui ipsorum lingua Celtae, nostra Galli appellantur. Hi omnes lingua, institutis, legibus inter se differunt. Gallos ab Aquitanis Garumna flumen, a Belgis Matrona et Sequana dividit. Horum omnium fortissimi sunt Belgae, propterea quod a cultu atque humanitate provinciae longissime absunt, minimeque ad eos mercatores saepe commeant atque ea quae ad effeminandos animos pertinent important, proximique sunt Germanis, qui trans Rhenum incolunt, quibuscum continenter bellum gerunt. Qua de causa Helvetii quoque reliquos Gallos virtute praecedunt, quod fere cotidianis proeliis cum Germanis contendunt, cum aut suis finibus eos prohibent aut ipsi in eorum finibus bellum gerunt.

All Gaul is divided into three parts, one of which the Belgae inhabit, the Aquitani another, those who in their own language are called Celts, in our Gauls, the third. All these differ from each other in language, customs and laws. The river Garonne separates the Gauls from the Aquitani; the Marne and the Seine separate them from the Belgae. Of all these, the Belgae are the bravest, because they are furthest from the civilization and refinement of [our] Province, and merchants least frequently resort to them, and import those things which tend to effeminate the mind; and they are the nearest to the Germans, who dwell beyond the Rhine, with whom they are continually waging war; for which reason the Helvetii also surpass the rest of the Gauls in valor, as they contend with the Germans in almost daily battles, when they either repel them from their own territories, or themselves wage war on their frontiers.

Gaius Julius Caesar, Commentarii de Bello Gallico 1.1 —translated by W.A. McDevitte and W.S. Bohn

TemplateData

<templatedata> { "description": "Use this template to provide a side-by-side translation of a text", "params": { "1": { "label": "Original text", "type": "unknown", "autovalue": "", "required": true }, "2": { "label": "Translation" }, "italicsoff": { "label": "Italics (original text)", "description": "If set to any value, the first column's italics are turned off. This is useful for original texts in non-Latin scripts, for which italics may be neither useful nor appropriate.", "example": "y"

}, "rtl1": { "label": "Right-to-left (original text)", "description": "If set to any value, the first column's text is aligned right. This is useful for original texts in right-to-left languages like Arabic.", "example": "y"

}, "lang": { "label": "Language code (original text)", "description": "ISO 639 language code or IETF language tag for the first column of text.", "example": "fr" }, "attr1": { "label": "Attribution (original text)", "description": "Attribution(s) for the original text", "example": "Rene Descartes (1644), Principles of Philosophy" }, "attr2": { "label": "Attribution (translation)", "description": "Attribution(s) for the translation", "example": "John Smith (1959)" } }, "paramOrder": [ "1", "2", "lang", "italicsoff", "rtl1", "attr1", "attr2" ] } </templatedata>

See also