Jump to content

Template:Translation table/doc

From Wikipedia, the free encyclopedia

Usage

[edit]

This template renders a two-column translation table using the language codes provided by the user. It supports both named and unnamed (positional) text/translation pairs.

Syntax

[edit]
{{Translation table
|lang1code=es
|lang2code=en
|hola|hello
|uno|one
|dos|two
}}
Output
Spanish English
hola hello
uno one
dos two

You can also use named pairs for the same effect:

{{Translation table
|lang1code=ja
|lang2code=en
|text1=ありがとう |trans1=thank you
|text2=さようなら |trans2=goodbye
}}
Output
Japanese English
ありがとう thank you
さようなら goodbye

Notes

[edit]
  • Uses {{Lang}} under the hood for accessibility (adds lang attribute).
  • Accepts italic/bold/link formatting (via `Langx`).
  • Automatically derives column headers using {{ISO 639 name}}.

TemplateData

[edit]
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Translation table in articles based on its TemplateData.

TemplateData for Translation table

Renders a two-column translation table using language codes and the {{Lang}} template for proper internationalization. It is not recommended to use this template while using the visual editor.

Template parameters

ParameterDescriptionTypeStatus
Language 1 codelang1code lang1

Language code for the first column (e.g. 'es' for Spanish)

Example
es
Stringrequired
Language 2 codelang2code lang2

Language code for the second column (e.g. 'en' for English)

Example
en
Stringrequired
Use "wikitext" table classwikitextclass

Whether or not to set the table class to "wikitext". This will not affect your ability to put wikitext into the table.

Auto value
true
Booleanoptional
Show Romanizationshowromanization

Shows romaji/pinyin/etc.

Default
false
Auto value
false
Booleanoptional
Sortablesortable

If the table should be sortable or not

Default
false
Auto value
false
Booleanoptional
First text valuetext1

First source-language word or phrase

Example
hola
Stringoptional
First translationtrans1

First translated word or phrase

Example
hello
Stringoptional
Second text valuetext2

no description

Stringoptional
Second translationtrans2

no description

Stringoptional