Template talk:Track gauge
Trains Template‑class | |||||||
|
Unexpected effects
I found this, not sure if it has to do with TemplateStyles etc. Article Great Western Railway uses {{Infobox GWR}}, {{Track gauge}} and {{Convert}}.
- It has template output like:
- {{Track gauge|uksg}} (in lede)
- expct: 4 ft 8+1⁄2 in (1,435 mm)
- shows: 4 ft 8+½ in (1,435 mm)
- {{Convert|11+1/2|mi|km|0|adj=on}} section (in body)
- expct: 11+1⁄2-mile (19 km) section
- shows: 11+½-mile (19 km) section
- That is: the "+" and "½" (fraction character) are unexpected. This also happens within {{Infobox GWR}}.
Research & reproduce: I found that when {{Infobox GWR}} is removed (absent), the output is regular. To reproduce: in Special:ExpandTemplates put the lede (and the {{Convert}} code from body), and check with/without {{Infobox GWR}}.
This is as far as I could get. Has to do with TS? @Izno: -DePiep (talk) 09:52, 17 May 2021 (UTC)
- This is due to the specific template first using this module when the module is wrapping the gauge in a link and is fundamentally this issue. Let me see if I can fix it here. Izno (talk) 15:10, 17 May 2021 (UTC)
- First fix works. I will see if I like one of the other solutions I was thinking about. Izno (talk) 15:32, 17 May 2021 (UTC)
- I think I do prefer this version. Please feel free to sync as desired. Izno (talk) 15:49, 17 May 2021 (UTC)
- Test #1. Basic input options look fine, using Module:Track gauge/sandbox: see Template:Track_gauge/testcases#All . -DePiep (talk) 21:23, 17 May 2021 (UTC)
- Test #2: Article Great Western Railway with {{Track gauge/sandbox}}, also in {{Infobox GWR/sandbox}}. OK in preview. . -DePiep (talk) 21:38, 17 May 2021 (UTC)
- OK. Edit request: Please someone put all code Module:Track gauge/sandbox into Module:Track gauge (diff). -DePiep (talk) 21:38, 17 May 2021 (UTC)
Recurring bug
- @DePiep: I'm still seeing the + (but not the fraction character) at Track gauge#Early track gauges ("the Dundee and Newtyle Railway (1831) in the north-east of Scotland adopted 4 ft 6+1⁄2 in (1,384 mm)"). The correct output appears in preview. Hairy Dude (talk) 12:48, 24 August 2021 (UTC)
- @Hairy Dude:. OK here. Did you try to Purge the article (=click on clock topright on the page)? (Could be you have an old version in the cache). Anyway, I have made a minor edit, so the article should reload anyway. OK now? -DePiep (talk) 12:55, 24 August 2021 (UTC)
- That was the first thing I tried after I saw the preview was correct. And I also made a minor edit to check. Are you not seeing it? Maybe it's some quirk of the mobile interface. Hairy Dude (talk) 13:04, 24 August 2021 (UTC)
- @Hairy Dude:. OK here. Did you try to Purge the article (=click on clock topright on the page)? (Could be you have an old version in the cache). Anyway, I have made a minor edit, so the article should reload anyway. OK now? -DePiep (talk) 12:55, 24 August 2021 (UTC)
- @DePiep: I'm still seeing the + (but not the fraction character) at Track gauge#Early track gauges ("the Dundee and Newtyle Railway (1831) in the north-east of Scotland adopted 4 ft 6+1⁄2 in (1,384 mm)"). The correct output appears in preview. Hairy Dude (talk) 12:48, 24 August 2021 (UTC)
- Izno, could you take a look?
- In mobile view, Track gauge#Early track gauges using {{Track gauge|4ft6.5in}} shows the "+"-sign in a fraction. -DePiep (talk) 11:02, 11 September 2021 (UTC)
- This change should work around it. Izno (talk) 13:22, 11 September 2021 (UTC)
- Coming back two years later, I'm still seeing these pluses at Track gauge. Hairy Dude (talk) 13:00, 21 August 2023 (UTC)
- This change should work around it. Izno (talk) 13:22, 11 September 2021 (UTC)
Lego Trains
- {{Track gauge}} list definition: 37.5 mm (1+15⁄32 in) Lego Trains
- Unit conversion (calculation): 37.5 mm converts to 1.47638 inches (or 1+15⁄32 inches)
- Article: Lego Trains
- Defined in source: [1][2]
- Currently in sandbox: 37.5 mm (1+15⁄32 in) Lego Trains
- Note: aliases:
L scale, Lego, Lego Trains
- Conclusion: Done
DePiep (talk) 15:11, 30 August 2022 (UTC)
4ft 2 1/2in (1283 mm)
- {{Track gauge}} list definition: 4 ft 2+1⁄2 in (1,283 mm)
- Unit conversion (calculation): 50.5 inches converts to 1,282.70 mm
- Article: Saltburn Cliff Lift
- Content category: ?
- Defined in source: [1]
- Currently in sandbox: 4 ft 2+1⁄2 in (1,283 mm)
- Note: expected: 1283 mm
- Conclusion: Sourced, so add; RS? Done
-DePiep (talk) 16:03, 30 August 2022 (UTC)
1522 mm (Helsinki metro)
- {{Track gauge}} list definition: 1,522 mm (4 ft 11+29⁄32 in)
- Unit conversion (calculation): 1,522 mm converts to 59.9213 inches (or 4 feet 11+29⁄32 inches)
- Article: Helsinki metro
- Content category: Category:1520 mm gauge railways (24)
- Defined in source: [1][2]
- Currently in sandbox: 1,522 mm (4 ft 11+29⁄32 in)
- Note: middle of metric 1520mm and imp 1524mm
- Conclusion: Two sources, to add. Done
-DePiep (talk) 16:59, 30 August 2022 (UTC)
Template-protected edit request on 30 August 2022
Please replace all code in Module:Track gauge/data ← Module:Track gauge/data/sandbox (diff)
Changes: three new sourced gauge-definitions are added (§ Lego Trains, § 4ft 2 1/2in (1283 mm), § 1522 mm (Helsinki metro)). Also (minor), trivial comma replaced by period (46×).
Test: testcases 1, 2, 3. DePiep (talk) 16:48, 30 August 2022 (UTC), added #3 -DePiep (talk) 17:12, 30 August 2022 (UTC)
- Done. P.I. Ellsworth , ed. put'r there 19:31, 30 August 2022 (UTC)
1ft 11in
- {{Track gauge}} list definition: 1 ft 11 in (584 mm)
- Unit conversion (calculation): 23 inches converts to 584.200 mm
- Article: Hendre-Ddu Tramway
- Content category: Category:2 ft gauge railways in Wales (19) (!)
- Defined in source: [1]
- Currently in sandbox: 1 ft 11 in (584 mm)
- Note: aliases:
- Conclusion: Done, added 2023-01-01 [1]. Todo, separately: formally merge 1 ft 11 in (584 mm) and 1 ft 10+3⁄4 in (578 mm) as similar, for example in categorisation. 08:05, 2 January 2023 (UTC)