Yes, this is precisely what I mean. It could be some js gadget that does this, just like the google translate gadget makes it easy to translate a word by rolling over the text, this would let users see the value in different units the same way. However this gadget needs to know what is supposed to be converted. So there is also some need to alter the current articles as they are.
Maybe it would be possible for it to automagically recognize what is a unit using some regex or something like it, but I am afraid it wouldn't be very reliable if the unit and value wasn't clearly specified in wikitext. There are some special values, for example recently I was reading about hard drives and values like size per square inch (for example Tib/sq. inch) and similar are pretty exotic to be matched easily by some automatic algorithm without explicitly specifying what kind of unit is that.
On Fri, Jan 17, 2014 at 10:38 AM, Antoine Musso hashar+wmf@free.fr wrote:
Le 17/01/14 09:58, Petr Bena a écrit :
There are many articles on wikipedia that contain different units. Some use cm, that are common in europe, other use inches that are more widely used in US, same with other unit types.
I think it would be cool if an extension was created which would allow everyone to specify what units they prefer, and the values in articles would be converted automatically based on preference.
For example you would say the object has width of {{unit|cm=20}} and people who prefer cm would see 20 cm in article text, but people who prefer inches would see 7.87 inch. This could be even based on geolocation for IP users
Hello,
I like the idea. One thing to take in account is that the unit conversion should be done on the client side to avoid fragmentation of the parser cache.
A possibility would be for the template to output BOTH metrics and imperial units, then use JS/CSS to hide the irrelevant one. Hence {{unit|cm=20}} would generate something like:
<span class="mw-unitsystem-imperial">7,874 inches</span> <span class="mw-unitsystem-metric">20 cm</span>
Then using user preference to hide one of the class.
-- Antoine "hashar" Musso
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l