Difference between revisions of "Template:Days ago"

From Team Fortress Wiki
Jump to: navigation, search
(Improving translation of the french part (not sure if it's going to work, copy pasta of spanish version).)
(Push new changes.)
Line 1: Line 1:
<includeonly>{{#if:{{{brackets|}}}||(}}{{Days ago/core
+
<includeonly>{{Days ago/core
| 1 = {{{1|}}}
+
| year  = {{{1}}}
| 2 = {{{2|}}}
+
| month = {{{2}}}
 +
| day  = {{{3}}}
 +
 
 
| today = {{lang
 
| today = {{lang
 
   | cs = Dnes
 
   | cs = Dnes
Line 46: Line 48:
 
   | zh-hant = 昨天
 
   | zh-hant = 昨天
 
   }}
 
   }}
 +
 
| days-ago = {{lang
 
| days-ago = {{lang
   | cs = před {{#expr:{{LOCALDAY}} - {{{2|}}}}} dny
+
   | cs = (před {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} dny)
   | de = vor {{#expr:{{LOCALDAY}} - {{{2|}}}}} Tagen
+
   | de = (vor {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} Tagen)
   | en = {{#expr:{{LOCALDAY}} - {{{2|}}}}} days ago
+
   | en = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|day|days}} ago)
   | es = Hace {{#expr:{{LOCALDAY}} - {{{2|}}}}} {{PLURAL:{{#expr:{{LOCALDAY}} - {{{2|}}}}}|día|días}}
+
   | es = (Hace {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|día|días}})
   | fi = {{#expr:{{LOCALDAY}} - {{{2|}}}}} {{PLURAL:{{#expr:{{LOCALDAY}} - {{{2|}}}}}|päivä|päivää}} sitten
+
   | fi = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|päivä|päivää}} sitten)
   | fr = Il y a {{#expr:{{LOCALDAY}} - {{{2|}}}}} {{PLURAL:{{#expr:{{LOCALDAY}} - {{{2|}}}}}|jour|jours}}
+
   | fr = (Il y a {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|jour|jours}})
   | hu = {{#expr:{{LOCALDAY}} - {{{2|}}}}} nappal ezelőtt
+
   | hu = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} nappal ezelőtt)
   | it = {{#expr:{{LOCALDAY}} - {{{2|}}}}} {{PLURAL:{{#expr:{{LOCALDAY}} - {{{2|}}}}}|giorno|giorni}} fa
+
   | it = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|giorno|giorni}} fa)
   | ja = {{#expr:{{LOCALDAY}} - {{{2|}}}}}{{PLURAL:{{#expr:{{LOCALDAY}} - {{{2|}}}}}|日}}前
+
   | ja = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}日前)
   | ko = {{#expr:{{LOCALDAY}} - {{{2|}}}}}일 전
+
   | ko = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}일 전)
   | nl = {{#expr:{{LOCALDAY}} - {{{2|}}}}} {{PLURAL:{{#expr:{{LOCALDAY}} - {{{2|}}}}}|dag|dagen}} geleden
+
   | nl = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|dag|dagen}} geleden)
   | no = {{#expr:{{LOCALDAY}} - {{{2|}}}}} {{PLURAL:{{#expr:{{LOCALDAY}} - {{{2|}}}}}|dag|dager}} siden
+
   | no = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|dag|dager}} siden)
   | pt = {{#expr:{{LOCALDAY}} - {{{2|}}}}} {{PLURAL:{{#expr:{{LOCALDAY}} - {{{2|}}}}}|dia|dias}} atrás
+
   | pt = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|dia|dias}} atrás)
   | pt-br = {{#expr:{{LOCALDAY}} - {{{2|}}}}} {{PLURAL:{{#expr:{{LOCALDAY}} - {{{2|}}}}}|dia|dias}} atrás
+
   | pt-br = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|dia|dias}} atrás)
   | pl = {{#expr:{{LOCALDAY}} - {{{2|}}}}} dni temu
+
   | pl = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} dni temu)
   | ro = acum {{#expr:{{LOCALDAY}} - {{{2|}}}}} zile
+
   | ro = (acum {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} zile)
   | ru = {{#expr:{{LOCALDAY}} - {{{2|}}}}} {{Plural|lang=ru|{{#expr:{{LOCALDAY}} - {{{2|}}}}}|день|дня|дней}} назад  
+
   | ru = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{Plural|lang=ru|{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|день|дня|дней}} назад)
   | sv = {{#expr:{{LOCALDAY}} - {{{2|}}}}} {{PLURAL:{{#expr:{{LOCALDAY}} - {{{2|}}}}}|dag|dagar}} sedan
+
   | sv = ({{age in days|{{{1}}}|{{{2}}}|{{{3}}}}} {{PLURAL:{{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}|dag|dagar}} sedan)
   | zh-hans = {{#expr:{{LOCALDAY}} - {{{2|}}}}}日前
+
   | zh-hans = {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}日前)
   | zh-hant = {{#expr:{{LOCALDAY}} - {{{2|}}}}}天前
+
   | zh-hant = {{age in days|{{{1}}}|{{{2}}}|{{{3}}}}}天前)
 
   }}
 
   }}
}}{{#if:{{{brackets|}}}||)}}</includeonly><noinclude>
+
 
{{translation switching|cs, de, es, fi, fr, hu, it, ja, ko, nl, pt, pt-br, pl, ro, ru, sv, zh-hans, zh-hant}}
+
}}</includeonly><noinclude>
 +
{{translation switching|all languages except: ar}}
 
{{doc begin}}
 
{{doc begin}}
 
This template makes use of [http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions ParserFunctions] in the MediaWiki software to calculate the amount of days past since a specified date. Its main usage is on the {{tl|Latest updates}} template that appears on the [[Main Page]]. As the code of this template can be quite complex, {{tl|Days ago/core}} is used to hold the mathematical expressions and {{tl|Days ago}} handles language translations.
 
This template makes use of [http://www.mediawiki.org/wiki/Help:Extension:ParserFunctions ParserFunctions] in the MediaWiki software to calculate the amount of days past since a specified date. Its main usage is on the {{tl|Latest updates}} template that appears on the [[Main Page]]. As the code of this template can be quite complex, {{tl|Days ago/core}} is used to hold the mathematical expressions and {{tl|Days ago}} handles language translations.
  
 
== Usage ==
 
== Usage ==
* {{tlx|Days ago|9|2}} (Month is {{code|9}}, date is {{code|2}}) generates {{Days ago|9|2}}
+
* {{tlx|Days ago|2010|12|8}} (yyyy-m-d) generates {{Days ago|2010|12|8}}
* {{tlx|Days ago|9|2|4=brackets=0}} generates {{Days ago|9|2|brackets=0}}
 
 
 
== Limitations ==
 
Currently {{tl|days ago}} cannot handle days spanning multiple months. For example, if the given date is August 29 and the current date is September 2, the template will produce a null output.
 
  
 
[[Category:Language templates|Days ago]]
 
[[Category:Language templates|Days ago]]
 
</noinclude>
 
</noinclude>

Revision as of 10:03, 2 January 2011

Documentation for Days ago

This template makes use of ParserFunctions in the MediaWiki software to calculate the amount of days past since a specified date. Its main usage is on the {{Latest updates}} template that appears on the Main Page. As the code of this template can be quite complex, {{Days ago/core}} is used to hold the mathematical expressions and {{Days ago}} handles language translations.

Usage

  • {{Days ago|2010|12|8}} (yyyy-m-d) generates 4942 days ago