Шаблон:Track gauge
Этот шаблон реализован на основе Lua с использованием модуля Module:Track gauge. |
This template accepts a track gauge and returns that defined track gauge well formatted, plus the converted size value by another unit:
{{Track gauge|1520 mm}}
→ 1 520 mm (4 ft 11 27⁄32 in){{Track gauge|4 ft}}
→ 4 ft (1 219 mm)
Extra options are available:
{{Track gauge|1520 mm|al=on|lk=on}}
→ 1 520 mm (4 ft 11 27⁄32 in) Russian gauge
Input options
The first parameter specifies the gauge:
→ 1 435 mm (4 ft 8 1⁄2 in){{Track gauge|1435 mm}}
→ 4 ft 8 1⁄2 in (1 435 mm){{Track gauge|4 ft 8.5 in}}
→ 4 ft 8 1⁄2 in (1 435 mm){{Track gauge|4 ft 8 1/2 in}}
→ 1 520 mm (4 ft 11 27⁄32 in){{Track gauge|Russian gauge}}
Rail track gauges can be entered as they are defined: in units mm or ft in. Also common accepted names can be used, see below.
Spacing is free, and fractions can be used in imperial units. Primes ('
and "
) may be used for [foot, inch]. Any [foot, inch] size can be entered in all-inches (4 ft 8 1/2 in
equals 56 1/2 in
and 56.5 in
).
Parameter input |
Result | Note |
---|---|---|
|
1 435 mm (4 ft 8 1⁄2 in) | standard gauge |
|
1 435 mm (4 ft 8 1⁄2 in) | standard gauge, by name |
|
4 ft 8 1⁄2 in (1 435 mm) | standard gauge, this way puts imperial units first |
|
4 ft 8 1⁄2 in (1 435 mm) | standard gauge, this way puts imperial units first |
|
4 ft 8 1⁄2 in (1 435 mm) | standard gauge, by all-inches |
|
4 ft 8 1⁄2 in (1 435 mm) | standard gauge, using primes |
|
4 ft 8 1⁄2 in (1 435 mm) | standard gauge, using slash for fraction |
|
1 000 mm (3 ft 3 3⁄8 in) | 1 m is recognised, but not many more in . Better use
|
|
16,5 mm (0.65 in) | HO scale model railway |
|
16 1⁄2 in (419 mm) | Miniature railway |
|
7 ft 1⁄4 in (2 140 mm) | Brunel |
|
2140 mm | Not recognised (so no converted value). This track gauge, Brunel's, is not defined in mm. |
|
65 in | Input not recognised (so no converted value); output copies the input. This is a good way to enter an uncovered rail gauge on a page: other editors will notice (and can add a new gauge to the template!). |
- When an input value is not recognised by the template (see last two table examples), the template simply returns the input as it is: {{Track gauge|25in}} → 25in
- The page with this unknown input is also listed in a maintenance category, in the background, that signals interested editors that there is a new rail gauge used in Wikipedia. More on this below.
- Some gauges in metric are defined in metres: 1m is recognised. However, it is not available for all metric defined gauges. Using
is a safer bet.mm
Aliases (list of defined track gauges)
Мундариҷа
- Top (Reduced listing of content:)
Track gauges in bold font are definitions. Track gauges in regular font are merely conversions (calculations). Lua error in Модул:Track_gauge/autodocument at line 762: attempt to call field '_mod' (a nil value).
Parameters
{{Track gauge | | lk=on | first=imp, met | disp= s, /, 1, br, [], <any literal text> | al=on | allk=on | nowrap=off (default), on, all | addcat=no | unitlink=on }}
Parameter | What it does | Example (code) | Example (output) | |
---|---|---|---|---|
lk=on | Links the defining measure (first measure) "defined size" depends on input |
{{Track gauge|3ft6in|lk=on}}
|
3 ft 6 in (1 067 mm) 1 067 mm (3 ft 6 in) | |
al=on | Adds the alternate name after the gauge measurement values | {{Track gauge|sg|al=on}}
|
1 435 mm (4 ft 8 1⁄2 in) standard gauge | |
allk=on | Adds a wikilink to the alternate name where applicable | {{Track gauge|sg|allk=on}}
|
1 435 mm (4 ft 8 1⁄2 in) standard gauge | |
first=imp first=met |
Puts the requested measure first (metric, imperial) | {{Track gauge|1000mm|first=imp}}
|
3 ft 3 3⁄8 in (1 000 mm) | |
disp=any text | The text will be written between the measurements, two spaces added. Brackets are omitted. Text must be 2 characters or more. (codes for |disp= are processed as described: 1, s, /, br).
|
{{Track gauge|sg|disp=also defined as being}}
|
1 435 mm also defined as being 4 ft 8 1⁄2 in | |
disp=s or / | Uses a slash as a separator rather than parentheses | {{Track gauge|sg|disp=s}}
|
1 435 mm/4 ft 8 1⁄2 in | |
disp=[] | Uses a square brackets rather than parentheses | {{Track gauge|sg|disp=[]}}
|
1 435 mm [4 ft 8 1⁄2 in] | |
disp=1 | Only shows the first measure (may be used when repeated on a page or in conjunction with first= to display the output only)
|
{{Track gauge|sg|disp=1}}
|
1 435 mm | |
disp=br | Forces a line break after the first size (and also before any gauge name) | {{Track gauge|sg|disp=br}}
|
1 435 mm (4 ft 8 1⁄2 in) | |
nowrap=off (default), on, all | Sets possible line break (line wrap): after between the measurements (off=defalt), not (on, all), or not at all when named gauge is present. (note: until May 2014, default behaviour was no break between the measurements. This has changed.) | {{Track gauge|sg|nowrap=on}}
|
1 435 mm (4 ft 8 1⁄2 in) | |
addcat=no | Will not add a maintenance category | {{Track gauge|sg|addcat=no}}
|
1 435 mm (4 ft 8 1⁄2 in) | |
unitlink=on | Adds wikilinks to the measurement unit labels | {{Track gauge|sg|unitlink=on}}
|
1 435 mm (4 ft 8 1⁄2 in) | |
wrap=y | Deprecated. The same as nowrap=off. This is the default behaviour, so can be removed without harm. |
- Names can be universal, being defined worldwide. For example: Iberian gauge, 1 668 mm (5 ft 5 21⁄32 in) Iberian gauge. Other names can be localor culturally restricted, for example the name "Cape gauge" is used in South Africa for 3 ft 6 in (1 067 mm), but not in Japan (in Japan that same track gaugfe is not named).
- Also, two sizes can lead to one gauge name.
Named gauges
Established gauge names can be entered. The word "gauge" can be omitted. Case-insensitive (A=a). See also the |al=
, |allk=
parameters (below), to show a gauge name in the outcome.
Input | Result | Note |
---|---|---|
{{Track gauge|Baltimore gauge}} | 5 ft 4 1⁄2 in (1 638 mm) | |
{{Track gauge|Baltimore}} | 5 ft 4 1⁄2 in (1 638 mm) | Omitting " gauge", same effect |
{{Track gauge|baltimore}} | 5 ft 4 1⁄2 in (1 638 mm) | Case-insensitive (A=a) |
{{Track gauge|baltimore|al=on}} | 5 ft 4 1⁄2 in (1 638 mm) Baltimore streetcar gauge | |al=on shows the alternative (name)
|
{{Track gauge|baltimore|allk=on}} | 5 ft 4 1⁄2 in (1 638 mm) Baltimore streetcar gauge | |allk=on shows the alternative (name), linked
|
{{Track gauge|baltimore|lk=on|al=on}} | 5 ft 4 1⁄2 in (1 638 mm) Baltimore streetcar gauge | |lk=on links the size (as always)
|
{{Track gauge|Baltimore streetcar gauge}} | 5 ft 4 1⁄2 in (1 638 mm) | This one has more names |
{{Track gauge|Bosnian}} | 760 mm (2 ft 5 15⁄16 in) | |
{{Track gauge|Brunel}} | 7 ft (2 134 mm) | |
{{Track gauge|Cape}} | 3 ft 6 in (1 067 mm) | |
{{Track gauge|Iberian}} | 1 668 mm (5 ft 5 21⁄32 in) | |
{{Track gauge|Indian}} | 5 ft 6 in (1 676 mm) | |
{{Track gauge|Victorian}} | 1 600 mm (5 ft 3 in) | |
{{Track gauge|Irish}} | 5 ft 3 in (1 600 mm) | |
{{Track gauge|metre}} | 1 000 mm (3 ft 3 3⁄8 in) | |
{{Track gauge|Ohio}} | 4 ft 10 in (1 473 mm) | |
{{Track gauge|Pennsylvania}} | 5 ft 2 1⁄2 in (1 588 mm) | |
{{Track gauge|Pennsylvania trolley}} | 5 ft 2 1⁄2 in (1 588 mm) | |
{{Track gauge|Russian}} | 1 520 mm (4 ft 11 27⁄32 in) | |
{{Track gauge|Scotch}} | 4 ft 6 in (1 372 mm) | |
{{Track gauge|standard gauge}} | 1 435 mm (4 ft 8 1⁄2 in) | Also: "sg", "metsg" (metric units first) |
{{Track gauge|US sg}} | 4 ft 8 1⁄2 in (1 435 mm) | Also: "imp sg", "UK sg", "NA sg" (imperial units first) |
{{Track gauge|Swedish three foot}} | 891 mm (2 ft 11 3⁄32 in) | |
{{Track gauge|Swedish}} | 891 mm (2 ft 11 3⁄32 in) | |
{{Track gauge|Toronto}} | 4 ft 10 7⁄8 in (1 495 mm) |
Background
There are two maintenance categories under Category:Wikipedia track gauge categories that can help in maintenance of the template.
- Category:Articles using template 'Track gauge' with unrecognized input: input to be checked. No error message on the page, but it needs attention.
- Category:Pages with no gauge entered in Infobox rail line: template {{Infobox rail line}} is used, but parameter
|gauge=
is empty.
Sometimes an input parameter is not recognised by the template (that is: it is not defined in the internal data list). The article page with this {{Track gauge|some unknown gauge}} is added to the maintenance category (named Category:Articles using template 'Track gauge' with unrecognized input). Interested editors will check that category, and can edit that article page (for a spelling error), or propose to add that track gauge to the template.
TemplateData
templatedata | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The template formats a track gauge size into standard notation and adds the conversion into the imperial/metric (other) size
|
See also
- Sources
- Light Rail Transit Association (LRTA)
- Electric transport in latin america (2013). Latin America is very well covered
- A world of trams and urban transit. Light Rail Transit Association (LRTA)). UK based, covering most countries
- Scaled rail models
- S-3.1 Trackwork, Proto & Fine Scales. NMRA (2004).
- S-3.2 Trackwork Standard Scales (metric). NMRA (2010).