Difference between revisions of "Template:Updates/core"

From Team Fortress Wiki
Jump to: navigation, search
m
(Rewrite template and documentation to allow different displays of dates for other language pages.)
Line 1: Line 1:
 
<includeonly>{{#switch:{{{1|{{{type|}}}}}}
 
<includeonly>{{#switch:{{{1|{{{type|}}}}}}
| patch = {{#switch:{{SUBPAGENAME}}<!--
 
  
//
+
| patch = [[{{lang date|force=en|1={{{patch-month}}}}} {{{patch-day}}}, {{{patch-year}}} Patch{{if lang}}|{{lang
// PATCHES
+
  | cs = {{{patch-day}}} {{lang date|{{{patch-month}}}}} {{{patch-year}}}
//
+
  | de = {{{patch-day}}}. {{lang date|{{{patch-month}}}}} {{{patch-year}}}
 +
  | en = {{lang date|{{{patch-month}}}}} {{{patch-day}}}, {{{patch-year}}}
 +
  | es = {{{patch-day}}} {{lang date|{{{patch-month}}}}} {{{patch-year}}}
 +
  | fr = {{{patch-day}}} {{lang date|{{{patch-month}}}}} {{{patch-year}}}
 +
  | pl = {{{patch-day}}} {{lang date|{{{patch-month}}}}} {{{patch-year}}}
 +
  | pt = {{{patch-day}}} {{lang date|{{{patch-month}}}}} {{{patch-year}}}
 +
  | pt-br = {{{patch-day}}} {{lang date|{{{patch-month}}}}} {{{patch-year}}}
 +
  | ro = {{{patch-day}}} {{lang date|{{{patch-month}}}}} {{{patch-year}}}
 +
  | ru = {{{patch-day}}} {{lang date|{{{patch-month}}}}} {{{patch-year}}}
 +
  }}]]
  
  // dd mm yyyy -- "Date Month Year" (without comma) DATE FORMATTING -->
+
| patch-beta = [[Patches (Beta){{if lang}}|{{lang
  | cs
+
| cs = {{{patch-beta-day}}} {{lang date|{{{patch-beta-month}}}}} {{{patch-beta-year}}}
  | es
+
| de = {{{patch-beta-day}}}. {{lang date|{{{patch-beta-month}}}}} {{{patch-beta-year}}}
  | de
+
| en = {{lang date|1={{{patch-beta-month}}}}} {{{patch-beta-day}}}, {{{patch-beta-year}}}
  | fr
+
| es = {{{patch-beta-day}}} {{lang date|{{{patch-beta-month}}}}} {{{patch-beta-year}}}
  | pl
+
| fr = {{{patch-beta-day}}} {{lang date|{{{patch-beta-month}}}}} {{{patch-beta-year}}}
  | pt
+
| pl = {{{patch-beta-day}}} {{lang date|{{{patch-beta-month}}}}} {{{patch-beta-year}}}
  | pt-br
+
| pt = {{{patch-beta-day}}} {{lang date|{{{patch-beta-month}}}}} {{{patch-beta-year}}}
  | ro
+
| pt-br = {{{patch-beta-day}}} {{lang date|{{{patch-beta-month}}}}} {{{patch-beta-year}}}
  | ru = [[{{lang date|force=en|1={{{patch-month}}}}} {{{patch-day}}}, {{{patch-year}}} Patch{{if lang}}|<!--  
+
| ro = {{{patch-beta-day}}} {{lang date|{{{patch-beta-month}}}}} {{{patch-beta-year}}}
            -->{{{patch-day}}} {{lang date|1={{{patch-month}}}}} {{{patch-year}}}]]<!--
+
| ru = {{{patch-beta-day}}} {{lang date|{{{patch-beta-month}}}}} {{{patch-beta-year}}}
 +
}}]]
  
  // mm dd, yyyy -- "Month Date, Year" (with comma) DATE FORMATTING [default] -->
+
| blog = [http://www.teamfortress.com/post.php?id={{{blog-id}}} {{lang
  | blank
+
| cs = {{{blog-day}}} {{lang date|1={{{blog-month}}}}} {{{blog-year}}}
  | none
+
| de = {{{blog-day}}}. {{lang date|1={{{blog-month}}}}} {{{blog-year}}}
  | en
+
| en = {{lang date|{{{blog-month}}}}} {{{blog-day}}}, {{{blog-year}}}
  | #default = [[{{lang date|force=en|1={{{patch-month}}}}} {{{patch-day}}}, {{{patch-year}}} Patch{{if lang}}|<!--  
+
| es = {{{blog-day}}} {{lang date|1={{{blog-month}}}}} {{{blog-year}}}
            -->{{lang date|1={{{patch-month}}}}} {{{patch-day}}}, {{{patch-year}}}]]
+
| fr = {{{blog-day}}} {{lang date|1={{{blog-month}}}}} {{{blog-year}}}
  }}
+
| pl = {{{blog-day}}} {{lang date|1={{{blog-month}}}}} {{{blog-year}}}
 +
| pt = {{{blog-day}}} {{lang date|1={{{blog-month}}}}} {{{blog-year}}}
 +
| pt-br = {{{blog-day}}} {{lang date|1={{{blog-month}}}}} {{{blog-year}}}
 +
| ro = {{{blog-day}}} {{lang date|1={{{blog-month}}}}} {{{blog-year}}}
 +
| ru = {{{blog-day}}} {{lang date|1={{{blog-month}}}}} {{{blog-year}}}
 +
}}]
  
