Template:Translation projects: Difference between revisions

From Terraria Wiki
Jump to navigation Jump to search
m ({{language info}} en=?)
(Moved displaytitle code to {{common}} because this template is no longer called on all pages.)
 
Line 15: Line 15:
--></indicator><!--
--></indicator><!--


// displaytitle preparation
// displaytitle preparation, for {{common}}
-->{{#ifeq:{{NAMESPACENUMBER}}|0|<!--
-->{{#ifeq:{{NAMESPACENUMBER}}|0|<!--
-->{{#vardefine:_trp:_displaytitle|{{{displaytitle|{{tr|{{BASEPAGENAME}}}}}}}}}<!--
-->{{#vardefine:__global__trp_displaytitle|{{{displaytitle|{{tr|{{BASEPAGENAME}}}}}}}}}<!--
-->{{#vardefine:_trp:_displaytitle_suffix|&ensp;{{note|small=y|({{FULLPAGENAME}})}}}}<!-- not using {{note|paren=y}} because we want to force English parentheses
-->{{#vardefine:__global__trp_displaytitle_suffix|&ensp;{{note|small=y|({{FULLPAGENAME}})}}}}<!-- not using {{note|paren=y}} because we want to force English parentheses
-->}}<!--
-->}}<!--


Line 25: Line 25:


-->}}<!-- end of if
-->}}<!-- end of if

// displaytitle
-->{{#if:{{#var:__global__is_italic_title}}|<!-- the global var is set in {{italic title}}
-->{{#vardefine:_trp:_displaytitle|{{#if:{{#var:_trp:_displaytitle}}|<!--
--><i>{{#var:_trp:_displaytitle}}</i><!--
-->|<!--
-->{{#ifeq:{{NAMESPACENUMBER}}|0||{{NAMESPACE}}:}}<i>{{PAGENAME}}</i><!-- don't italicize the namespace
-->}}}}<!--
-->}}<!--
-->{{#if:{{#var:_trp:_displaytitle}}|{{DISPLAYTITLE:{{#var:_trp:_displaytitle}}{{#var:_trp:_displaytitle_suffix}}|noreplace}}}}<!--


--></includeonly><noinclude>{{doc}}
--></includeonly><noinclude>{{doc}}

Latest revision as of 17:12, 24 June 2022

Template-info.svg Documentation The documentation below is transcluded from Template:Translation projects/doc. (edit | history)

This template helps organizing the many translation projects of the Terraria Wiki. It is transcluded by {{language info}}, so there is no need to transclude it manually anywhere.

Effects

It handles two tasks:

  1. Indexing a page, i.e. categorizing it appropriately and adding an identifier to it.
  2. Translating the page's title.

The template is fully automatic, hence it takes the information it needs for the first task from the article's title and the information it needs for the second task from the wiki's page database.

Indexing

The category will be the respective <language> translation category, found in the main category. The identifier consists of a flag of the country that the language is generally associated with. It will be visible in the upper right corner of the page, in the page status indicator section. It can be clicked to reveal a banner with a short informational sentence and clicked again to hide it again.

Language Language code Category Flag
Arabic ar Arabic translation Flag eg.svg
Bulgarian bg Bulgarian translation Flag bg.svg
Czech cs Czech translation Flag cz.svg
Danish da Danish translation Flag dk.svg
Greek el Greek translation Flag gr.svg
Spanish es Spanish translation Flag es.svg
Finnish fi Finnish translation Flag fi.svg
Hindi hi Hindi translation Flag in.svg
Indonesian id Indonesian translation Flag id.svg
Italian it Italian translation Flag it.svg
Japanese ja Japanese translation Flag jp.svg
Lithuanian lt Lithuanian translation Flag lt.svg
Latvian lv Latvian translation Flag lv.svg
Dutch nl Dutch translation Flag nl.svg
Norwegian no Norwegian translation Flag no.svg
Romanian ro Romanian translation Flag ro.svg
Slovak sk Slovak translation Flag sk.svg
Swedish sv Swedish translation Flag se.svg
Thai th Thai translation Flag th.svg
Turkish tr Turkish translation Flag tr.svg
Vietnamese vi Vietnamese translation Flag vn.svg
Cantonese yue Cantonese translation Flag cn.svg

Usage

{{ translation projects | displaytitle = <translated page title> }}

Since this template is transcluded by {{language info}}, the parameter must be passed to that template, i.e.:

{{ language info | displaytitle = <translated page title> }}

displaytitle

Use this parameter to provide a custom translation of the page title. It defaults to {{tr}}, and can thus usually be omitted.