قالب:Convert/Transwiki guide

So, you want to transwiki {{convert}} ... and you're probably wondering where you should start copying roughly three thousand subpages over. To make sense of things it might be helpful to look at the history of the template.

History

Convert I

The template was created in December 2006 by Drumguy8800. The template originally used a system of {{#switch}}s to choose between different units and modes of display. By October 2007 this system had become quite large and complex as new units and functionality had been added. However, it remained all on the one page, all 12,679 bytes of code. Let's call this version of the template Convert I.

In spite of its size and complexity this version was still quite limited in terms of functionality and units covered. Users requested more but the problem with {{#switch}}s is that they eat up the template limits. More units and/or functions would mean more and/or bigger {{#switch}}s and thus a slower template. Something needed to be done to deal with other qualities. Templates {{convertW}} and {{convertV}} were created in Convert I's image to convert mass and volume respectively. Meanwhile, however, work was being done on an alternative design.

Convert II

November 2007 saw a complete overhaul of the template. Let's call this second version Convert II. We've been using this version ever since. Convert I's {{#switch}}s were replaced with an array of subtemplates. There are subtemplates for units, subtemplates for display and subtemplates for calculation. This subpage design has allowed for an enormous increase in the functionality and capacity of the template. New functionality and units could be added without bloating what was already there. It now handles hundreds of units and is capable of several ways of presenting the conversions.

Of course this came at a cost. Convert I's single page was replaced by hundreds of Convert II pages. The overhaul had been expected to take a couple of weeks but new ideas/requests kept flowing in and four years later work continues. Over the years the functionality of the template has expanded and expanded. There are currently about three thousand subtemplates.

Convert III

Many of Convert II's subtemplates were added ad hoc to cover ideas unthought-of in 2007, the requests for new functionality being limited only by the imagination of the hundreds of users of the template. The template has become somewhat difficult to work on. It's full of quirks, twists and knobbles. It could do with another overhaul. Much has changed in the past four years: calculations not possible back then are possible now, the template limits in place back then are different to those in place now.

Work has begun on another rewrite of the template. Let's call it Convert III. It is hoped that this newer version will have even greater functionality whilst requiring fewer subtemplates. I cannot say yet, however, when (or even whether) it will be ready.

How to get started transwikiiing {{convert}}

So, what do you do if you want to transwiki this template? You'll have to decide which version of the template do you want to transwiki. But first it might be useful to have a look at {{convert/basic}}.

Perhaps, at least for now, Convert I would suffice. If so, you'd be better off with {{convert/basic}}. {{Convert/basic}} is based on the coding of Convert I in that it uses {{#switch}}s. The functionality and capacity of {{convert/basic}} is a little better than Convert I (but still nowhere close to that of Convert II). The advantage is that you only have to transwiki a few templates (15 or so as compared to about 3000).

You could start transwikiing the current version (Convert II), just be prepared for a bit of work when (or if) Convert III comes along: just take what you need for now don't get carried away moving everything over.

You could wait for Convert III. Perhaps you could just stick with manual conversions until Convert III is available. You could start transwikiing what I've got of Convert III but you'd have to keep up with it as it evolves. Use {{convert/basic}} until Convert III is working.

Known problems

A problem was discovered when transwikiing the template to the Bengali Wikipedia. {{Convert}}'s rounding subtemplates were calling {{rnd}} but {{rnd}} was not returning anything. I (Jimp) think the problem was with {{rnd}}'s not recognising the Bengali numerals. I was able to get the template working by replacing {{rnd|a|b}} with {{#expr: a round b}} but, of course, this means we don't have the benefits of {{rnd}}.