模板:Verse translation/doc

出自Local Chinese Wikipedia
跳至導覽 跳至搜尋

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: 頁面Template:Markup/styles.css沒有內容。

原始碼 效果Lua錯誤:expandTemplate: template "format item" does not exist。

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: 頁面Template:Markup/styles.css沒有內容。

原始碼 效果Lua錯誤:expandTemplate: template "format item" does not exist。

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: 頁面Template:Markup/styles.css沒有內容。

原始碼 效果Lua錯誤:expandTemplate: template "format item" does not exist。

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: 頁面Template:Markup/styles.css沒有內容。

原始碼 效果Lua錯誤:expandTemplate: template "format item" does not exist。

頁面Template:Markup/styles.css沒有內容。

原始碼 效果Lua錯誤:expandTemplate: template "format item" does not exist。

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[編輯]

<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)" }, "width": { "label": "Width (all texts)", "description": "Limit the width of the template enclosing entire content.", "example": "100%" } }, "paramOrder": [ "1", "2", "lang", "italicsoff", "rtl1", "attr1", "attr2",

       "width"

] } </templatedata>

See also[編輯]

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

帶邊框式

  • {{Wquote}}——帶柔和漸變的灰色陰影,採用圓角。
  • {{現代顯示框}}——同樣帶柔和漸變的灰色陰影,但更為柔和、沒有圓角,且更為美觀。
  • {{現代藍邊、漸變底紋顯示框}}——框內由上至下呈現白色至藍色的漸變,非常柔和,邊線偏藍且較為柔和。
  • {{Quote box}}——帶邊框的引用,在一個縮小的浮動框中。
  • {{Quote frame}}——帶邊框的引用。
  • {{Squote}}——帶邊框的引用,有立體感。

帶引號式

  • {{Cquote}}——帶引號標記的抬升式引用,採用頁面寬度。
  • {{Rquote}}——帶引號標記的抬升式引用,在一個縮小的區域中。

討論頁

參見