| patch-beta = {{#switch:{{SUBPAGENAME}}<!--
 
 
//
 
// BETA PATCHES
 
//
 
 
  // dd mm yyyy -- "Date Month Year" (without comma) DATE FORMATTING -->
 
  | cs
 
  | es
 
  | de
 
  | fr
 
  | pl
 
  | pt
 
  | pt-br
 
  | ro
 
  | ru = [[Patches (Beta){{if lang}}|{{{patch-beta-day}}} {{lang date|1={{{patch-beta-month}}}}} {{{patch-beta-year}}}]]<!--
 
  | sv
 
 
  // mm dd, yyyy -- "Month Date, Year" (with comma) DATE FORMATTING [default] -->
 
  | blank
 
  | none
 
  | en
 
  | #default = [[Patches (Beta){{if lang}}|{{lang date|1={{{patch-beta-month}}}}} {{{patch-beta-day}}}, {{{patch-beta-year}}}]]
 
  }}
 
 
| blog = [http://www.teamfortress.com/post.php?id={{{blog-id}}} {{#switch:{{SUBPAGENAME}}<!--
 
 
//
 
// BLOG
 
//
 
 
  // dd mm yyyy -- "Date Month Year" (without comma) DATE FORMATTING -->
 
  | cs
 
  | es
 
  | de
 
  | fr
 
  | pl
 
  | pt
 
  | pt-br
 
  | ro
 
  | ru = {{{blog-day}}} {{lang date|1={{{blog-month}}}}} {{{blog-year}}}<!--
 
  | sv
 
 
  // mm dd, yyyy -- "Month Date, Year" (with comma) DATE FORMATTING <default> -->
 
  | blank
 
  | none
 
  | en
 
  | #default = {{lang date|{{{blog-month}}}}} {{{blog-day}}}, {{{blog-year}}}
 
  }}]<!--
 
 
//
 
// DAYS AGO
 
//
 
 
-->
 
 
| patch-daysago      = {{Days ago|1={{{patch-year}}}|2={{{patch-month}}}|3={{{patch-day}}}}}
 
| patch-daysago      = {{Days ago|1={{{patch-year}}}|2={{{patch-month}}}|3={{{patch-day}}}}}
 
| patch-beta-daysago = {{Days ago|1={{{patch-beta-year}}}|2={{{patch-beta-month}}}|3={{{patch-beta-day}}}}}
 
