From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Content translation/Templates and the translation is 50% complete.

Other languages:
Deutsch • ‎English • ‎dansk • ‎español • ‎français • ‎italiano • ‎lietuvių • ‎português • ‎български • ‎русский • ‎עברית • ‎العربية • ‎মেইতেই লোন্ • ‎ಕನ್ನಡ • ‎中文 • ‎日本語 • ‎한국어


翻訳インタフェースでテンプレートをクリックすると、サイドバーにカードが表示され、原語のテンプレートの名前を表示します。もし対応するテンプレートが目的言語にあり言語間リンクを設定してあると、その名前も併記されます。反対に対応するものがない場合にはカードに「$1 には機械翻訳は利用できません」と表示されます。






The template editor will show side-by-side all the parameters in the source and the target languages.

The value of the parameter from the source language will be automatically copied to the target language if the following conditions are true:

  • There is a parameter with an identical name.
  • There is a parameter for which an alias is defined in TemplateData with the same name as the parameter in the source language.

If a parameter cannot be found automatically in any of the ways listed above, the translator will have to find them and fill them one by one. Clicking a field in the template editor next to the source field will automatically fill the parameter value. The translator must select the appropriate parameter name from the "Select target field" drop-down list in the field. Note that the structure of template parameters in different languages is often not the same, and you have to write the parameters in a way that is correct in the wiki into which you are translating.

When you have filled all the parameters, close the translation editor. This will save your edits and show the template as it will appear after you publish the article.


For example, the translation of the infobox at the top of the article "Yoshida Castle" from English to Portuguese shows an example of translating a whole template:

Yoshida Castle en-pt 1.png To start translation of a template, click a paragraph as you usually do to translate it.
Yoshida Castle en-pt 2.png When you start translating the template will show with partial or even confusing information. Click the inserted template again to edit it.
Yoshida Castle en-pt 3.png Click a template parameter field that you want to transfer to the translated article.
Yoshida Castle en-pt 4.png The value will be copied from the source article. Select the name of the parameter. Edit the value to make it correct for your language.
Yoshida Castle en-pt 6.png To add a field that is not available in the source article, click "Add more properties" at the bottom of the template editor. Here, for example, it is the name of a castle in its original language, Japanese.
Yoshida Castle en-pt 7.png Keep filling all the template fields that you need.
Yoshida Castle en-pt 8.png When done, close the template editor. The complete template will be shown. The design of the template may look different in the language into which you are translating, but the important part is to check that your parameter values were inserted correctly.





To make templates translatable more easily, please use these tips:


TemplateData is a technology for describing each template and its parameters in a precise and machine-readable way. It helps wiki editors who use the visual editor fill the template parameters, and the same data is used by Content Translation.

  • Create TemplateData for templates in your wiki.
  • Make sure that TemplateData is updated every time that the template itself is updated.
  • If the name of a parameter in your wiki is different from the name of the equivalent parameter in a wiki from which articles are frequently translated into your wiki, add an alias with that parameter. If you do this, the parameter value will be automatically pre-filled when translating.
    • For example, articles are frequently translated from English to Spanish. In an infobox that describes a city, the English name of a parameter may be "mayor", and the Spanish name may be "alcalde". In the Spanish template, define "alcalde" as the parameter name, and "mayor" as its alias.
    • For practical purposes, you don't have to define aliases that correspond to all languages, but only to those from articles are translated frequently. You can find which languages those are by looking at the page Special:CXStats at your wiki.
  • Give parameters clear, human-readable labels. A name is the name of the parameter that is inserted into the wiki syntax, and the label is what is shown to the editors in the template editing forms in the visual editor and in Content Translation.
  • Write descriptions for the parameters whenever possible.
    • Explain what is supposed to be the parameter's format: plain text, link, another template, a particular set of values, etc.
    • If a parameter can be filled automatically from Wikidata, note it in the description.


パラメータの構造が言語により異なる率は高いです。画像の扱いを一例とすると、特定の言語によっては完全形のファイルリンクとして記述し(例:{{Infobox person|image=[[File:Sophie Kowalevski.jpg|thumb|300px|Sofia Kovalevskaya, 1880]]}})、別の言語ではファイル名やサイズ、キャプションのそれぞれに個別のパラメータを使います(例:{{Infobox person|name=Sofia Kovalevskaya|image=Sophie Kowalevski.jpg|image_size=300|caption=Sofia Kovalevskaya, 1880}})。パラメータ構造を、翻訳元になる確率が高い言語版と翻訳版でなるべく同じにすると、翻訳者も記事の編集や管理をする人も作業を効率化できます。

Some templates are unbalanced, that is, one template begins a section by inserting some opening HTML tags or wiki syntax, and another templates ends the section by inserting the corresponding tags. For example, this is done in some languages for columns layout. Such templates are generally problematic, and they are especially hard to translate, and they can usually be replaced by a balanced template, which includes all the necessary syntax in itself.


Make templates more Wikidata-enabled by making them pull parameter values from Wikidata. Such templates are becoming more and more common in some wikis, among them Russian, Estonian, Hebrew, Catalan, and others. When a parameter is pulled from Wikidata, it doesn't have to be filled by the article translators at all (although its label may have to be translated in Wikidata).



  • 出典内でテンプレートを編集できな(バグの報告先
  • テンプレートのパラメータは、テンプレート翻訳機能を実際に閉じないと保存されない(バグの報告先