Jump to content

Template talk:Track gauge: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
rm section already archieved
Line 9: Line 9:
}}
}}
{{auto archiving notice|bot=MiszaBot II|age=120|small=yes}}
{{auto archiving notice|bot=MiszaBot II|age=120|small=yes}}

== Space after template ==

I noticed that, when the template is used, it displays with unnecessary "internal" spaces as well as with a space following it. The result is that, when one (naturally) types a space between the template and the following word, it causes a double space.<br><br>Examples are {{RailGauge|2ft|al=on}} and {{RailGauge|600|al=on}} followed by double spaces.<br>Examples are 2 ft (610 mm) and 600 mm (1 ft 11... (Typed out to compare).<br>(It looks like "ft" is followed by a double space, but not "mm".)<br><br>It even happens when the template is followed by a comma or fullstop as in {{RailGauge|2ft6in|al=on}}, and {{RailGauge|2ft6in|al=on}}.<br>It even happens when the template is followed by a comma or fullstop as in 2 ft 6 in (762 mm), and 2 ft 6 in (762 mm). (Typed out).<br>At least here "internal" double spaces don't happen - compare the punctiation marks after (these), (brackets).<br><br>Examples with the "al=on" option omitted display as {{RailGauge|2ft}} with double "internal" and single end spaces.<br>Examples with the "al=on" option omitted display as 2 ft (610 mm) with double "internal" and single end spaces (Typed out to compare)<br>(Again it's the "ft"...)<br><br>The problem does not occur when an alternative name exists, for example:<br>with {{RailGauge|3ft6in|al=on}} and others.<br>with 3 ft 6 in (1,067 mm) Cape gauge and others. (Typed out to compare)<br>(Unfortunately I cannot offhand think of a named imperial-to-metric conversion from a round foot value with no inches to see if the "ft" would screw up again....)<br><br>While I'm at it, should 11 ½ have a space in in, or should it be 11½ with no space?<br><br>André Kritzinger 01:55, 12 September 2012 (UTC)
:I don't see any double [[Period (punctuation mark)|periods]]. Do you have any unusual fonts installed? --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] ([[User talk:Redrose64|talk]]) 11:45, 12 September 2012 (UTC)
::No, nothing, I use it as is. Not even on email. I use Internet Explorer, if that would make a difference.<br>André Kritzinger 12:01, 12 September 2012 (UTC)
:::Well, I see two instances of a triple period ("{{tq|1 ft 11... (Typed}}" and "{{tq|the "ft"...)}}"), and one of a quadruple period ("{{tq|screw up again....)}}"), but these are all from your plain text, none are generated by {{tlx|railgauge}}. Does anybody else see any ''double'' periods?
::::Grrr... (The second language barrier tripped me up again! I'm too used to the term "[[full stop]])".<br>I meant space. What the spacebar does. The issue is therefore about double spaces. My apologies! (I edited the above.)<br>André Kritzinger 14:37, 12 September 2012 (UTC)
:::::It is to do with the non-breaking spaces, it needs to detect if there is any inches or fraction to follow before outputting it. [[User:Keith D|Keith D]] ([[User talk:Keith D|talk]]) 16:41, 12 September 2012 (UTC)
::::There must be a better way. Why not just make {{tl|nowrap}} part of the RailGauge template, as in "{{nowrap|{{RailGauge|3ft6in|al=on}}}}"? (Obviously the gauge name will somehow have to be allowed to wrap, though.)<br>Like this with the wrong commas: ((nowrap|((RailGauge|3ft6in|al=on)))).<br>André Kritzinger 18:24, 12 September 2012 (UTC)
:::::*{{tlx|RailGauge|2ft|3=al=on}}. → {{RailGauge|2ft|al=on}}.
:::::*{{tlx|RailGauge|2ft|3=al=on}} text → {{RailGauge|2ft|al=on}} text
:::::*{{tlx|RailGauge|2ft|3=al=on|4=wrap=y}}. → {{RailGauge|2ft|al=on|wrap=y}}.
:::::*{{tlx|RailGauge|2ft|3=al=on|4=wrap=y}} text → {{RailGauge|2ft|al=on|wrap=y}} text
:::::*{{tlx|RailGauge|2ft}}. → {{RailGauge|2ft}}.
:::::*{{tlx|RailGauge|2ft}} text → {{RailGauge|2ft}} text
:::::*{{tlx|RailGauge|2ft|3=wrap=y}}. → {{RailGauge|2ft|wrap=y}}.
:::::*{{tlx|RailGauge|2ft|3=wrap=y}} text → {{RailGauge|2ft|wrap=y}} text
:::::Why not omit the {{para|al|on}} since there is no alternate name to show? --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] ([[User talk:Redrose64|talk]]) 18:56, 12 September 2012 (UTC)
:::One could. But that doesn't fix the bug, it just sidesteps it. And an instruction to that effect would have to be included in the template handling notes, making it more complex, not simpler. Besides, the "internal" double spaces are still there.<br>André Kritzinger 20:27, 12 September 2012 (UTC)
::::*{{tlx|RailGauge|2ft|3=al=on}} expands to {{tag|span|params=class="nowrap"|content=2&amp;nbsp;ft&amp;nbsp;&amp;nbsp;(610&amp;nbsp;mm)}}&amp;nbsp; which displays as "<span class="nowrap">2&nbsp;ft&nbsp;&nbsp;(610&nbsp;mm)</span>&nbsp;"
::::*{{tlx|RailGauge|600mm|3=al=on}} expands to {{tag|span|params=class="nowrap"|content=600&amp;nbsp;mm&amp;nbsp;(1&amp;nbsp;ft&amp;nbsp;{{tag|span|params=class="frac nowrap"|content=11{{tag|sup|content=&amp;#32;5}}&frasl;{{tag|sub|content=8}}}}&amp;nbsp;in)}}&amp;nbsp; which displays as "<span class="nowrap">600&nbsp;mm&nbsp;(1&nbsp;ft&nbsp;<span class="frac nowrap">11<sup>&#32;5</sup>&frasl;<sub>8</sub></span>&nbsp;in)</span>&nbsp;"
::::All apparent spaces except the sole instance of <code>&amp;#32;</code> are in fact [[non-breaking space]]s, <code>&amp;nbsp;</code>; one characteristic of these is that when several occur, the same number are displayed - by contrast, more than one successive normal spaces always shrink to a single one. The case of <code>&amp;nbsp;&amp;nbsp;</code> seems to be because the gauge is whole feet - there are no inches. If you put {{tlx|RailGauge|2ft6in|3=al=on}} this gives {{RailGauge|2ft6in|al=on}} and there is no double space. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] ([[User talk:Redrose64|talk]]) 21:24, 12 September 2012 (UTC)
:::There is still a space between the {{tlx|RailGauge|2ft6in|3=al=on}} template and, for example, a full stop. For example, {{RailGauge|2ft6in|al=on}}. Instead of<br>2 ft 6 in (762 mm).<br>André Kritzinger 22:26, 12 September 2012 (UTC)
::::Which is what you would expect as al=on should only ever be used on those gauges that actually have an alternative name. The example you quote does not have an alternative name so should not have al=on on the template call. [[User:Keith D|Keith D]] ([[User talk:Keith D|talk]]) 22:50, 12 September 2012 (UTC)
:::That's not what the handling notes say. At present it just reads "The al, lk and disp parameters are optional."<br>It does not specify that "The al parameter should never be used with any un-named gauge." And if it did, a list of those named gauges where its use would be permissible should be included.<br>André Kritzinger 23:36, 12 September 2012 (UTC)
:I have tweaked the imperial conversion in the sandbox to see if it solves the double spacing problem. If you can try this out and let me know if it solves the problem, without creating new problems, I can put live. [[User:Keith D|Keith D]] ([[User talk:Keith D|talk]]) 12:21, 19 September 2012 (UTC)
Thanks for that. I made some comparisons:<br>
*{{RailGauge|2ft|al=on}}. Real from {{tlx|RailGauge|2ft|3=al=on}}<br>
*{{RailGauge/sandbox|2ft|al=on}}. Sandbox from {{tlx|RailGauge/sandbox|2ft|3=al=on}}<br>
*{{RailGauge|2ft}}. Real from {{tlx|RailGauge|2ft}}<br>
*{{RailGauge/sandbox|2ft}}. Sandbox from {{tlx|RailGauge/sandbox|2ft}}<br>
*{{RailGauge|3ft|al=on}}. Real from {{tlx|RailGauge|3ft|3=al=on}}<br>
*{{RailGauge/sandbox|3ft|al=on}}. Sandbox from {{tlx|RailGauge/sandbox|3ft|3=al=on}}<br>
*{{RailGauge|3ft}}. Real from {{tlx|RailGauge|3ft}}<br>
*{{RailGauge/sandbox|3ft}}. Sandbox from {{tlx|RailGauge/sandbox|3ft}}<br>
The double space after "ft" is fixed, thank you, and it doesn't look like there's any new problem. The double space from the unnecessary use of "|al=on" still happens, though.<br>
(While you're tweaking, remember to also check the "Railgauge|900" and "Railgauge|900mm" template result: "2 ft 11 1/2 in" instead of "2 ft 11 7⁄16 in")<br>André Kritzinger 23:18, 19 September 2012 (UTC)
:OK. I have put the modified imperial template live and changed the conversion for 900mm. [[User:Keith D|Keith D]] ([[User talk:Keith D|talk]]) 08:40, 20 September 2012 (UTC)
:::{{done}}} as for the double spaces within. Examples show it looks OK. -[[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 09:26, 18 February 2013 (UTC)
::Reopened below, [[Template_talk:RailGauge#Edit_proposal_.28capitalised_input_for_gauge_name.29|here]]. -[[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 18:52, 13 February 2013 (UTC)
:::{{done}} as for the original problem (trailing space). See [[Template_talk:RailGauge#Edit_proposal_.28capitalised_input_for_gauge_name.29|edit request]] below. -[[User:DePiep|DePiep]] ([[User talk:DePiep|talk]]) 09:24, 18 February 2013 (UTC)


== Edit proposal (capitalised input for gauge name) ==
== Edit proposal (capitalised input for gauge name) ==

Revision as of 08:35, 5 July 2013

WikiProject iconTrains Template‑class
WikiProject iconThis template is within the scope of WikiProject Trains, an attempt to build a comprehensive and detailed guide to rail transport on Wikipedia. If you would like to participate, you can visit the project page, where you can join the project and/or contribute to the discussion. See also: WikiProject Trains to do list and the Trains Portal.
TemplateThis template does not require a rating on Wikipedia's content assessment scale.

Edit proposal (capitalised input for gauge name)

  • About the code that adds the alternative name, right after the #default line. It now says:
{{#switch:{{{1}}}|...

For correctness, it should be:

{{#switch:{{lc:{{{1}}}}}|...

As it is now, capitalised input like "Standard" is not recognised here. -DePiep (talk) 14:12, 13 February 2013 (UTC)[reply]

  • A nearby issue: when the al=on does not fire (there is no alternate name found), the template produces a final space (that would preceed the alt name). This is not preferred. I have proposed, in the {{RailGauge/sandbox}} (this edit), to only produce the space when an alt name is found. The sandbox also has the lc-issue solved. -DePiep (talk) 15:58, 13 February 2013 (UTC)[reply]
The issue was raised earlier above in #Space after template. I did not that one before I posted here.
So: >3 ft (914 mm)<. The sandbox shows a fix: >3 ft (914 mm)<. -DePiep (talk) 18:43, 13 February 2013 (UTC)[reply]

I propose to put the full {{RailGauge/sandbox}} code into the live template. It should solve both issues. -DePiep (talk) 18:10, 17 February 2013 (UTC)[reply]

 Done --Redrose64 (talk) 18:29, 17 February 2013 (UTC)[reply]

Edit proposal (named gauges)

  • About Named gauges. Here is an overview list of all names used. See the column edit proposal for proposed edit.

Background: the linked-to name should be recognised (e.g., irish). Recognised names should link too (e.g., scot); abbreviations may be written in long form (e.g., provincial).

input param produces edit proposal {{/sandbox}} test
m m m
metre 1,000 mm (3 ft 3+38 in) metre gauge 1,000 mm (3 ft 3+38 in) metre gauge
meter 1,000 mm (3 ft 3+38 in) metre gauge 1,000 mm (3 ft 3+38 in) metre gauge
cape 3 ft 6 in (1,067 mm) Cape gauge 3 ft 6 in (1,067 mm) Cape gauge
scot scot Add to al=on list; Scotch gauge scot
scotch 4 ft 6 in (1,372 mm) Scotch gauge Add to numeric list for 4ft6in;
add to al=on list; Scotch gauge
4 ft 6 in (1,372 mm) Scotch gauge
scottish scottish Add to numeric list for 4ft6in;
add to al=on list; Scotch gauge
scottish
sg 1,435 mm (4 ft 8+12 in) standard gauge Not capitalised 1,435 mm (4 ft 8+12 in) standard gauge
standard 1,435 mm (4 ft 8+12 in) standard gauge 1,435 mm (4 ft 8+12 in) standard gauge
ussg 4 ft 8+12 in (1,435 mm) standard gauge 4 ft 8+12 in (1,435 mm) standard gauge
nasg nasg nasg
usstandard 4 ft 8+12 in (1,435 mm) standard gauge 4 ft 8+12 in (1,435 mm) standard gauge
nastandard nastandard nastandard
ohio 4 ft 10 in (1,473 mm) Ohio gauge 4 ft 10 in (1,473 mm) Ohio gauge
oh oh oh
toronto 4 ft 10+78 in (1,495 mm) Toronto gauge Add to numeric list for 1495mm,
add to al=on list
4 ft 10+78 in (1,495 mm) Toronto gauge
russian 1,520 mm (4 ft 11+2732 in) Russian gauge 1,520 mm (4 ft 11+2732 in) Russian gauge
vic vic vic
victoria victoria (add unabbreviated name for "vic") victoria
victorian 1,600 mm (5 ft 3 in) Victorian broad gauge (add unabbreviated name for "vic") 1,600 mm (5 ft 3 in) Victorian broad gauge
irish 5 ft 3 in (1,600 mm) Irish gauge Add to numeric list for 1600mm,
add to al=on list
5 ft 3 in (1,600 mm) Irish gauge
prov prov skip redirect, directly to Indian gauge prov
provincial provincial Add to numeric list for 5ft6in,
add to al=on list.
Skip redirect, directly to Indian gauge
provincial
indian 5 ft 6 in (1,676 mm) Indian gauge Add to numeric list for 5ft6in (prov),
add to al=on list
5 ft 6 in (1,676 mm) Indian gauge
iberian 1,668 mm (5 ft 5+2132 in) Iberian gauge Add to numeric list for 1,668 mm (5 ft 5 2/3 in),
add to al=on list
1,668 mm (5 ft 5+2132 in) Iberian gauge
Earlier notes

-DePiep (talk) 14:53, 13 February 2013 (UTC),[reply]

More on prov/indian gauge -DePiep (talk) 15:08, 13 February 2013 (UTC)[reply]
Changes now are in {{/sandbox}}. They are:
  • All named gauges (in first column) are in the template two-way: 1. Recognised as input, and 2. When al=on they are linked to.
  • Links are direct (not redirect).
  • See column "edit proposal", and check "/sandbox" column.

This shows the changes. Any remarks? -DePiep (talk) 22:53, 17 February 2013 (UTC) -DePiep (talk) 22:58, 17 February 2013 (UTC)[reply]

(The proposal sandbox is temporally not available - will return soon) -DePiep (talk) 11:05, 18 February 2013 (UTC)[reply]
It is returned now. -DePiep (talk) 00:33, 20 February 2013 (UTC)[reply]

Proposal.
With named gauges, like "standard gauge", we have two options.
1. Use name as input: {{RailGauge|standard}}1,435 mm (4 ft 8+12 in)

I propose to add more names that should be recognised as input: scotch, scottish, victoria, victorian, provincial, irish, indian, iberian, toronto.

2. We can show a link to a gauge page, using |al=on |allk=on:

{{RailGauge|1435mm|al=on|allk=on}}1,435 mm (4 ft 8+12 in) standard gauge
I propose to add these links for all named gauges: scot and the newly addded names (see 1. above).
Also, these links should not be a redirect: prov should nopt lead to Provincial gauge (a Redirect), but directly to Indian gauge.

3. "standard gauge" and "metre gauge" should not be capitalised, it is not a proper name.
4. The names should not wrap (especially not in infoboxes). The space right before the name is always open for wrapping, not an NBSP. (see test table, columns are set extra tight to show this).
These proposals are in the table. Changes are notes in the "edit proposal" column. The rightmost column shows the sandbox (test) version. -DePiep (talk) 00:33, 20 February 2013 (UTC) Added: "standard gauge" link in lowercase. -DePiep (talk) 09:57, 20 February 2013 (UTC); adding nowrap note -DePiep (talk) 20:37, 21 February 2013 (UTC) adding metre to be lowercase. -DePiep (talk) 10:28, 22 February 2013 (UTC) add Toronto -DePiep (talk) 11:37, 23 February 2013 (UTC)[reply]

Good catch. Added, to testcases too (Line 925mm was added after I took the source code to the sandbox). The change now looks like: diff. -DePiep (talk) 11:15, 2 March 2013 (UTC)[reply]
Ok,  Done. I also wrapped the template in includeonly tags so that the error message doesn't appear on the template page. — Mr. Stradivarius ♪ talk ♪ 12:15, 2 March 2013 (UTC)[reply]
Thanks. I'll take a look at the /doc and so. -DePiep (talk) 13:50, 2 March 2013 (UTC)[reply]
See also Template talk:RailGauge#14 Proposals below. Peter Horn User talk 23:03, 9 March 2013 (UTC)[reply]

Iberian gauge

Could we add "Iberian" gauge as a gauge by name, and linkable to Iberian gauge? Currently only numeric input is available: 1668. -DePiep (talk) 15:18, 13 February 2013 (UTC)[reply]

The traditional Spanish and traditional Portuguese gauges are different by 9 mm, although there is interoperability of rolling stock at moderate speeds. Afterbrunel (talk) 08:48, 19 February 2013 (UTC)[reply]
So it would be wrong to state: Iberian gauge=1668mm? Then I'll drop the proposal. -DePiep (talk) 10:24, 19 February 2013 (UTC)[reply]

Oddballs

Tatra K2 & Tatra T2 mention(ed) a gauge of 1,535 mm (5 ft 0.4 in). Does such a gauge actually exist? And if so, where? I have changed it to 1524. Peter Horn User talk 23:50, 14 February 2013 (UTC) Peter Horn User talk 23:53, 14 February 2013 (UTC)[reply]

Above, at #Russian gauge, I have just repeated my proposal: input 1524mm can return a link to Russian gauge too (as does input 1520mm). -DePiep (talk) 03:32, 15 February 2013 (UTC)[reply]
But that does not answer my question: From where does the gauge 1,535 mm (5 ft 0.4 in) come? Which, if any, tram systems in the former USSR, now Russia etc., used it? Peter Horn User talk 14:23, 15 February 2013 (UTC)[reply]
I did not claim I was. I was just noting that you changed it to Russian gauge, which makes a bit more sense here than just the number 1524 mm. I did do some research on 1535 mm too, but did not find anything noteworthy. -DePiep (talk) 13:30, 17 February 2013 (UTC)[reply]
That is probably because 1535 mm gauge did not ever exist. Peter Horn User talk 18:54, 19 February 2013 (UTC)[reply]

Another oddball rail gauge

For Trams in Chemnitz 925 mm (3 ft 1332 in) instead of 925 mm (3 ft 0.42 in). Peter Horn User talk 01:50, 17 February 2013 (UTC)[reply]

Appears to be a correct gauge (that is: it existed). [1] [2] [3] mention that the tram museum has the old stock on some meters of the gauge. Would be imperial 3 ft 1332 for 924.72 mm. -DePiep (talk) 23:18, 17 February 2013 (UTC)[reply]
 Done - unfortunately the template needs the zero to work hope you can live with it. Keith D (talk) 19:21, 19 February 2013 (UTC)[reply]
Thanks. Nothing wrong with the zero, it is quite acceptable and in fact a standard on engineering drawings. I used that configuration on engineering drawing Peter Horn User talk 21:52, 19 February 2013 (UTC)[reply]

Edit proposal (prefixed space in imperial inch-with-fraction situation)

Issue: Currently, they have a leading space in some situations (actually an nbsp). This space shows in tables (like {{RailGauge}} documentation) and infoboxes. Examples:

  • >2+12 in (64 mm)<
  • >2+18 in (53.975 mm)<
  • >2+12 in (64 mm)< wrap=y
  • >2+18 in (53.975 mm)< wrap=y

Cause: It happens when 1. imperial units are put first, and 2. no ft is defined or shown, and 3. the inch measure has a fraction (not decimals).
Solution: I have adjusted the subtemplate {{RailGauge/imperial/sandbox}} (in its sandbox; this version). Note: the main {{RailGauge}} is not altered.
Testcases: Sandbox checks:

  • >2+12 in (64 mm)<
  • >2+18 in (53.975 mm)<
  • >2+12 in (64 mm)< wrap=y
  • >2+18 in (53.975 mm)< wrap=y

See alse {{RailGauge/testcases}}: the issue is gone, and no new issues arise. Being a technicality, I think this is not controversial.
Edit request replace {{RailGauge/imperial}} with all code from {{RailGauge/imperial/sandbox}} (this version). Do not touch main template RailGauge. -DePiep (talk) 10:59, 18 February 2013 (UTC)[reply]

Paused the request. -DePiep (talk) 15:45, 18 February 2013 (UTC)[reply]
Reactivated the request. Situation for |wrap=y now covered too. See testcases. -DePiep (talk) 16:52, 18 February 2013 (UTC)[reply]
 Done OK I have put live - revert out of problems are found. Keith D (talk) 23:56, 19 February 2013 (UTC)[reply]
Thanks. Did not see aberrations so far. -DePiep (talk) 00:08, 20 February 2013 (UTC)[reply]

Oddball: 38 inch

 Done See Clifton Rocks Railway. It mentions 38 inch (965 mm). (38" calculates nicely to 965.2 mm indeed). To add? -DePiep (talk) 16:26, 25 February 2013 (UTC)[reply]

Note to any admin adding this one: please first check edit request #Edit proposal (named gauges). Otherwise the elaborate proposal (sandbox) would be made outdated. -DePiep (talk) 16:28, 25 February 2013 (UTC) Resolved. -DePiep (talk) 13:52, 2 March 2013 (UTC)[reply]
Make that 3 ft 2 in (965 mm) Peter Horn User talk 19:55, 6 March 2013 (UTC)[reply]
Already in the sandbox: 3 ft 2 in (965 mm). Some more changes in there, I'll make a list of the proposals here shortly, to discuss. -DePiep (talk) 21:50, 6 March 2013 (UTC)[reply]
I think that we need to see if the changes made to sandbox are to be deployed before making these changes or we may start to get things out of step. Keith D (talk) 00:43, 10 March 2013 (UTC)[reply]
This single change is in the sandbox, and tested with visible results. One can oppose or discuss this single addition below. Please point issues you see. -DePiep (talk) 00:53, 10 March 2013 (UTC)[reply]

Another modelling gauge

 Done
For P4 gauge 28.08 mm (1.106 in). Peter Horn User talk 19:36, 6 March 2013 (UTC)[reply]

Added to the sandbox: 28.08 mm (1.106 in). I will check to put metric first. Formal proposal for all sandbox changes to follow here. -DePiep (talk) 22:09, 6 March 2013 (UTC)[reply]
I think that we need to see if the changes made to sandbox are to be deployed before making these changes or we may start to get things out of step. Keith D (talk) 00:45, 10 March 2013 (UTC)[reply]
This single change is in the sandbox, and tested with visible results. One can oppose or discuss this single addition below. Please point issues you see. -DePiep (talk) 00:53, 10 March 2013 (UTC)[reply]

14 Proposals

Resolved
 – Now in {{RailGauge}}

I propose the next changes to the template. All these changes are made in the sandbox, and tested. If we agree in this, I'll prepare an "edit protect" request.

Proposals
Topic
(links to discussion below)
Change type Gauge input Settings
input
Current
({{RailGauge}})
Proposed
({{RailGauge/sandbox}})
Note
38 in New entry 38in 3 ft 2 in (965 mm) {{RailGauge/sandbox}} Used in Clifton Rocks Railway
28.08 mm New entry 28.08 28.08 {{RailGauge/sandbox}} Used in P4 gauge
1945 mm Change fraction 1945mm 1,945 mm (6 ft 4+916 in) {{RailGauge/sandbox}} By 116 is more usual in imperial.
Current x+2340=1945.005 mm, to be x+916=1944.688 mm. So within 0.5 mm, close enough.
Brunel Add name for gauge Brunel allk=on 7 ft (2,134 mm) Brunel gauge {{RailGauge/sandbox}}
Bosnian Add name for gauge Bosnian allk=on 760 mm (2 ft 5+1516 in) Bosnian gauge {{RailGauge/sandbox}} See also "Imperial"
Imperial Add name for gauge Imperial allk=on Imperial {{RailGauge/sandbox}} See also "Bosnian"
Spaces in input Input friendly 1435 mm 1,435 mm (4 ft 8+12 in) {{RailGauge/sandbox}} Input with spaces is recognised (spaces are stripped).
0 in Output friendly 2140mm 2140mm {{RailGauge/sandbox}} Situations like "0 116 in": no need to add the zero any more (to get the fraction shown).
Display only one measure Output friendly 66in disp=1 5 ft 6 in {{RailGauge/sandbox}} When a gauge is repeated in a section or table: we can prevent mentioning the 2nd measure (the conversion) again. Setting disp=1 allows us to use exactly the same RG format without repeating the conversion.
First measure Metric or imp first 66in 5 ft 6 in (1,676 mm) {{RailGauge/sandbox}} All gauges have a default sequence defined (not changed). We can force a sequence by setting first=met or first=imp.
66in first=met 1,676 mm (5 ft 6 in) {{RailGauge/sandbox}}
66in first=imp 5 ft 6 in (1,676 mm) {{RailGauge/sandbox}}
Wrap breaks Define wrap behaviour Indian wrap=y
5 ft 6 in / 1,676 mm Indian gauge
Wrap breaks (re)defined: 1. Never within a single measure (imp, met) 2. Not within a gauge name 3. Allow before gauge name 4. If wrap=y, allow after the separator (space or /).
Indian wrap=
[no; default]
5 ft 6 in (1,676 mm) Indian gauge
Easier to link Link to named gauge Indian (old:al=on), allk=on 5 ft 6 in (1,676 mm) Indian gauge {{RailGauge/sandbox}} To give the link to the named gauge, al=on|allk=on was needed. Now only allk=on is enough (also by logical sense)
Unknown gauge: no error Maintenance friendly 99in 99in {{RailGauge/sandbox}} Unknown gauge: The red error text does not appear any more. Input is shown as it is. But the page is still listed in the category. This way, the template can stay on the page, and we catch this unknown gauge (page) for improvement.
Template internals Changed workings Internally, template workings have changed: 1. Pure measure strings (imp, met) are made just once 2. Then a subtemplate "composes" the whole (sequence, wrappings, separator, etc.) into the output. Added parameters |dflt1= and |first= to handle the sequence. Each entry has an "id" value (the gauge in mm) to help checking and sorting.
Added input options
  • for 0.750in also |1=0.75in and |1=0.75"
  • for 0.250in also |1=0.25in and |1=0.25"

Tests


  • 38 in New entry, used in Clifton Rocks Railway. Input "965mm" will show metrics first (as with all options).
  • 1945 mm Change fraction. By 116 is more usual in imperial. Current x+2340=1945.005 mm, to be x+916=1944.688 mm. So within 0.5 mm, close enough.
  • Brunel Add name for gauge, imperial measure first.
  • Bosnian Imperial Add name for gauge
I wonder: is this word "imperial" really a name for the gauge, or just a saying of by imperial measure (with 2 mm diference)? -DePiep (talk) 18:36, 10 March 2013 (UTC)[reply]
  • Spaces in input Input with spaces is recognised (spaces are stripped).
  • 0 in Output friendly. Situations like "0 116 in": no need to add the zero any more (to get the fraction shown). Some six gauges are affected (I have removed "0 in" in their output).
  • Display only one measure Output friendly. When a gauge is repeated in a section or table: we can prevent mentioning the 2nd measure (the conversion) again. Setting disp=1 allows us to use exactly the same RG format without repeating the conversion.
  • First measure Metric or imp first. All gauges have a default sequence defined (not changed). We can force a sequence by setting first=met or first=imp.
  • Wrap breaks Wrap breaks are (re)defined: 1. Never within a single measure (imp, met) 2. Not within a gauge name 3. Allow before gauge name 4. If wrap=y, allow after the separator (space or /).
  • Easier to link Link to named gauge. To give the link to the named gauge, al=on|allk=on was needed. Now only allk=on is enough (also by logical sense)
  • Unknown gauge: no error When an unknown gauge is entered, the red error text" does not appear any more. Input is shown as it is. But the page is still listed in the category. This way, the template can stay on the page, and we catch this unknown gauge (page) for improvement.
  • Template internals Internally, template workings have changed: 1. Pure measure strings (imp, met) are made just once 2. Then a subtemplate "composes" the whole (sequence, wrappings, separator, etc.) into the output. Added parameters |dflt1= and |first= to handle the sequence. Each entry has an "id" value (the gauge in mm) to help checking and sorting. The testcases should prove that the template works as expected.

-DePiep (talk) 14:56, 9 March 2013 (UTC)[reply]

Pennsylvania

Looks OK but there is (are) one (2) missing, i.e. the Pennsylvania Trolley Gauges of 62.25 and 62.5 Peter Horn User talk 22:31, 9 March 2013 (UTC)[reply]
I will add the name "Pennsylvania" for 62.25in and 62.5in to the proposal (and tests, to be sure).
I understand that Pennsylvania input should be recognised (so not the full P.T.G. name is needed for input). But we can have only one input hit: "Pennsylvania" input will show (I say) the 62.25in output. When asked |allk=on both inputs 62.25 and 62.5 input will link to the PTG page. -DePiep (talk) 22:54, 9 March 2013 (UTC)[reply]
See also Template talk:RailGauge#Edit proposal (named gauges) above. Peter Horn User talk 23:07, 9 March 2013 (UTC)[reply]
Peter, what do you mean by this link? -DePiep (talk) 23:53, 9 March 2013 (UTC)[reply]
See the demo below. If there is anything wrong, maybe a detail, please write. -DePiep (talk) 23:36, 9 March 2013 (UTC)[reply]
Done, added.
It is just an Xreference. Peter Horn User talk 19:55, 10 March 2013 (UTC)[reply]
Template:RailGauge/testcases/checkTemplate:RailGauge/testcases/checkTemplate:RailGauge/testcases/check

It is in the /sandbox, so it is part of the proposal. Test pages will be informed and changed later on. -DePiep (talk) 23:36, 9 March 2013 (UTC)[reply]

By the way, shouldn't it be Pennsylvanian gauge, not Pennsylvania, here? -DePiep (talk) 01:12, 10 March 2013 (UTC)[reply]
I changed it: Pennsylvanian, like Iberian or Russian. done. -DePiep (talk) 01:24, 10 March 2013 (UTC)[reply]
Changed target page (the redirect) to be more clear: Pennsylvanian trolley gauge. -DePiep (talk) 17:44, 10 March 2013 (UTC)[reply]

Edit protect of 15 March 2013

Thanks. Yes, some nice puzzling and testing to do here. -DePiep (talk) 09:38, 16 March 2013 (UTC)[reply]

Four uncovered gauges

The next four gauges are not in the template. I propose adding them.

This gauge could use a source.
The Spanish wiki says (es:Latour-de-Carol): Latour-de-Carol hacia Puigcerdá y Barcelona (España). Ancho ibérico (1668mm).
Which makes more sense to me. 1650 mm probably an error. -DePiep (talk) 12:53, 17 March 2013 (UTC)[reply]

-DePiep (talk) 12:46, 17 March 2013 (UTC) - Added sandbox demo. -DePiep (talk) 21:02, 17 March 2013 (UTC)[reply]

Proposed below. -DePiep (talk) 23:59, 18 March 2013 (UTC)[reply]
 Done, some time ago (see edit request in next section). -DePiep (talk) 09:19, 16 May 2013 (UTC)[reply]

Add three and do template cleanups

I propose the next 3 additions and an input/output cleanup for the template. All is in the {{RailGauge/sandbox}}, a demo overview in {{railGauge/entry check}}. If we agree, I'll write the edit request. -DePiep (talk) 23:59, 18 March 2013 (UTC)[reply]

Add gauge entries (new)
Add input options (existing gauges)
  • ussg add 4'8.5" --> 4 ft 8+12 in (1,435 mm)
  • 0.25in add 0.25 --> 0.25
  • 56in add 56" --> 4 ft 8 in (1,422 mm)
  • 622mm: add |2ft0.5in|2'0.5" --> 2 ft 12 in (622 mm)
  • 613mm 24.125in: add |2ft0.125in|2'0.125" --> 2 ft 18 in (613 mm)
Output change
  • show 0.25 not 0.250 in =0.250 --> 0.250
3in an up: use fractions (132) not decimals:
  • 450mm =450 mm (17+2332 in) --> 450 mm (17+2332 in)
  • 765mm =765 mm (2 ft 6+18 in) --> 765 mm (2 ft 6+18 in)
  • 860mm =860 mm (2 ft 9+78 in) --> 860 mm (2 ft 9+78 in)
  • 1062mm =1062mm --> 1062mm
Remove input options
Non-intuitive (uncommon) abbrevs
  • removed: oh vic scot prov (full names are available)
Unsupported or confusing input formats:
  • 1537mm 60.5: 5ft1/2in 5'1/2" do not use frac here
  • 622mm: remove 2.5ft|2.5' (confusing)
  • 613mm 24.125in: 2.125ft|2.125' (confusing)
  • 406mm 16in: remove option 1.4ft (confusing)
  • 419mm 16.5in: remove option 1.4.5ft (confusing)
Uncommon metric input options
Not generally supported input formats (we do not do detailed metres, use mm instead):
  • |0.61|0.61m |0.711|0.711m, |0.76|0.76m, |0.838|0.838m, |0.860|0.860m, |0.95|0.95m, |0.965, |1.473|1.473m, |1.664|1.664m, |1.672|1.672m, |1.676|1.676m, |1.88|1.88m, |1.945|1.945m, |2.14|2.14m
Note: Whenever an input option is removed, but used on a page: that page will be listed in the maintenance category (unrecognised gauge).
Change input options sequence
Basic sequence is: 65|65in|65"|5ft5in|5'6" (imperial)
or: 1435|1435mm|1,435|1,435m (metric)
So changed into this sequence (with no visible effect):
  • 600mm input seq
  • 1600mm input seq
  • 15in input seq
  • 1100mm input seq

-DePiep (talk) 23:59, 18 March 2013 (UTC)[reply]

Template speed
Also: high-usage rail gauges (like sg) are moved to the top, to speed up the template. They are
sg, ussg, iberian, russian, metre. -DePiep (talk) 18:32, 24 March 2013 (UTC)[reply]

Edit request on 24 March 2013

-DePiep (talk) 11:44, 24 March 2013 (UTC)[reply]

Reopened request after improving sandbox. Adjusted "this version" link. -DePiep (talk) 21:12, 24 March 2013 (UTC)[reply]
 Done. Thanks as always. The template is awfully slow to load, though - have you considered porting it to Lua? I'm still getting my head round all the various technical aspects, but as I understand it mw.loadData has been provided for cases like this one, and using it should provide a big performance increase. — Mr. Stradivarius ♪ talk ♪ 08:07, 25 March 2013 (UTC)[reply]
Thx again. Yes, he's very slow. I'll take a look at your suggestion, that is new to me. -DePiep (talk) 08:49, 25 March 2013 (UTC)[reply]

disp=or

I have added disp=or to use "or" as a separater e.g. {{railgauge|1000mm|disp=or}} → "1,000 mm or 3 ft 3+38 in". JIMp talk·cont 11:14, 18 April 2013 (UTC)[reply]

Very good. (By the way, how did you manage this without typo? ;-) -DePiep (talk) 20:46, 18 April 2013 (UTC)[reply]

Wikidata proposal

See this proposal for Wikidata. -DePiep (talk) 09:37, 16 May 2013 (UTC)[reply]

Possible double definitions

Here is a list of gauge definitions from the template list. It looks like they are definitions of the same gauge but with a different value. For each of them, please discuss per pair: are they different (then keep) or are they the same (we merge them into one definition (the disposed definition will be put in a maintenance category so we can edit the article that uses it). -DePiep (talk) 10:27, 16 May 2013 (UTC)[reply]

10.5 mm
  • 10.5 → 10.5
  • 10.5mm → 10.5 mm (0.413 in)

-- confusing input options, better require "10.5in"

Sandbox: removed option 10.5. Remaining: 10.5mm, 10.5in, 10.5".
10.5mm → 10.5 mm (0.413 in)
10.5in → 10+12 in (267 mm)
0.650 in
  • 0.649in → 0.649in
  • 0.650in → 0.650in

-- are these really different?

Sandbox: rm 0.649in options & definition. Suspiciously close to 0.650in (0.02 mm), looks like an old rounding variant for the same gauge.
6.5 mm
  • 6.5mm → 6.5 mm (0.256 in)
  • 0.256in → 0.256 in (6.5 mm)
  • 0.257in → 0.257in

-- is this really a different one, or just a rounding variant?

Sandbox: removed 0.257in gauge. Most likely a rounding variant for 0.256in.
22 in
  • 558mm → 558mm
  • 22in → 1 ft 10 in (559 mm)

-- better define 558mm to be 22 in right?

Sandbox. Changed: 558mm into 559mm, and being exactly 22in. (so 558mm does not exist here any more).
860 mm
  • 860 → 860
  • 34in → 2 ft 10 in (864 mm)

-- While 34 inches (863.600 mm) = 864 mm, why split them?

The diff is 4mm, which is much. So we treat them as different gauges:
860mm=33+2732 in.
34in=864mm (from 863.6mm).
Sandbox: added
864mm → 864mm
Input 860mm, 34in puts page in the maintenance category, so we can check these pages individually on whether 860mm or 864mm was intended. (After these checks this category could be removed, in a next list version).
Todo: check documentation to list 860mm, 864mm, and 34in correctly.
0.750in
  • Input option 0.750in should also have0.75in
Not changed± already in there.
9mm
  • 9mm → 9 mm (0.354 in)
  • 8.97mm → 8.97mm
Sandbox: not changed, but the pages will be listed in for individual inspection (are these two the same gauge or not).

-DePiep (talk) 10:27, 16 May 2013 (UTC)[reply]

Layout and format: list by input. -DePiep (talk) 20:28, 4 June 2013 (UTC)[reply]
I am editing this in the sandbox (to go into the live template later on). Any input options that are removed, and that are actually used in articles, will then show up in the maintenance category. We can inspect these listed pages individually. -DePiep (talk) 13:32, 27 June 2013 (UTC)[reply]

Done in the sandbox. Will check. The tracking category is Category:Pages with incorrect use of RailGauge template. DePiep (talk) 14:56, 27 June 2013 (UTC)[reply]

 Done [4] -DePiep (talk) 21:47, 4 July 2013 (UTC)[reply]

Yet another "oddball"

For Trams in Leipzig 1,458 mm (4 ft 9+1332 in)/1,458 and for Tram track gauge 1,458 mm / 4 ft 9+1332 in/1458 instead of 1,458 mm. There is no output...yet. Peter Horn User talk 23:51, 20 June 2013 (UTC)[reply]

One can write: {{RailGauge|1,458 mm}} in that page (I just did).
Result: 1,458 mm on the page and a note in Category:Pages with incorrect use of RailGauge template (because it was not recognised by the template). One might follow that category: it shoud be empty but for these pages.
What inch measure you propose? -DePiep (talk) 00:07, 21 June 2013 (UTC)[reply]
Say 1,458 mm (4 ft 9.401575 in) make that 91332 or 9+1332 in Peter Horn User talk 00:56, 21 June 2013 (UTC)[reply]
This one should also be inserted int the list. Peter Horn User talk 01:36, 26 June 2013 (UTC)[reply]
Yes. I am preparing the changes in {{RailGauge/sandbox}}, when testing OK I´ll have them put in the live template. DePiep (talk) 13:38, 27 June 2013 (UTC)[reply]

 Done [5] -DePiep (talk) 21:48, 4 July 2013 (UTC)[reply]

To be inserted into the list

From Sofia Tramway 1009. Peter Horn User talk 01:04, 21 June 2013 (UTC) Peter Horn User talk 01:08, 21 June 2013 (UTC)[reply]

Looks like it is already in: {{RailgGauge|1009mm}}1,009 mm (3 ft 3+2332 in). -DePiep (talk) 10:02, 21 June 2013 (UTC)[reply]
...but it should be changed into: 3 ft 3+2332 in (calculates to 1008.8563 mm, correct). It was originally defined in metric, so we should calculate the inches; not a nominal inch measure, if I understand it well. -DePiep (talk) 10:16, 21 June 2013 (UTC)[reply]
Double check {{convert|1009|mm|ftin|abbr=on}} 1,009 mm (3 ft 3.7 in) or {{convert|1.009|m|ftin|abbr=on}} 1.009 m (3 ft 3.7 in). So it should be corrected, asap, to 3 ft 3+2332. Peter Horn User talk 00:43, 29 June 2013 (UTC)[reply]

 Done [6] -DePiep (talk) 21:49, 4 July 2013 (UTC)[reply]

More accurate?

The output of {{RailGauge|62.5}} 62.5 should perhaps be {{convert|62+1/2|in|mm|2|abbr=on}} 62+12 in (1,587.50 mm) say 1587 mm? Peter Horn User talk 01:57, 26 June 2013 (UTC)[reply]

1587.50 should be rounded upwards for being 0.50, I'd say. A 0.4999 should go downward. If I am right, then 1588 is OK. -DePiep (talk) 13:12, 27 June 2013 (UTC)[reply]
Agreed. Peter Horn User talk 18:32, 29 June 2013 (UTC)[reply]

 Not done -DePiep (talk) 21:51, 4 July 2013 (UTC)[reply]

Edit request on 2 July 2013

DePiep (talk) 13:41, 2 July 2013 (UTC)[reply]

Done! Plastikspork ―Œ(talk) 21:06, 4 July 2013 (UTC)[reply]
Thanks. Will take a look at /documentation and maintenance category. -DePiep (talk) 21:39, 4 July 2013 (UTC)[reply]