| patch-beta-daysago = {{Days ago|1={{{patch-beta-year}}}|2={{{patch-beta-month}}}|3={{{patch-beta-day}}}}}
| blog-daysago      = {{Days ago|1={{{blog-year}}}|2={{{blog-month}}}|3={{{blog-day}}}}}<!--
+
| blog-daysago      = {{Days ago|1={{{blog-year}}}|2={{{blog-month}}}|3={{{blog-day}}}}}
  
// Raw numbers
 
 
-->
 
 
| patch-month = {{{patch-month|}}}
 
| patch-month = {{{patch-month|}}}
 
| patch-day = {{{patch-day|}}}
 
| patch-day = {{{patch-day|}}}
Line 99: Line 55:
 
| blog-day = {{{blog-day|}}}
 
| blog-day = {{{blog-day|}}}
 
| blog-year = {{{blog-year|}}}
 
| blog-year = {{{blog-year|}}}
| blog-id = {{{blog-id|}}}<!--
+
| blog-id = {{{blog-id|}}}
  
//
+
| wiki-cap-recipient = {{{wiki-cap-recipient|}}}
// LOCALIZED TEXT
 
//
 
  
-->
+
| #default = <span class="error small">ERROR {{tl|Latest updates}}: type doesn't match.</span>
| patch-text = {{lang
 
  | cs = Nejnovější [[Patches/cs|patch]] byl vydán
 
  | de = Das letzte [[Patches/de|Update]] war am
 
  | en = The latest [[Patches|patch]] was on
 
  | es = La última [[Patches/es|actualización]] fue el
 
  | fr = Le dernier [[Patches/fr|patch]] date du
 
  | ko = 가장 최근의 [[Patches/ko|패치]]는
 
  | hu = A legutóbbi [[Patches|patch]] megjelenési napja
 
  | pl = Najnowszy [[Patches/pl|patch]] został wydany
 
  | pt = A última [[Patches/pt|atualização]] ocorreu em
 
  | pt-br = A última [[Patches/pt|atualização]] ocorreu em
 
  | ro = Ultimul [[Patches/ro|patch]] a fost pe
 
  | ru = Последнее [[Patches/ru|обновление]] игры было
 
  | sv = Den senaste [[Lappar/|patch]] var på
 
  }}
 
  
| blog-text = {{lang
+
}}</includeonly><noinclude>
  | cs = [[TF2 Official Blog/cs|Oficiální TF2 blog]] byl naposled aktualizován
+
{{translation switching|cs, es, de, fr, ko, hu, pl, pt, pt-br, ro, ru, sv}}
  | de = Das letzte Update des [[TF2 Official Blog/de|TF2 Blog]]s war am
+
{{doc begin}}
  | en = The [[TF2 Official Blog|blog]] was last updated on
+
This template takes values from '''{{tl|Updates}}''' and displays them in different ways.
  | es = El último mensaje en el [[TF2 Official Blog/es|Blog Oficial de TF2]] fue el
+
 
  | fr = Le [[TF2 Official Blog/fr|blog]] a été mis à jour le
+
=== Parameters ===
  | ko = 가장 최근의 [[TF2 Official Blog/ko|TF2 공식 블로그]] 글은
+
'''Links'''
  | hu = A [[TF2 Official Blog/hu|blog]] legutóbbi bejegyzésének megjelenési napja
+
 
  | pl = [[TF2 Official Blog/pl|Oficjalny blog TF2]] ostatnio zaktualizowano
+
:; ''patch''
  | pt = O [[TF2 Official Blog|blog]] foi atualizado pela última vez em
+
:: Provides a lang-formatted proper link to the latest patch article.
  | pt-br = O [[TF2 Official Blog|blog]] foi atualizado pela última vez em
+
 
  | ro = [[TF2 Official Blog/ro|Blogul]] a fost ultima oară actualizat pe
+
:; ''patch-beta''
  | ru = Последнее обновление [[TF2 Official Blog/ru|блога]] было
+
:: Provides a lang-formatted proper link to [[Patches (Beta)]].
  | sv = Den [[TF2 officiella bloggen | Blogg]] uppdaterades senast den
