Difference between revisions of "Template:WA VersionHistory"

From Worms Knowledge Base

Jump to: navigation, search
(Usage: Correcting a little mistake)
(Use the new format. Also update the template documentation.)
Line 1: Line 1:
{{#switch:{{{1|}}}|
+
{{WA VersionHistory/core2|lang={{{1|en}}}}}<noinclude>
|en={{WA VersionHistory/core|W:A Version History|Worms Armageddon ReadMe (English)|| Beta Update|v3.5 | Update}}
+
|es={{WA VersionHistory/core|W:A Historial de Versiones|Léeme de Worms Armageddon|Actualizaciones del Beta ||Actualizaciones del | v3.5}}
+
|ru={{WA VersionHistory/core|История версий W:A|Worms Armageddon ReadMe (Russian)|| Beta Update|v3.5 | Update}}
+
|fr={{WA VersionHistory/core|Historique des versions de W:A|http://worms2d.info/Worms_Armageddon_ReadMe_%28French%29|| Beta Update|v3.5 | Update}}
+
<!--
+
(add new languages above this comment)
+
-->}}<noinclude>
+
 
----
 
----
 
This navbox should help people navigate inside the version history pages.
 
This navbox should help people navigate inside the version history pages.
Line 29: Line 22:
 
==Adding a new language==
 
==Adding a new language==
  
To add a new language, you have to translate the following texts:
+
This template uses a string table for localized strings. The string table is a sub-template with the name like [[Template:WA VersionHistory/en]]. To add a new language, create a sub-template with your language code in the name.
 +
 
 +
Then copy and paste the content below to your new sub-template:
 +
 
 +
<nowiki>{{#switch:{{{string|}}}|</nowiki>
 +
|title=
 +
|v35LinkName=
 +
|betaLinkName=
 +
|alphaLinkName=
 +
|releaseLinkName=
 +
<nowiki>}}</nowiki>
 +
 
 +
You need to translate the following strings:
  
 
{|
 
{|
 
|-
 
|-
 +
! String ID
 
! Description
 
! Description
! Text &amp; Parameters (used later)
+
! Example string in English
! English version
+
 
|-
 
|-
 +
| <code>title</code>
 
| Navbox title
 
| Navbox title
| <tt><span style="color: green;">{{{1}}}</span></tt>
+
| W:A Version History
| <span style="color: green;">W:A Version History</span>
+
 
|-
 
|-
| Link to the readme page
+
| <code>v35LinkName</code>
| <tt><span style="color: green;">{{{2}}}</span></tt>
+
| Links to the v3.5 Beta update subpages
| [[Worms Armageddon ReadMe (English)|<span style="color: green;">Worms_Armageddon_ReadMe_(English)</span>]]
+
| Worms Armageddon ReadMe (English)/v3.5 Beta {{{ver}}} Update
 
|-
 
|-
| Links to the v3.6.x.x Beta update subpages
+
| <code>betaLinkName</code>
| <tt><span style="color: green;"><nowiki>{{{3|}}}</nowiki></span>v3.6.x.x<span style="color: green;"><nowiki>{{{4|}}}</nowiki></span></tt>
+
| Links to the Beta update subpages
| v3.6.x.x<span style="color: green;">_Beta_Update</span>
+
| Worms Armageddon ReadMe (English)/v{{{ver}}} Beta Update
 
|-
 
|-
| Links to the v3.5 Beta update subpages
+
| <code>alphaLinkName</code>
| <tt><span style="color: green;"><nowiki>{{{5|}}}</nowiki></span>Beta N<span style="color: green;"><nowiki>{{{6|}}}</nowiki></span></tt>
+
| Link to the Alpha update subpage
| <span style="color: green;">v3.5_</span>Beta N<span style="color: green;">_Update</span>
+
| Worms Armageddon ReadMe (English)/v{{{ver}}} Alpha Update
 
|-
 
|-
|colspan="3" style="text-align: center;"| ''Note: the spaces inside the links are converted to underscores (_) for visibility.''
+
| <code>releaseLinkName</code>
 +
| Link to the stable update subpage
 +
| Worms Armageddon ReadMe (English)/v{{{ver}}} Update
 
|}
 
|}
  
Once the translation is complete, add the following to the template code ''inside the #switch parameters'':
+
The {{{ver}}} token will be expanded with the version number for each W:A update. They are used differently among string IDs, so please pay attention.
 +
 
 +
For <code>v35LinkName</code>, {{{ver}}} will be expanded with either '1' or '2' (without quotes). This is for v3.5 Beta 1 and Beta 2, respectively. So,
 +
 
 +
Worms Armageddon ReadMe (English)/v3.5 Beta {{{ver}}} Update
 +
 
 +
becomes
 +
 
 +
[[Worms Armageddon ReadMe (English)/v3.5 Beta 1 Update]]
 +
[[Worms Armageddon ReadMe (English)/v3.5 Beta 2 Update]]
 +
 
 +
For <code>betaLinkName</code>, <code>alphaLinkName</code>, and <code>releaseLinkName</code>, {{{ver}}} will be expanded with the version number, but without the 'v' letter that we often write in something like 'v3.7.0.0'. So,
 +
 
 +
Worms Armageddon ReadMe (English)/v{{{ver}}} Beta Update
 +
Worms Armageddon ReadMe (English)/v{{{ver}}} Alpha Update
 +
Worms Armageddon ReadMe (English)/v{{{ver}}} Update
 +
 
 +
will become
 +
 
 +
[[Worms Armageddon ReadMe (English)/v3.6.19.7 Beta Update]]
 +
...
 +
[[Worms Armageddon ReadMe (English)/v3.6.31.0 Beta Update]]
 +
[[Worms Armageddon ReadMe (English)/v3.6.31.2b Alpha Update]]
 +
[[Worms Armageddon ReadMe (English)/v3.7.0.0 Update]]
 +
 
 +
Because {{{ver}}} is never expanded with the letter 'v', the above example adds the 'v' before the {{{ver}}} token.
 +
 
 +
===Content of [[Template:WA VersionHistory/en]]===
  
  |<span style="color: green;">language code</span>=<nowiki>{{</nowiki>WA VersionHistory/core|<span style="color: green;">{{{1}}}</span>|<span style="color: green;">{{{2}}}</span>|<span style="color: green;"><nowiki>{{{3|}}}</nowiki></span>|<span style="color: green;"><nowiki>{{{4|}}}</nowiki></span>|<span style="color: green;"><nowiki>{{{5|}}}</nowiki></span>|<span style="color: green;"><nowiki>{{{6|}}}</nowiki></span><nowiki>}}</nowiki>
+
  <nowiki>{{#switch:{{{string|}}}|</nowiki>
 +
|title=W:A Version History
 +
|v35LinkName=Worms Armageddon ReadMe (English)/v3.5 Beta {{{ver}}} Update
 +
|betaLinkName=Worms Armageddon ReadMe (English)/v{{{ver}}} Beta Update
 +
|alphaLinkName=Worms Armageddon ReadMe (English)/v{{{ver}}} Alpha Update
 +
|releaseLinkName=Worms Armageddon ReadMe (English)/v{{{ver}}} Update
 +
<nowiki>}}</nowiki>
  
for example, in English:
 
  
|en=<nowiki>{{</nowiki>[[Template:WA VersionHistory/core|WA VersionHistory/core]]|W:A Version History|Worms Armageddon ReadMe (English)|| Beta Update|v3.5 | Update<nowiki>}}</nowiki>
 
Please be careful when adding spaces; those in the start or end of parameters are preserved when transcluding. [http://meta.wikimedia.org/wiki/Help:Newlines_and_spaces#Trimming_on_expansion]
 
 
</noinclude>
 
</noinclude>

Revision as of 06:24, 28 February 2013

W:A Version History
v3.5 Beta 1 • Beta 2
v3.6.x.x 19.7 (.11 • .12 • .14 • .15 • .17 • .17a • .18 • .19) • 20.1 (.2 • .3) • 21.1 (.2 • .3) • 22.1 • 23.0 (.1 • .2) • 24.1 (.2) • 25.1a • 26.4 (.5) • 28.0 • 29.0 • 30.0 • 31.0 • 31.2b
v3.7.x.x 0.0 • 2.1
v3.8.x 0 • 1

This navbox should help people navigate inside the version history pages.

Usage

{{WA VersionHistory|language code}}

The language will default to English (en) if the parameter is empty.

Language codes supported

  • en : English
  • es : Spanish
  • ru : Russian
  • fr : French

Example

{{WA VersionHistory|en}}
{{WA VersionHistory|es}}
{{WA VersionHistory|ru}}
{{WA VersionHistory|fr}}

Adding a new language

This template uses a string table for localized strings. The string table is a sub-template with the name like Template:WA VersionHistory/en. To add a new language, create a sub-template with your language code in the name.

Then copy and paste the content below to your new sub-template:

{{#switch:{{{string|}}}|
|title=
|v35LinkName=
|betaLinkName=
|alphaLinkName=
|releaseLinkName=
}}

You need to translate the following strings:

String ID Description Example string in English
title Navbox title W:A Version History
v35LinkName Links to the v3.5 Beta update subpages Worms Armageddon ReadMe (English)/v3.5 Beta {{{ver}}} Update
betaLinkName Links to the Beta update subpages Worms Armageddon ReadMe (English)/v{{{ver}}} Beta Update
alphaLinkName Link to the Alpha update subpage Worms Armageddon ReadMe (English)/v{{{ver}}} Alpha Update
releaseLinkName Link to the stable update subpage Worms Armageddon ReadMe (English)/v{{{ver}}} Update

The {{{ver}}} token will be expanded with the version number for each W:A update. They are used differently among string IDs, so please pay attention.

For v35LinkName, {{{ver}}} will be expanded with either '1' or '2' (without quotes). This is for v3.5 Beta 1 and Beta 2, respectively. So,

Worms Armageddon ReadMe (English)/v3.5 Beta {{{ver}}} Update

becomes

Worms Armageddon ReadMe (English)/v3.5 Beta 1 Update
Worms Armageddon ReadMe (English)/v3.5 Beta 2 Update

For betaLinkName, alphaLinkName, and releaseLinkName, {{{ver}}} will be expanded with the version number, but without the 'v' letter that we often write in something like 'v3.7.0.0'. So,

Worms Armageddon ReadMe (English)/v{{{ver}}} Beta Update
Worms Armageddon ReadMe (English)/v{{{ver}}} Alpha Update
Worms Armageddon ReadMe (English)/v{{{ver}}} Update

will become

Worms Armageddon ReadMe (English)/v3.6.19.7 Beta Update
...
Worms Armageddon ReadMe (English)/v3.6.31.0 Beta Update
Worms Armageddon ReadMe (English)/v3.6.31.2b Alpha Update
Worms Armageddon ReadMe (English)/v3.7.0.0 Update

Because {{{ver}}} is never expanded with the letter 'v', the above example adds the 'v' before the {{{ver}}} token.

Content of Template:WA VersionHistory/en

{{#switch:{{{string|}}}|
|title=W:A Version History
|v35LinkName=Worms Armageddon ReadMe (English)/v3.5 Beta {{{ver}}} Update
|betaLinkName=Worms Armageddon ReadMe (English)/v{{{ver}}} Beta Update
|alphaLinkName=Worms Armageddon ReadMe (English)/v{{{ver}}} Alpha Update
|releaseLinkName=Worms Armageddon ReadMe (English)/v{{{ver}}} Update
}}


Personal tools