Template:String: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Undo revision 403127 by Max34 (talk))
Tag: Undo
m (Removed functionality that is no longer needed)
Line 1: Line 1:
<includeonly><onlyinclude>{{#switch: {{{input|}}}
<includeonly><onlyinclude>{{{{{{>{{{force|{{intlang}}}}}}}}|{{{{{{force|{{intlang}}}}}|{{{{{{default|}}}|{{{en|}}}}}}}}}}}}</onlyinclude></includeonly>
| {{{id|}}} = {{{{{{>{{{force|{{intlang}}}}}}}}|{{{{{{force|{{intlang}}}}}|{{{{{{default|}}}|{{{en|}}}}}}}}}}}}
Alternative version of {{Tl|Autolang}} template.  
| + = +{{{+{{{force|{{intlang}}}}}|0}}}
| all = +{{{+{{{default|}}}|{{{+en|0}}}}}}
}}</onlyinclude></includeonly>
{{Warning|Designed for the new page format. Please do not use or edit this template yet.}}


{{CodeBlock|src=Example|lines=10|<nowiki>{{String
| default = es // Allows you to specify which translation is the main one. By default it is equal to "en".
| force = ru // Causes a string to be loaded in a specific language (if it is translated into it). This parameter is mainly for testing purposes.


Alternative version of {{Tl|autolang}} template.
| en = Hello, User! // English String. Even if {{{default}}} is specified, if there is no translation in that language, English will be used.
 
| eo = Saluton, Uzanto! // Spanish String.
{{CodeBlock|src=Example|lines=14|<nowiki>{{String
| ru = Здравствуй, пользователь! // Russian String.
| id = Hello // Id of this string. If the input parameter is equal to id, the string will be displayed.
|>es = eo // A language code with a ">" at the begining means that the language refers to another language. This allows to avoid repeating the same text if it is completely identical in two or more languages
| input = {{{1|}}} // Input value. You can count the lines by entering "all" in this parameter or count their translations by entering "+".
|>el = eo // If you referring one language to another, link to that translation, do not link to another link. In this example, writing >el = es (or >el = >es) will be incorrect.
| force = {{{force|{{intlang}}}}} // Causes a string to be loaded in a specific language (if it is translated into it).
| default = es // Allows you to specify which translation is the main one. It will also be taken into account in calculating the total number of strings. By default it is equal to "en"
 
|+en = 1 // A special parameter that adds translation to the total count of translated strings.
| en = Hello, User! // String in this language.
 
|+ru = 1
| eo = Saluton, Uzanto!
 
|+es = 1
|>es = eo // A language code with a ">" at the begining means that the language refers to another language. This allows to avoid repeating the same text if it is completely identical in two or more languages
}}</nowiki>}}
}}</nowiki>}}

Revision as of 23:27, 17 June 2024

Alternative version of {{Autolang}} template.

Example
  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
{{String | default = es // Allows you to specify which translation is the main one. By default it is equal to "en". | force = ru // Causes a string to be loaded in a specific language (if it is translated into it). This parameter is mainly for testing purposes. | en = Hello, User! // English String. Even if {{{default}}} is specified, if there is no translation in that language, English will be used. | eo = Saluton, Uzanto! // Spanish String. | ru = Здравствуй, пользователь! // Russian String. |>es = eo // A language code with a ">" at the begining means that the language refers to another language. This allows to avoid repeating the same text if it is completely identical in two or more languages |>el = eo // If you referring one language to another, link to that translation, do not link to another link. In this example, writing >el = es (or >el = >es) will be incorrect. }}