+
 
  }}
+
:; ''blog''
 +
:: Provides a lang-formatted proper external link to the latest blog post based on the given ID.
 +
 
 +
'''Days ago'''
  
| wiki-cap-recipient = {{{wiki-cap-recipient|}}}
+
:; ''patch-daysago'', ''patch-beta-daysago'', ''blog-daysago''
 +
:: Uses {{tl|Days ago}} to render the days since the last patch / blog update (bracketed).
  
| #default = <span class="error small">{{#ifeq:{{BASEPAGENAME}}|Main Page|<span style="color:#000;">''This Main Page requires updating to the [[Template:Main Page layout|new design]].''</span>|ERROR &#123;&#123;[[Template:latest updates|latest updates]]&#125;&#125; failure: no type specified.}}</span>
+
'''Raw values'''
  
}}</includeonly><noinclude>
+
:: The following raw values are available as they are given in {{tl|Updates}} so they can be used anywhere.
{{Translation switching|cs, es, de, fr, ko, hu, pl, pt, pt-br, ro, ru, sv}}
 
* Generates patch & blog update links and text plainly based on the parameter {{code|type}} (or the first unnamed parameter).
 
* To update dates of blog updates & patches, '''see [[Template:Updates]]'''.
 
  
== Usage ==
+
<pre>
* Date input parameters:
 
<pre><nowiki>
 
 
| patch-month =  
 
| patch-month =  
| patch-day   =  
+
| patch-day =  
| patch-year =  
+
| patch-year =  
  
 
| patch-beta-month =  
 
| patch-beta-month =  
| patch-beta-day   =  
+
| patch-beta-day =  
| patch-beta-year =  
+
| patch-beta-year =  
 +
 
 +
| blog-month =
 +
| blog-day =
 +
| blog-year =
 +
| blog-id =
 +
 
 +
| wiki-cap-recipient =
 +
</pre>
  
| blog-month  =  
+
=== See also ===
| blog-day    =  
+
* {{tl|Updates}}
| blog-year  =  
+
* {{tl|Days ago}}
| blog-id    =  
 
</nowiki></pre>
 
* Formatting type parameters: {{code|1=type=}}
 
** {{code|patch}} for a language link to the patch article for that date.
 
** {{code|patch-beta}} for a language link to [[Patches (Beta)]], no anchor.
 
** {{code|blog}} for a link to the blog post (specified by {{code|blog-id}}).
 
** {{code|patch-daysago}}, {{code|patch-beta-daysago}} and {{code|blog-daysago}} for processing of date input parameters into {{tl|Days ago}}.
 
* Localized text parameters (unused):
 
** {{code|patch-text}} for a localized version of "The latest [[Patches|patch]] was on" (language link)
 
** {{code|blog-text}} for a localized version of "The [[TF2 Official Blog|blog]] was last updated on" (language link)
 
  
 
[[Category:Templates|Latest updates]]
 
[[Category:Templates|Latest updates]]
 
[[Category:Main Page]]
 
[[Category:Main Page]]
 
</noinclude>
 
</noinclude>

Revision as of 20:53, 11 January 2011

Documentation for Updates/core

This template takes values from {{Updates}} and displays them in different ways.

Parameters

Links

patch
Provides a lang-formatted proper link to the latest patch article.
patch-beta
Provides a lang-formatted proper link to Patches (Beta).
blog
Provides a lang-formatted proper external link to the latest blog post based on the given ID.

Days ago

patch-daysago, patch-beta-daysago, blog-daysago
Uses {{Days ago}} to render the days since the last patch / blog update (bracketed).

Raw values

The following raw values are available as they are given in {{Updates}} so they can be used anywhere.
| patch-month = 
| patch-day = 
| patch-year = 

| patch-beta-month = 
| patch-beta-day = 
| patch-beta-year = 

| blog-month = 
| blog-day = 
| blog-year = 
| blog-id = 

| wiki-cap-recipient = 

See also