Template talk:Infobox road

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Highways (Rated Template-class)
WikiProject icon This template is within the scope of WikiProject Highways, a collaborative effort to improve the coverage of highways on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
 Template  This template does not require a rating on the project's quality scale.


Are there any plans to convert parts of this infobox to Lua, specifically the shield, route name, and translation? Now that we have fairly robust road data modules, I think these three items should be handled by the road data modules. Yes, I know that these will eventually be handled by Wikidata, but who knows when that will happen? We can use Lua now.

For those locations that don't yet have a road data module, we could utilize a tracking category to catch them, but I don't think there are very many. –Fredddie 16:01, 16 May 2015 (UTC)

There's no reason why we couldn't have the shield handled by Wikidata, similar to how the maps are now, though Happy might be waiting on other development last I heard (several months ago). --Rschen7754 16:04, 16 May 2015 (UTC)
Yes, my Summer of Code development. Face-wink.svg I have no problem with migrating the infobox shields, names, and translations over to the road data string modules. That can be done right now while we're waiting for the corresponding Lua code, since adding unused keys won't cause any errors. The only issue with using shields from Wikidata is an override for highways with non-free shields. I would also like to migrate the colors to the string modules at some point. As for the rest of the infobox, I'm still waiting for mw:Extension:Capiunto to be deployed. -happy5214 00:42, 17 May 2015 (UTC)
@Happy5214: do you have anything to report from the last four months? –Fredddie 01:37, 3 September 2015 (UTC)
No, nor might I have anything over the next four months. Feel free to migrate the infobox-specific data to the string modules, but module development has been stalled due to lack of progress on Capiunto and my own personal inactivity. -happy5214 07:13, 3 September 2015 (UTC)

Something that might be possible is to have Module:Infobox_road/length get the length from Wikidata, if available and not specified locally. I added length to [1] and we at least can use the same source for all US Interstate articles. Aude (talk) 09:09, 9 October 2015 (UTC)

@Aude: I have a few concerns about doing this now, although I'm sure it will be done eventually. Do you happen to know how quantities with units are handled in the Wikibase Lua library? Are unit conversions available from the library, or will client code (Infobox road/length) still be required to convert between miles and kilometers? -happy5214 11:10, 9 October 2015 (UTC)
@Happy5214: I don't think there is special handling (yet) in the Wikibase lua library for quanitites (e.g. conversion), but there is Module:Convert. What (else) do you have in mind that we need in the lua library? Suppose for now, I could help with adding this data to Wikidata and maybe experiment with lua in a sandbox module. Aude (talk) 12:29, 9 October 2015 (UTC)
Since I already have unit conversion code in my module, I guess all I would have to have is a way to determine the unit used for the statement. -happy5214 03:32, 10 October 2015 (UTC)
In the past, the only reason we never used {{Convert}} was because we wanted it to appear <length><reference> (<conversion>). So long as that's preserved, there will be no opposition from the "it's always been that way" lobby. –Fredddie 13:02, 10 October 2015 (UTC)
@Happy5214: now that I've thought about it for a little while, you really shouldn't need units. There are only a handful of countries (US, UK, Liberia, maybe one more?) that use miles for anything, so the country property should influence what unit is used. –Fredddie 14:11, 10 October 2015 (UTC)