Ашаблон:Century name from decade or year
Ашаблон адокументациа[аԥхьара] [аредакциазура] [аҭоурых] [purge]
Ахәҭаҷ/асекциа адырра апроцесс аԥсуа бызшәа аиҭагара ахь. Абызшәа адырра шәазҟазазар, ишәылшоит шәхы алашәырхәыр. |
When supplied with a 1-, 2-, 3- or 4-digit year or decade, returns the name of the century.
Mostly used in categorisation.
Parameters
аредакциазура- The first parameter is required: either a 1-, 2-, 3-, or 4-digit year (e.g. 61, 905, 1839) or a 2-, 3-, or 4--digit decade (e.g. 60s, 900s, 1830s)
- The second parameter is optional. The single word "dash" changes the output from "nth century" to "nth-century"
- An optional "nomatch" parameter may be used to specify text to be return if the input cannot be processed. Default behaviour is return an empty string if there is no match
Usage
аредакциазура{{Century name from decade or year|YYYY}}
{{Century name from decade or year|YYYY|dash}}
{{Century name from decade or year|YYY0s}}
{{Century name from decade or year|YYY0s|dash}}
{{Century name from decade or year|YYYY|nomatch=FAIL}}
{{Century name from decade or year|YYYY|dash|nomatch=FAIL}}
{{Century name from decade or year|YYY0s|nomatch=FAIL}}
{{Century name from decade or year|YYY0s|dash|nomatch=FAIL}}
Examples
аредакциазура{{Century name from decade or year|8}}
→ 1-тәи ашәышықәса{{Century name from decade or year|63}}
→ 1-тәи ашәышықәса{{Century name from decade or year|421}}
→ 5-тәи ашәышықәса{{Century name from decade or year|1707}}
→ 18-тәи ашәышықәса{{Century name from decade or year|1514|dash}}
→ 16-тәи ашәышықәсазы{{Century name from decade or year|0-тәи ашықәсқәа}}
→ 1-тәи ашәышықәса{{Century name from decade or year|40-тәи ашықәсқәа}}
→ 1-тәи ашәышықәса{{Century name from decade or year|550-тәи ашықәсқәа}}
→ 6-тәи ашәышықәса{{Century name from decade or year|1920-тәи ашықәсқәа}}
→ 20-тәи ашәышықәса{{Century name from decade or year|2030-тәи ашықәсқәа|dash}}
→ 21-тәи ашәышықәсазы
Errors
аредакциазураEmpty or inappropriate parameters produce no output, unless the "nomatch" paremeter is set.
{{Century name from decade or year}}
→{{Century name from decade or year|7}}
→ 1-тәи ашәышықәса{{Century name from decade or year|123abc}}
→{{Century name from decade or year|French flying flamingoes flounce furiously}}
→
With "nomatch"
{{Century name from decade or year|nomatch=FAILED}}
→ FAILED{{Century name from decade or year|7|nomatch=Aaaaaaaaaargh}}
→ 1-тәи ашәышықәса{{Century name from decade or year|123abc|nomatch=garbage input}}
→ garbage input{{Century name from decade or year|Fastidious French flying flamingoes flounce furiously|nomatch=NOMATCH}}
→ NOMATCH
Redirects
аредакциазураTemplateData
аредакциазураЗдесь приведена документация в формате TemplateData для данного шаблона, которая используется в визуальном редакторе и прочих инструментах.
Документация TemplateData для шаблона: Century name from decade or year
Returns the name of the century for a 1-, 2-, 3- or 4-digit year or decade.
Параметр | Описание | Тип | Статус | |
---|---|---|---|---|
Year or decade | 1 | a 1-, 2-, 3- or 4-digit-year (e.g. '1957') or a 4-digit-decade (e.g. '1760s')
| Число | необязательный |
dash | 2 | If this parameter is dash, then the century number is followed by a dash rather than a space, i.e. '16th-century' instead of the default '16th century'
| Строковый (без форматирования) | необязательный |
No match text | nomatch | If the input is not a 1-, 2-, 3- or 4-digit year or decade, output the "nomatch" value. Defaults to blank. | Строковый (без форматирования) | необязательный |