Template:Verse translation

维基百科,自由的百科全书
文档图示 模板文档[查看] [编辑] [历史] [清除缓存]

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|width=width of all contents}}
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:

代码 效果
{{Verse translation
|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=[[佩德罗·卡尔德隆·德·拉·巴尔卡|Calderón]]: ''{{lang|es|{{tsl|en|La vida es sueño||La vida es sueño}}}}''<br />Act II, Scene 19, lines 1197–1201
|attr2={{tsl|en|Denis Florence Mac-Carthy||Denis Florence Mac-Carthy}}
}}
{{Reflist}}
Renders as
  1. ^ Calderón de la Barca, Pedro. Comfort, William Wistar , 编. La vida es sueño. New York: American Book Company. 1904: 104. 
  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:

代码 效果
{{Verse translation|lang=ka|italicsoff=y|
მელნად ვიხმარე გიშრის ტბა და კალმად მე ნა რხეული,
ვინცა ისმინოს, დაესვას ლახვარი გულსა ხეული.
|attr1=[[紹塔·魯斯塔韋利|Shota Rustaveli]]: from ''{{tsl|en|The Knight in the Panther's Skin||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.}}

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英语right-to-left languages like Arabic, as exemplified below:

代码 效果
{{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}}

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 {{=}} 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:

代码 效果
Text.
<blockquote>Indented text.</blockquote>
More text.

Text.

Quoted text.

More text.

代码 效果
Text.
<poem style="margin-left: 3em; font-style:italic">Indented text.</poem>
More text.

Text.

Indented text.

More text.

However, it looks markedly different on mobile, and lacks the semantics of <blockquote>.

Prose[编辑]

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

TemplateData[编辑]

Use this template to provide a side-by-side translation of a text

模板参数[编辑模板数据]

参数描述类型状态
Original text1

无描述

自动值
未知必需
Translation2

无描述

未知可选
Language code (original text)lang

ISO 639 language code or IETF language tag for the first column of text.

示例值
fr
未知可选
Italics (original text)italicsoff

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.

示例值
y
未知可选
Right-to-left (original text)rtl1

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.

示例值
y
未知可选
Attribution (original text)attr1

Attribution(s) for the original text

示例值
Rene Descartes (1644), ''Principles of Philosophy''
未知可选
Attribution (translation)attr2

Attribution(s) for the translation

示例值
John Smith (1959)
未知可选
Width (all texts)width

Limit the width of the template enclosing entire content.

示例值
100%
未知可选

See also[编辑]

  • {{Quote}}——不带边框的引用,可设定高度。
    • {{QuoteH}}——和{{QuoteF}}成對使用,作為{{Quote}}的補充。
    • {{Poemquote}}——引用詩歌、歌詞等頻頻斷行的引文,與{{Quote}}相同。
  • {{Verse translation}}——引用外文詩歌、歌詞等引文,並附上譯文

带边框式

  • {{Wquote}}——带柔和渐变的灰色阴影,采用圆角。
  • {{现代显示框}}——同样带柔和渐变的灰色阴影,但更为柔和、没有圆角,且更为美观。
  • {{现代蓝边、渐变底纹显示框}}——框内由上至下呈现白色至蓝色的渐变,非常柔和,边线偏蓝且较为柔和。
  • {{Quote box}}——带边框的引用,在一个缩小的浮动框中。
  • {{Quote frame}}——带边框的引用。
  • {{Squote}}——带边框的引用,有立體感。

带引号式

  • {{Cquote}}——带引号标记的抬升式引用,采用页面宽度。
  • {{Rquote}}——带引号标记的抬升式引用,在一个缩小的区域中。

讨论页