मुक्त ज्ञानकोश विकिपीडिया से

This page is to discuss translations required for Module:Convert which could be used to implement Template:Convert. It is helpful for me to have this page as a central location for discussion, so please discuss any issues here, or add a new section.

Information on what is needed to adapt the module is available at the transwiki guide and the translate page that it links to.

Johnuniq (वार्ता) 11:52, 10 अप्रैल 2014 (UTC)

Convert/text[संपादित करें]

Information is available at en:Template:Convert/Transwiki guide/translate#Convert/text. You may like to edit the convert/text module, or describe what is needed here. Johnuniq (वार्ता) 11:52, 10 अप्रैल 2014 (UTC)

Categories[संपादित करें]

At enwiki, one of the following error tracking categories is added to any article where invalid input is provided to the convert template:

  • Category:Convert invalid units
  • Category:Convert invalid options

However, two categories are not needed—one category is sufficient and is easier. What name should be used for one error category? Or, if two categories are wanted, what are the two names? Johnuniq (वार्ता) 11:52, 10 अप्रैल 2014 (UTC)

In case changing the two categories to one requires changes to the main module, I think keeping two categories would be better. In this case the categories can be translated as:
  • Category:Convert invalid units --> श्रेणी:कनवर्ट साँचे में अमान्य इकाई
  • Category:Convert invalid options --> श्रेणी:कनवर्ट साँचे में अमान्य विकल्प
And in case changing two categories to one only requires changing the text module, the following category name can be used:
  • श्रेणी:कनवर्ट साँचे में त्रुटि (This means roughly Category:Error in convert template)
Let me know if this name is inappropriate for this usage (if such a name would be needed at any other place in the module).--सिद्धार्थ घई (वार्ता) 09:36, 12 अप्रैल 2014 (UTC)

Ranges[संपादित करें]

Searching convert/text for "range_types" shows some text where translations are needed. If wanted, edit the module, or add the required text here (add the text on each of the following lines). Some of these may not be used. The last is rare, but can be used as in "from 1 to about 5 meters", in other words, the 5 is an approximate value. Johnuniq (वार्ता) 11:52, 10 अप्रैल 2014 (UTC)

  • and = और
  • or = या
  • by =
  • to = से
  • to about = से लगभग
Added four translations above.
As of now, I'm personally not aware of a proper translation for by (as in 60 by 120 feet). The only way this can be properly written in hindi (that I know of) is to change the by into a multiplication symbol. I'll enquire with other users to be sure.--सिद्धार्थ घई (वार्ता) 09:49, 12 अप्रैल 2014 (UTC)
I have to go elsewhere, so I will add the translations on this page later. However I'll mention that guwiki uses a multiply sign for "by"; see examples at gu:User:Johnuniq/translate#Ranges. Johnuniq (वार्ता) 11:49, 12 अप्रैल 2014 (UTC)

SI prefixes[संपादित करें]

Prefixes are used so a unit only needs to be defined once. For example, at enwiki the unit code g (gram) is defined, and that automatically allows units like kg (kilogram) and mg (milligram) to be used in conversions. A translation is needed for each symbol and name. Any blank entries will use the en symbol or name. I will add these to Module:Convert/text but will keep the original values so converts copied from enwiki continue to work. Johnuniq (वार्ता) 11:52, 10 अप्रैल 2014 (UTC)

Exponent en symbol en name hi symbol hi name Reference/Notes
24 Y yotta योट्टा योट्टा
21 Z zetta ज़ीट्टा ज़ीट्टा
18 E exa एक्जा एक्जा Appendix A2 of the NCERT Physics Class XI textbook
15 P peta पेटा पेटा Appendix A2 of the NCERT Physics Class XI textbook
12 T tera टेरा टेरा Appendix A2 of the NCERT Physics Class XI textbook
9 G giga गीगा गीगा Appendix A2 of the NCERT Physics Class XI textbook
6 M mega मेगा मेगा Appendix A2 of the NCERT Physics Class XI textbook
3 k kilo किलो किलो Appendix A2 of the NCERT Physics Class XI textbook
2 h hecto हेक्टो हेक्टो Appendix A2 of the NCERT Physics Class XI textbook
1 da deca डेका डेका Appendix A2 of the NCERT Physics Class XI textbook
-1 d deci डेसि डेसि Appendix A2 of the NCERT Physics Class XI textbook
-2 c centi सेंटी सेंटी Appendix A2 of the NCERT Physics Class XI textbook
-3 m milli मिली मिली Appendix A2 of the NCERT Physics Class XI textbook
-6 µ micro माइक्रो माइक्रो Appendix A2 of the NCERT Physics Class XI textbook
-9 n nano नैनो नैनो Appendix A2 of the NCERT Physics Class XI textbook
-12 p pico पीको पीको Appendix A2 of the NCERT Physics Class XI textbook
-15 f femto फ़ैम्टो फ़ैम्टो Appendix A2 of the NCERT Physics Class XI textbook Note that a nukta is added on फ for correctness' sake although the reference doesn't contain one
-18 a atto एटो एटो Appendix A2 of the NCERT Physics Class XI textbook
-21 z zepto ज़ैप्टो ज़ैप्टो
-24 y yocto योक्टो योक्टो
I've added hindi names above per the ones used in the अन्तर्राष्ट्रीय इकाई प्रणाली article table 2. Note that I've done slight corrections. These are only transliterations, not translations, and hence some spellings might need to be changed before being added to the module. I'll try to find the spellings used in outside reliable published sources.--सिद्धार्थ घई (वार्ता) 10:17, 12 अप्रैल 2014 (UTC)
Updated some prefixes with reference and notes.--सिद्धार्थ घई (वार्ता) 12:29, 12 अप्रैल 2014 (UTC)
OK, per the progress section, we have a problem here. The module automatically creates unit abbreviations by adding the prefix symbols to the basic unit names. Since devanagari does not have case (there's no lowercase/uppercase), single letter/glyph/akshar prefixes are not possible (both yocto and yotta would be यो and hence undistinguishable). The only possible solution I see is the one used by guwiki, specifying the entire words as prefixes. But that too is not a good solution, since if abbreviation is on, the prefix would then appear in full and the unit would appear as an abbreviation. This can, I think, be remedied by making the default behaviour to be abbr=off (i.e no abbreviation usage in output by default).
We can then specifically add common abbreviations for certain prefix-unit combinations, such as km.
So the hi symbol column can (for now) be made the same as the hi name.--सिद्धार्थ घई (वार्ता) 06:05, 13 अप्रैल 2014 (UTC)

Defaulting to abbr=off is easy, but is it really desirable? Consider the current templates:

  • {{convert|1|ft|mm}} → 1 फुट (300 मि॰मी॰)
  • {{convert|300|mm|ft}} → 300 मिलीमीटर (0.98 फीट)
  • {{convert|4567|ft|km}} → 4,567 फीट (1.392 कि॰मी॰)
  • {{convert|1.2|km|ft}} → 1.2 किलोमीटर (3,900 फीट)
  • {{convert|1|ft|mm|abbr=on}} → 1 फीट (300 मि॰मी॰)
  • {{convert|300|mm|ft|abbr=on}} → 300 मि॰मी॰ (0.98 फीट)
  • {{convert|4567|ft|km|abbr=on}} → 4,567 फीट (1.392 कि॰मी॰)
  • {{convert|1.2|km|ft|abbr=on}} → 1.2 कि॰मी॰ (3,900 फीट)
  • {{convert|1|ft|mm|abbr=off}} → 1 फुट (300 मिलीमीटर)
  • {{convert|300|mm|ft|abbr=off}} → 300 मिलीमीटर (0.98 फीट)
  • {{convert|4567|ft|km|abbr=off}} → 4,567 फीट (1.392 किलोमीटर)
  • {{convert|1.2|km|ft|abbr=off}} → 1.2 किलोमीटर (3,900 फीट)
  • {{convert|1|Ym|mi}} → 1 योट्टामीटर (6.2×1020 मील)
  • {{convert|1|Gm|mi}} → 1 गीगामीटर (620,000 मील)
  • {{convert|1|µm|in}} → 1 माइक्रोमीटर (3.9×10−5 इंच)

The issue that needs to be solved is what convert should do if something like {{convert|1|Gm|mi}} is copied from enwiki. Essentially, you don't care because that is unlikely, but the code has to do something. Why not leave the default at abbr=out (as the current template does), then fix undesirable cases that arise by defining the units as exceptions? You might define km, mm and a dozen others, and ignore the fact that Gm (with abbr=on) would show something undesirable because if ever needed, it can be fixed later. Johnuniq (वार्ता) 11:32, 13 अप्रैल 2014 (UTC)

About whether setting abbr=off is desirabe, well, not really. But then neither is it desirable to have weird abbreviations popping up in the future.
Some prefixes could be translated (such as कि for k, मि for m etc.) But then we have the issue that some unit names can't really be abbreviated in hindi. Example: foot is written फ़ुट in hindi. That's two glyphs, and it can't be abbreviated. So abbr=on with output asked for being kilofoot would then render किफ़ुट (analogous to kfoot ). That's the prefix appearing abbreviated and the unit name not being abbreviated (coz the full unit name was input for the abbreviation).
On the other hand, if we input full prefix names as prefix symbols, then the units that can be abbreviated end up with a full prefix and an abbreviated unit name (such as मेगाग्रा for megagram).
Needless to say, both of the above situations are undesirable. And considering that as far as I know official teaching of the sciences in hindi uses the original english abbreviations for the units, only transliterating the full unit names (and that too only the common ones). But, some abbreviations do appear in common usage despite the lack of official usage, such as किग्रा for kg, किमी for km etc.
And I've been around on wikipedia long enough to know that things left for solving later have a habit of staying the same for years at a time, if not forever.
Considering all the above factors, I'd rather have an ugly system which works (ugly long unit names in hindi) rather than an elegant system which works only partially(botched abbreviations of units).
To elaborate further on what I'm trying to achieve (since I'm thinking with more clarity now that I've written down the entire issue), I propose the following:
  • We scrap (read remove) any basic unit abbreviations that I've added, or that were present already (Basic unit means units like meter, gram etc.; not the ones with any prefix)
  • We populate prefix symbols and unit symbols with the full names for all the units, except wherever actual hindi abbreviations are available, we add specific abbreviations (defining them as exceptions as you suggest above)
If we implement the above, we could retain the abbr=out which would give the appropriate hindi abbreviation if available, and if not available, give the full hindi name of the unit instead of botched abbreviations.
Let me know if this makes sense.--सिद्धार्थ घई (वार्ता) 15:43, 15 अप्रैल 2014 (UTC)

Only units defined as accepting an SI prefix allow them. For example, ft is not an SI unit so kft would be rejected as an error. The SI units are as follows. I've put several recently added SI units at the end (starting at "Absorbed radiation dose") because they are very rarely used in converts, and it's better to get the fundamental SI units working well without worrying too much about things that would rarely occur, if ever.

Type en symbol en name
Area a are
Area m2 square %smetre
Energy J joule
Force N newton
Length m metre
Mass g gram
Power W watt
Pressure Pa pascal
Time s second
Volume l litre
Volume m3 cubic %smetre
Absorbed radiation dose Gy gray
Absorbed radiation dose rad rad
Charge coulomb coulomb
Equivalent radiation dose Sv sievert
Equivalent radiation dose rem rem
Magnetic field strength T tesla
Magnetizing field Oe oersted
Radioactivity Bq becquerel
Radioactivity Ci curie

In the above, "%s" indicates where the SI prefix name would be inserted if abbr=off and a prefix are used (for example, km2 → square kilometre).

If, for example, it does not make sense for s to be an SI unit here, the "SI" can be removed from the definition. Then, if ks is ever used, it would give a convert error ("unknown unit"), and if wanted, a definition for ks could be added. In fact, many of the above could have their SI removed so only the common units need to be considered.

I don't quite understand some of the above: remove "any basic unit abbreviations"—remove what from where?

If you are ready, please finish changes to this page and let me know that I should implement it. Then I would put it in the module and make some examples for testing. If it doesn't look right, we can change it. Johnuniq (वार्ता) 00:48, 16 अप्रैल 2014 (UTC)

When I said remove "any basic unit abbreviations", I thought you were adding stuff to the module as I was adding it here.
Sorry for the delay. I've finally finished the unit names in #Wanted unit names below. I've also added symbols to the SI prefix table above (the symbols are the same as the full prefixes).
Please add these to the module now.--सिद्धार्थ घई (वार्ता) 13:29, 19 अप्रैल 2014 (UTC)
Per the examples at सदस्य:Johnuniq/converts, {{Convert|12.3|km3|acre.ft|abbr=on}} gives 12.3 कि॰मी3 (10,000,000 acre⋅ft). This reads किलोघन मीटर for the input unit. This should instead be घन किलोमीटर.
Similarly, {{Convert|12.3|sqin|cm2|abbr=on}} gives 12.3 वर्ग इंच (79 से॰मी2). The output unit reads सेंटीवर्ग मी. This should instead be वर्ग सेंटीमी.--सिद्धार्थ घई (वार्ता) 07:52, 22 अप्रैल 2014 (UTC)
Also, since pascal is defined as an SI unit, an example shows the output as किलोPa for kilopascal. This is the kind of units I was trying to avoid, and in that spirit, I think the symbol for pascal should be changed from Pa to पास्कल for now (i.e same as the full name).--सिद्धार्थ घई (वार्ता) 08:11, 22 अप्रैल 2014 (UTC)

The problem with cm2 and km3 occurs because:

  • The converts have abbr=on so unit symbols are used.
  • The module always inserts the SI prefix at the beginning of an SI symbol.
  • The hiwiki units define the symbol to be the same as the name for m2 and m3.
  • Therefore the module inserts the SI prefix before the name, which gives incorrect results with "square" and "cubic" units (m2 and m3).

One way to fix the problem would be to define abbreviations for the SI prefixes and units so the module could get results like the current templates. For example, the templates define the symbol for km3 to be कि.मी and if the module's kilo SI prefix and m3 unit had the same abbreviations, the module would get the same results.

Another approach would be to define exception units as the need for them is discovered. So cm2 and km3 could be defined to workaround the above issue, but that does not solve the problem because there are a lot more SI prefixes that could be used with m2 and m3, and they will fail if symbols are used. The current templates seem to have been in use for quite a long time. Are you sure their results are not adequate?

I am just reporting the situation, and don't mind whatever the decision is. But there is no good way to handle the situation—hiwiki can either use dubious abbreviations or define exception units when needed so abbr=on will show full names rather than symbols. By the way, I am saying "abbr=on" for a shorthand—if km3 is used as an output unit, it would be abbreviated by default, so the issue would occur there despite abbr=on not being used. What do you think? Meanwhile, I changed Pa. I guess you noticed that the example converts show a lot of errors with the current template. Johnuniq (वार्ता) 11:46, 22 अप्रैल 2014 (UTC)

Ok, so as I see it, there are two ways to resolve the situations. Both would require changes in the module. I leave it up to you which is easier to implement:
The first solution is to go back to using superscripts for square, cube etc. I avoided these since I'm not sure if the module will respect the numeral system choice in the symbols too. For example, if the symbol for m3 was defined to be मी3 by default, if the user specifies |अंक=नागरी in the input, or uses nagari numerals, it would be expected that the symbol too become मी. I haven't checked out the code, but I doubt you envisaged such a scenario while writing the module, and hence I avoided the superscripts.
The second solution I see is that as you have specified SI units above with %s being the place where the prefix is placed in the output for the unit name; something similar could be implemented for abbreviations so that the position for the prefix could be specified for abbreviations too.
And yes, I know the old template system has tons of errors. Which is why I think it's better to fix the new one before implementing it :)
--सिद्धार्थ घई (वार्ता) 15:55, 22 अप्रैल 2014 (UTC)
Why not define symbols with superscripts using nagari numerals, as the current template does? This is the Hindi Wikipedia and if a reader does not like or they are going to have a lot of trouble reading the articles. You are correct that the module has no way to change a symbol depending on a language option—something could be added, but why? Have there been discussions where people have wanted an option to display 2 or 3? Johnuniq (वार्ता) 08:03, 23 अप्रैल 2014 (UTC)
Well, your question boils down to the question of community consensus. And as it currently stands, it is up to individual users to choose which type of numerals to use. The reasons for such a situation are varied and lengthy, and I will not go into them here. (Please let me know if you do want information regarding this.) The fact that the old template used one numeral system is only because the user who edited the template preferred that numeral system. It does not, however, represent a community consensus on using that numeral system (no, not even in the unit symbol).
So this basically boils down to implementing the current consensus.--सिद्धार्थ घई (वार्ता) 17:05, 23 अप्रैल 2014 (UTC)

Your earlier comments seemed more casual, but you are telling me that you know that the current template does not do what is wanted, and that it should give, for example, मी3 as the default symbol for cubic meter, but the symbol should be मी if nagari numerals are used in the output. So long as you are confident about that I can look at implementing it. I understand there are no guarantees, particularly at a wiki, but I want some confidence that it would be wanted. As it happens, I have thought of a procedure that would probably implement this without much pain for me, and more importantly, without much overhead in the module. I will give an outline before trying it so you can let me know if this sounds attractive.

At enwiki, sp=us can be used in a convert to show US spelling for unit symbols and names (for symbols, that generally means something like "U.S. gal" instead of "US gal"). At ilowiki they wanted to use that to implement some variations they have for units, and that idea could be used here.

I would change the modules to disable sp=us as an option (using it would be ignored—that is a simple configuration setting). But, convert would set sp=us automatically if the output uses nagari numerals. Then all that would be required would be to put wanted definitions in the "US symbol" and/or "US name" columns in the unit definitions.

It is likely that the only symbols which need translation are m2 and m3. Then, symbols for the SI prefixes could be defined, and conversions should just work. There are more units that have numerals in the symbol, but they are pretty weird and very unlikely to be in use. For future documentation, the following shows how m3/h (cubic meters per hour) would be translated. It is currently defined as shown in the first row. It would be translated to the second row.

Unit code Symbol US symbol Scale Extra Name Plural name US name US plural name Prefix Default Link
m3/h m3/h 1/3600 cubic metre per hour cubic metres per hour cubic meter per hour cubic meters per hour cuft/h Cubic metre per second
m3/h मी3/? मी/? 1/3600 ??? cuft/h ???

(? is "h" and ??? is "cubic metre per hour"—you might like to edit the row to show correct text for a cleaner example, and delete this line of my comment)

The US names are not needed—if they are not provided, the standard name is used. If a US name is provided, it would appear when the output uses nagari numerals. With my plan:

  • The text in the Symbol column will be used if abbr=on and arabic numerals are used.
  • The text in the US symbol column will be used if abbr=on and nagari numerals are used.
  • Similarly, text in the Name column would be used if abbr=off and arabic numerals are used.
  • If abbr=off, text in the Name column will always be used if the US name is blank. However, if nagari numerals are used in the output and the US name is not blank, the US name would be used.

How does that sound? Johnuniq (वार्ता) 04:42, 24 अप्रैल 2014 (UTC)

That sounds about right. But just to be clear:
  • You are proposing that we switch off sp=us for the output template (it would do nothing even if used)
  • Then sp=us will be used internally as a hack such that whenever the output shows nagari numerals (no matter if it's because the input was nagari or अंक=नागरी was present in the template parameters), the module would use the US spelling instead of the standard one.
  • If abbreviation is on (either due to abbr=on in the template input, or due to the default setting of abbr=out) and the output numerals are nagari, the module would automatically shift to US symbol, which would contain the symbol with nagari superscript
  • If abbreviation is off and the output is nagari numerals, the module will look for the name in the US spelling column. If that exists, it will be used. If it doesn't exist, the module defaults to the default spelling. (This would mean we don't need to duplicate the full unit names in the US spelling column).
If the above is correct, then I am fairly certain that it sounds good and should be implemented.
I am mentioning below (just for the sake of documenting it somewhere) a hackish fix that I thought up, which is clearly not as good as the fix you proposed.
The hackish fix I thought up: define the units with nagari superscripts as separate from the default ones, which continue using arabic numerals in symbol superscripts. Pro over the above method is that the sp parameter remains untouched, con is that the full unit name would have to be duplicated for the new unit definitions. Another difference (don't know if this is a pro or a con) is that output numerals would not be automatically detected, and the input unit would have to be manually changed if nagari numerals are used.
As far as your consensus related queries go, I know for a fact that there is no consensus on using either numeral system, and it is left up to the users to decide which numerals to use in the text. I also know that there are users on both sides of the debate. Hence, we have users who wish to use arabic numerals and users who wish to use nagari numerals. Needless to say, it will be awkward (and actually unethical of us) if despite knowing this we provide only partial support to any one system. I also know that despite users having a choice over using the numeral system they prefer, we have a gadget enabled by default that can convert the numerals per the reader's choice. This gadget is present because there are users on both sides of the debate who believe that the other side is dead wrong and the consensus would be clearly on their side only if there was a large active community here.
Also note that in some places the current template uses arabic numerals in the superscript, and nagari numerals in others (see examples on सदस्य:Johnuniq/converts).--सिद्धार्थ घई (वार्ता) 09:13, 24 अप्रैल 2014 (UTC)
Yes, your summary is perfect. However, an extra detail is that this only makes sense if you also provide symbols for the SI prefixes so units like km and km2 and km3 (and all the other SI prefixes) will work automatically—although exceptions can be added if for some reason a particular automatic result is not what is wanted. I'm likely to be a bit busy for a while. Perhaps I'll do something for this quickly, but it will probably be a couple of days. Johnuniq (वार्ता) 12:03, 24 अप्रैल 2014 (UTC)
Ok, there's no hurry. Thanks for the heads up. :)
As for the SI prefixes, the full prefix names are already two akshar long (an akshar is the basic grammatical unit in hindi, and is roughly equal to a syllable). So some SI prefixes can be shortened to one akshar while other simply can't, due to conflicts. For example, both yocto and yotta if shortened to the first akshar, would become यो. Similarly, deca and deci would become डे. Hence at the maximum only one each out of each pair can be shortened (and that too if there is common acceptance of a shortened version for only one in the pair).
The others can theoretically be shortened to the first akshar, but I haven't shortened these by default since I doubt if all the units with the shortened prefixes would be recognised.
As an example, मेगापास्कल (megapascal) would be recognised, but मेपास्कल or मेपा might not be recognised. Similarly, although किग्रा is recognised for kg, किपा for kilopascal or किजू for kilojoule may not be recognised.
I'd prefer instead that the default SI prefix symbols remain the full prefixes, and shortened symbols especially added where they are known to have been used. (i.e adding exceptions where the automatic result is not what is wanted)
I'll add such exception symbols below in a new section.
Also, I'll add the new symbols per this change in a new section.--सिद्धार्थ घई (वार्ता) 14:31, 24 अप्रैल 2014 (UTC)
I just thought of a good example to explain why shortening the SI prefixes is not feasible. Milli is transliterated as मिली. If shortened, the symbol would be मि. Liter is transliterated as लीटर with the standard symbol being ली. So if the symbol for milli was shortened, milliliter's symbol would become मिली, the same as the full prefix मिली. This can obviously be confusing. And it is to avoid confusions such as this one that I'm leaving the prefix symbols with the full spellings until we find that all units that we are here defining as SI can be acceptably expressed as units with the shortened SI symbols (and that the units themselves have acceptable hindi abbreviations for use with shortened prefixes).--सिद्धार्थ घई (वार्ता) 15:44, 24 अप्रैल 2014 (UTC)
I think I've done what we discussed above. You might like to check my recent edits. I've got lazy and have done no tests and no examples. Later I might get something done for that because systematic checking is the only way to find problems. Johnuniq (वार्ता) 04:41, 25 अप्रैल 2014 (UTC)

Hyphenation[संपादित करें]

At enwiki, the "adj" option (adjectival) can be used to make a unit use the singular name, and to use a hyphen. An optional "mid" word can be inserted. Following are three examples showing text copied from enwiki.

  • {{convert|125|ft}} → 125 feet (38 m)
  • {{convert|125|ft|adj=on}} → 125-foot (38 m)
  • {{convert|125|ft||adj=mid|-long}} → 125-foot-long (38 m)

It is possible to configure the module to disable hyphenation. If that is done, the above would show a space where a hyphen currently appears.

At enwiki, the default is adj=off, and the convert template (before the module) used to include the following (sing is the old name for adj):

|d= ... S{{{adj|{{{sing|off}}}}}}

However, the default here is adj=on because Template:Convert includes:

|d= ... S{{{adj|{{{sing|on}}}}}}

An edit in August 2009 (diff) changed the default from "off" to "on".

Here are some examples using fixed text for the output showing what the hiwiki template currently does:

  • {{convert|125|ft}} → 125-फुट (38 मी.)
  • {{convert|125|ft|adj=on}} → 125-फुट (38 मी.)
  • {{convert|125|ft|adj=off}} → 125 फुट (38 मी.)
  • {{convert|125|ft|0|adj=mid|-long}} → 125-फुट-long (38 मी.)

What is wanted? Do you really want a hyphen to be shown after the input value? Johnuniq (वार्ता) 01:24, 12 अप्रैल 2014 (UTC)

No, the hyphen is not needed. I haven't checked out the code yet, but I suspect that the change was made to achieve something else. Anyways, whatever the reason for the change may have been, the default should be adj=off.--सिद्धार्थ घई (वार्ता) 10:48, 12 अप्रैल 2014 (UTC)

Messages[संपादित करें]

Examples of error and warning messages, with documentation, can be seen at en:Help:Convert messages. Each message links to a section on that page. In due course, you can copy the help page, then translate it, then edit convert/text to change the name to match the local title (search for cvt_format where the link occurs—for now, the simplest might be to insert ":en:" so it links to enwiki).

cvt_format includes "Convert:" which needs to be translated.

At all_messages, the text in the "Mouseover title text" and "Link text" columns needs to be fixed. I suggest leaving the "Anchor" text for now, but that can later be translated as well (it has to match the anchors on the en:Help:Convert messages page). Johnuniq (वार्ता) 23:04, 10 अप्रैल 2014 (UTC)

Personally, I think that the Convert: prefix should for now be left untouched, or at the max only transliterated, since the template name hasn't been translated. I think a change should happen only if the template name is changed.--सिद्धार्थ घई (वार्ता) 13:02, 12 अप्रैल 2014 (UTC)
Code Mouseover title text Link text
English Hindi English Hindi
cvt_bad_num Value "%s" must be a number "%s" संख्या होनी चाहिये invalid number अमान्य संख्या
cvt_big_prec Precision "%s" is too large "%s"परिशुद्धता बहुत अधिक है precision too large बहुत अधिक परिशुद्धता
cvt_invalid_num Number has overflowed number overflow
cvt_no_num Needs the number to be converted परिवर्तित करने के लिये संख्या आवश्यक है needs a number संख्या आवश्यक है
cvt_no_num2 Needs another number for a range परिसर (रेंज) के लिये एक अन्य संख्या आवश्यक है needs another number अन्य संख्या आवश्यक है
cvt_bad_frac frac "%s" must be an integer above 1 invalid fraction अमान्य भिन्न
cvt_bad_prec Precision "%s" must be an integer परिशुद्धता "%s" पूर्णांक होना चाहिये invalid precision अमान्य परिशुद्धता
cvt_bad_sigfig sigfig "%s" must be a positive integer invalid sigfig
cvt_empty_option Ignored empty option "%s" रिक्त प्राचल "%s" छोड़ा गया empty option रिक्त प्राचल
cvt_no_spell Spelling is not available वर्तनी उपलब्ध नहीं है bug, ask for help त्रुटि, सहायता माँगें
cvt_unknown_option Ignored invalid option "%s" अमान्य प्राचल "%s" छोड़ा गया invalid option अमान्य प्राचल
cvt_bad_default Unit "%s" has an invalid default इकाई "%s" का डिफ़ॉल्ट अमान्य है bug, ask for help त्रुटि, सहायता माँगें
cvt_bad_unit Unit "%s" is invalid here इकाई "%s" यहाँ अमान्य है unit invalid here इकाई यहाँ अमान्य
cvt_no_default Unit "%s" has no default output unit "%s" इकाई की कोई डिफ़ॉल्ट आउटपुट इकाई नहीं है bug, ask for help त्रुटि, सहायता माँगें
cvt_no_unit Needs name of unit इकाई नाम की आवश्यकता है needs unit name इकाई नाम आवश्यक
cvt_unknown Unit name "%s" is not known "%s" इकाई नाम ज्ञात नहीं है unknown unit अज्ञात इकाई
cvt_should_be %s %s ambiguous unit संदिग्धार्थ इकाई
cvt_mismatch Cannot convert "%s" to "%s" "%s" को "%s" में नहीं परिवर्तित किया जा सकता unit mismatch इकाई कुमेलन
cvt_bug_convert Bug: Cannot convert between specified units त्रुटि: निर्दिष्ट इकाइयों में परिवर्तन नहीं किया जा सकता bug, ask for help त्रुटि, सहायता माँगें
cvt_lookup Unit "%s" is incorrectly defined इकाई "%s" गलत तरीके से परिभाषित है bug, ask for help त्रुटि, सहायता माँगें



  • Regarding cvt_invalid_num, does overflow mean the number is too large? Or that it's out of range, and may be either too large or too small? I'm asking since I personally believe it means the latter, but the translation used on guwiki seems to suggest the former.
  • In cvt_bad_frac, does the frac at the beggining of the mouseover title text refer to the parameter named frac? If that's the case, this message should be translated after the parameter name, value translations have been done. Same for cvt_bad_sigfig.--सिद्धार्थ घई (वार्ता) 14:09, 12 अप्रैल 2014 (UTC)
    Re cvt_empty_option, cvt_unknown_option: Yes, "option" refers to an input parameter such as |abbr=on. Some examples are at en:Help:Convert messages.

    Re cvt_invalid_num: I sidestepped that issue at en:Help:Convert messages#Number overflow by saying "This error occurs if a number exceeds the range of values available for calculations". Internally, the module asks Lua to process the number. It is documented (here) that the result may be one of the following: nan, -nan, inf, -inf. If any of those occur, cvt_invalid_num is the result. That means the precise cause of the problem depends on the server hardware and software, and conceivably could change in the future when updates occur. Some tests I performed suggested that underflow cannot occur as it appears that numbers which are too small to be precisely represented are silently converted to zero. However, I am unaware of any documentation guaranteeing that behavior will always apply.

    Re cvt_bad_frac: Yes, it is referring to a convert like {{convert|42.5|mm|in|frac=8}} (which gives enwiki output 1 58 in). The warning occurs if "8" is not an integer with value 2 or more. Johnuniq (वार्ता) 04:17, 13 अप्रैल 2014 (UTC)

Other[संपादित करें]

Need translation for "per" as in:

per_word = 'per', -- for units like "liters per kilometer"

customary_units are rarely used; let's forget that for now.

eng_scales are infrequent, although there are probably a couple used here. We may as well fix them. That involves translating names likes "billion", and possibly replacing the link. Also, you may want to add other items? Have a quick look at guwiki. Johnuniq (वार्ता) 23:04, 10 अप्रैल 2014 (UTC)

per can be translated as प्रति.--सिद्धार्थ घई (वार्ता) 10:53, 12 अप्रैल 2014 (UTC)
Regarding the engineering scales, I see that guwiki changed the number system to the Indian numbering system (lakhs, crores and so on). However, before we do any changes in this, I would like to be clear what these scales actually do in the module.
Is it just support for input units like e3m, e6m etc, which would also involve outputting the relevant term such as million, billion?
Or does it actually have anything to do with engineering stuff?--सिद्धार्थ घई (वार्ता) 07:31, 22 अप्रैल 2014 (UTC)
Yes, it's just to support units like you mentioned, and no, it has nothing to do with engineering, except that engineers use a similar concept in expressing numbers in scientific notation with the power as a multiple of 3—I wouldn't bother looking, but en:Engineering notation has a somewhat confusing account. The idea is simply that people asked for a way to handle large numbers in a more natural fashion, so rather than "6,000,000 acres" at enwiki, they wanted convert to show "6 million acres". I mentioned guwiki because the matter had recently been discussed there, but I do not think you should bother with what they did because it is very unlikely to ever be used. The important thing is to decide what should happen if an article is copied from enwiki if the article contains something like these:
  • {{Convert|1.23|e12cuft|lk=on}} → 1.23 खरब घन फुट (35×10^9 मी3)
  • {{Convert|125|sqmi|e3acre|abbr=off}} → 125 वर्ग मील (80 हज़ार एकड़)
  • {{Convert|26|e6acre|km2}} → 26 मिलियन एकड़ (110,000 कि॰मी2)
There appear to be only two such converts at hiwiki (see the "Convert/LoffAoffDbSonEng" errors in मद्रास प्रैज़िडन्सी). It's easy to do something to improve how the above examples appear, without spending a lot of time optimizing it—the matter can be revisited if people ever start using more of these. Johnuniq (वार्ता) 10:23, 22 अप्रैल 2014 (UTC)
Ok, so the translations are:
thousand --> हज़ार
million --> मिलियन (transliteration) -- link -- मिलियन
billion --> बिलियन (transliteration) -- link -- भारतीय_संख्या_प्रणाली#संख्याओं_के_नाम (for lack of a better one)
trillion --> ट्रिलियन (transliteration) -- link needed
quadrillion --> क्वाड्रिलियन (transliteration) -- link -- भारतीय_संख्या_प्रणाली#संख्याओं_के_नाम (for lack of a better one)
--सिद्धार्थ घई (वार्ता) 17:17, 22 अप्रैल 2014 (UTC)

Done. Please check the following examples. Johnuniq (वार्ता) 07:03, 23 अप्रैल 2014 (UTC)

Numerals[संपादित करें]

One issue that needs to be addressed is how the module handles the numeral systems. As of now, there is no consensus on which numeral system to use. The current consensus is that it is up to the user to choose which numerals to use. So this consensus needs to appear in how this template behaves.

The easiest method, that I see as an end-user, is that the module detect which numerals have been input, and output the same type. Also, a parameter could be used to force the output behaviour irrespective of what is input (along the lines of what the numeral conversion module does).

What's the current behaviour?--सिद्धार्थ घई (वार्ता) 11:11, 12 अप्रैल 2014 (UTC)

The following shows what the module can do at the moment. The "lang=en" option was primarily for my testing, but I left it active in case en results were ever wanted. Nothing other than "en" is supported.
  • {{Convert|1234567890.1234|m|ft}} → 1,234,567,890.1234 मीटर (4.050419587019×109 फीट)
  • {{Convert|1,234,567,890.1234|m|ft}} → 1,234,567,890.1234 मीटर (4.050419587019×109 फीट)
  • {{Convert|१२३४५६७८९०.१२३४|m|ft}}[convert: invalid number]
  • {{Convert|१,२३,४५,६७,८९०.१२३४|m|ft}}[convert: invalid number]
  • {{Convert|1234567890.1234|m|ft|lang=en}} → 1,234,567,890.1234 मीटर (4.050419587019×109 फीट)
  • {{Convert|1,234,567,890.1234|m|ft|lang=en}} → 1,234,567,890.1234 मीटर (4.050419587019×109 फीट)
  • {{Convert|१२३४५६७८९०.१२३४|m|ft|lang=en}}[convert: invalid number]
  • {{Convert|१,२३,४५,६७,८९०.१२३४|m|ft|lang=en}}[convert: invalid number]
It's easy to change any option names and values, so the "lang" can easily be replaced, or an alias created. Same for "en". Johnuniq (वार्ता) 11:54, 12 अप्रैल 2014 (UTC)
This doesn't really solve the basic issue, since the lang option changes the unit names too into english. What we need is support for both numeral systems keeping the rest of the output in hindi. And the current module behaviour of outputting devanagari numerals is exactly opposite of what the original template does, and we're unlikely to get consensus for that. So at the bare minimum, the default output should retain the status quo of the template outputting international numerals.--सिद्धार्थ घई (वार्ता) 12:36, 12 अप्रैल 2014 (UTC)
The overly grand name "lang=en" may be misleading. In fact, all it does is prevent the default translation of output numbers. As mentioned, option words can easily be changed, and it is also easy to define a "no operation" option (one which is accepted but which does nothing because it is the default behavior). For example, "|प्रकार=अरबी" might be used to output in international digits ("|lang=en"), while "|प्रकार=नागरी" is accepted but is ignored (so output numbers would use Devanagari digits).

I could add a configuration item to change the default so lang=en is assumed.

The unit code determines what symbol or name will appear for a unit. Currently, input "m" shows "metre" for the name, but that can be changed to output whatever text is wanted. An alias may be added, for example, "मी = m"—if that were done, the following would give identical output: {{convert|1|m}} and {{convert|1|मी}}. Johnuniq (वार्ता) 03:05, 13 अप्रैल 2014 (UTC)

OK, so lang=en should be assumed by default, therefore giving arabic numerals as output by default.
|अंक=अरबी should act as a "no operation" option, i.e give output in arabic numerals.
|अंक=नागरी should give output in devanagari numerals.--सिद्धार्थ घई (वार्ता) 05:52, 13 अप्रैल 2014 (UTC)

I have implemented the above and added a trick. The default for output is now arabic numerals, but local numerals can be specified by setting an option or by using local numerals in the input.

  • {{Convert|1234567890.1234|m|m}} → 1,234,567,890.1234 मीटर (1.2345678901234×109 मी॰)
  • {{Convert|1234567890.1234|m|m|अंक=अरबी}} → 1,234,567,890.1234 मीटर (1.2345678901234×109 मी॰)*
  • {{Convert|1234567890.1234|m|m|अंक=नागरी}} → 1,234,567,890.1234 मीटर (1.2345678901234×109 मी॰)*
  • {{Convert|१२३४५६७८९०.१२३४|m|m}}[convert: invalid number]
  • {{Convert|१२३४५६७८९०.१२३४|m|m|अंक=अरबी}}[convert: invalid number]
  • {{Convert|१२३४५६७८९०.१२३४|m|m|अंक=नागरी}}[convert: invalid number]

Do these examples give the wanted result? Johnuniq (वार्ता) 05:27, 16 अप्रैल 2014 (UTC)

Yes, this behaviour seems good.--सिद्धार्थ घई (वार्ता) 10:21, 19 अप्रैल 2014 (UTC)

Examples[संपादित करें]

  • {{Convert|31900000|sqft|m2}} → 31,900,000 वर्ग फुट (2,960,000 मी2)
  • {{Convert|700|C|F}} → 700 °से. (1,292 °फ़ै)
  • {{Convert|33.0|km|mi|abbr=on}} → 33.0 कि॰मी॰ (20.5 मील)
  • {{Convert|33.0|km|mi|abbr=off}} → 33.0 किलोमीटर (20.5 मील)
  • {{Convert|3102|cc|cuin|0|abbr=on}} → 3,102 घन सेंटीमीटर (189 घन इंच)
  • {{Convert|396000|m2|sqft|abbr=on|disp=or}} → 396,000 मी2 या 4,260,000 वर्ग फुट
  • {{Convert|12795|ft|m|abbr=on|sigfig=4}} → 12,795 फीट (3,900 मी॰)
  • {{Convert|166|x|68|m|ft}} → 166 x 68 मीटर (545 फीट × 223 फीट)

Wanted unit names[संपादित करें]

The units shown below appear to be used at hiwiki. A translation is needed for each symbol and name. See #Current unit names below. There should be no need to define km as well as m because the module generates the symbol and name for km by combining the SI prefix with the base unit. However, specific definitions can be used if the default handling is not adequate. The module works like this: if a convert uses the unit km, the module looks for a unit with that name. If defined, it is used. If it is not defined, convert determines that k is an SI prefix and m is a unit that accepts SI prefixes, so the symbol or name can be generated automatically. If an initial set of names can be decided, I will put these into the master list of units. From then on, that master list would be edited when wanting to update the unit definitions. Johnuniq (वार्ता) 02:26, 12 अप्रैल 2014 (UTC)

Are these to contain only one translation, or multiple? One would be sufficient for usage in the output, but the input might need to support multiple translations for the symbols, and names.--सिद्धार्थ घई (वार्ता) 12:46, 12 अप्रैल 2014 (UTC)
Also, would the hi name be used for linking? Or is the article name to be input separately?--सिद्धार्थ घई (वार्ता) 12:49, 12 अप्रैल 2014 (UTC)
Each row is a single item. Taking the first row as an example, using {{convert|1|AU}} at enwiki would show "astronomical unit", while {{convert|1|AU|abbr=on}} would show "AU". At enwiki, the default for abbr (abbreviation) is abbr=out, which means that the input unit is not abbreviated (its name is used), while the output unit is abbreviated (its symbol is used). That default can be changed with a configuration item.

I would need an example to understand "support multiple translations". If you mean that a local equivalent for m would be wanted, that is handled with an alias which is a simple "मी = m" row in the master list of units (which I will prepare from the following table). If wanted, add a separate table (just bullet points would be fine) showing aliases in the form "x = y" (where y is one of the unitcodes shown below).

The page link is a separate item. I was being a bit lazy and omitted that, and was thinking it could be fixed later. However, add another column if wanted and I'll use it. If the link is the same as the name, the link can be omitted—doing that causes the name to be used if a link is requested in the convert. A complication is that many variations on SI units are possible, and each can have a separate link—for example, g might link to one article while kg links to a second, and Mg links to a third. That is a simple table of editable wikitext that we should leave for later—let's just do the basics that follow for now, although you are welcome to add a few other items if wanted. Johnuniq (वार्ता) 03:29, 13 अप्रैल 2014 (UTC)

By "support multiple translations", I meant that the input would need to handle multiple unit aliases (which I'm guessing is possible), so that, as a hypothetical example m, मी and मी. all three are understood as input for meter. I'll add appropriate translations in the table below. I'll also add notes in case I add a translation which differs from one currently used.--सिद्धार्थ घई (वार्ता) 07:46, 13 अप्रैल 2014 (UTC)
Yes, any number of aliases can be added, for example मी=m and मी.=m. If you want to add some aliases now, please put them in a separate list to reduce the complexity when I put all this in the master list of units. Johnuniq (वार्ता) 10:58, 13 अप्रैल 2014 (UTC)
Unitcode en symbol en name hi symbol hi name Notes
AU AU astronomical unit AU खगोलीय इकाई same as current
fathom fathom fathom फ़ैदम फ़ैदम transliteration as used in मापन के मात्रक, except a nukta is added for correctness' sake
ft ft foot फ़ुट फ़ुट Differs from existing transliteration in that a nukta is added
in in inch इंच इंच same as current
kly kly kilolight-year किलो-प्रकाश-वर्ष किलो-प्रकाश-वर्ष
km km kilometre किमी किलोमीटर symbol differs from current: dots removed
ly ly light-year प्रकाश-वर्ष प्रकाश-वर्ष
m m metre मी मीटर symbol differs from current: dot removed
acre acre acre एकड़ एकड़ same as current
ha ha hectare ha हेक्टेयर same as current
km2 km2 square kilometre वर्ग किमी वर्ग किलोमीटर The symbol is changed: the dots are removed and the numeral in the superscript is replaced with the translation of square, so that prefering either numeral system can be avoided. Name is expanded to use full transliteration of kilometer instead of the transliteration of km. Note that now the link becomes same as the name.
m2 m2 square metre वर्ग मी वर्ग मीटर Symbol changed to be same as name instead of short version to avoid prefering any numeral system in symbols.
mi mi mile मील मील same as current
Mly Mly megalight-year मेगा-प्रकाश-वर्ष मेगा-प्रकाश-वर्ष
NM NM nautical mile समुद्री मील समुद्री मील Translated as name of article समुद्री मील interwikilinked from en:Nautical mile
nmi nmi nautical mile समुद्री मील समुद्री मील
pc pc parsec पारसैक पारसैक Translated as name of article पारसैक interwikilinked from en:Parsec
sqft sq ft square foot वर्ग फ़ुट वर्ग फ़ुट Differs from current: nukta added and symbol changed to be same as name.
sqin sq in square inch वर्ग इंच वर्ग इंच Differs from current: "square" translated instead of transliteration. Symbol changed to be same as name.
sqmi sq mi square mile वर्ग मील वर्ग मील Same as current
sqyd sq yd square yard वर्ग गज़ वर्ग गज़ Square translated as in other units. Yard translated per the translation at e-mahashabdkosh of CDAC.
yd yd yard गज़ गज़
acre_ft acre·ft acre foot एकड़·फ़ुट एकड़ फ़ुट
cc cc cubic centimetre सीसी घन सेंटीमीटर
CID cu in cubic inch घन इंच घन इंच
cuft cu ft cubic foot घन फ़ुट घन फ़ुट
cuin cu in cubic inch घन इंच घन इंच
cumi cu mi cubic mile घन मील घन मील
cuyd cu yd cubic yard घन गज़ घन गज़
impgal imp gal imperial gallon इम्प॰ गैल॰ इम्पीरियल गैलन transliterated
impoz imp fl oz imperial fluid ounce इम्प॰ फ़्लू॰ औंस इम्पीरियल फ़्लूइड औंस transliterated
L L litre ली लीटर transliterated
l l litre ली लीटर transliterated
m3 m3 cubic metre घन मीटर घन मीटर
Moilbbl Mbbl million barrels मिलियन बैरल मिलियन बैरल transliterated
oilbbl bbl barrel बैरल बैरल transliterated
USgal US gal US gallon यूएस गैल॰ अमेरिकी गैलन
USoz US fl oz US fluid ounce यूएस फ़्लू॰ औंस अमेरिकी फ़्लूइड औंस
USqt US qt US quart यूएस क्वार्ट अमेरिकी क्वार्ट
g g gram ग्रा ग्राम
gr gr grain ग्रे ग्रेन
lb lb pound पाउन्ड पाउन्ड transliterated per the name of the article पाउन्ड (भार). Same spelling used at cstt.nic.in
long_ton long ton long ton लौंग टन लौंग टन
LT long ton long ton लौंग टन लौंग टन
MT t metric ton मेट्रिक टन मेट्रिक टन
oz oz ounce औंस औंस
short_ton short ton short ton शॉर्ट टन शॉर्ट टन transliterated
ST short ton short ton शॉर्ट टन शॉर्ट टन transliterated
st st stone स्टोन स्टोन transliterated
t t tonne टन टन transliterated
atm atm standard atmosphere atm मानक वायुमंडलीय दाब translated per chapter 2 of the NCERT physics class XI textbook
bar bar bar बार बार transliterated
Pa Pa pascal Pa पास्कल same as current
C °C degree Celsius °से डिग्री सेल्सियस Symbol changed: dot removed, name changed: full name transliterated
F °F degree Fahrenheit °फ़ै डिग्री फ़ैरनहाइट full name transliterated
K K kelvin के केल्विन name spelling changed
C-change °C degree Celsius change °से डिग्री सेल्सियस बदलाव
F-change °F degree Fahrenheit change °फ़ै डिग्री फ़ैरनहाइट बदलाव
/sqkm /km2 per square kilometre /वर्ग किमी प्रति वर्ग किलोमीटर
/sqmi /sq mi per square mile /वर्ग मील प्रति वर्ग मील
bhp bhp brake horsepower ब्रेक अश्वशक्ति ब्रेक अश्वशक्ति translated per Appendix A4 of the NCERT physics Class XI textbook, and cstt.nic.in
carat carat carat कैरट कैरट
cuft/s cu ft/s cubic foot per second घन फ़ुट/सेक घन फ़ुट प्रति सेकंड Second translated in this and subsequent units per the translation listed by cstt.nic.in
ft/s ft/s foot per second फ़ुट/सेक फ़ुट प्रति सेकंड
ft/s2 ft/s2 foot per second squared फ़ुट/वर्ग सेक फ़ुट प्रति वर्ग सेकंड
ftlbf ft·lbf foot-pound force फ़ुट-पाउन्ड बल फ़ुट-पाउन्ड बल
gCO2/km g(CO2)/km gram of CO2 per kilometre ग्रा(CO2)/किमी ग्राम कार्बन डाईऑक्साइड प्रति किलोमीटर
hp hp horsepower अश्वशक्ति अश्वशक्ति
inHg inHg inch of mercury इंच पारा इंच पारा inch transliterated and mercury translated per article name पारा
J J joule जूल जूल per cstt.nic.in and name of article जूल (इकाई)
kcal kcal kilocalorie कि॰कैल किलोकैलोरी kilo transliterated per SI prefix, transliteration of calorie as used at cstt.nic.in and in कैलोरी article name.
km/h km/h kilometre per hour किमी/घंटा किलोमीटर प्रति घंटा
km/s km/s kilometre per second किमी/सेक किलोमीटर प्रति सेकंड
kn kn knot नॉट नॉट
kpc kpc kiloparsec किलोपारसैक किलोपारसैक
kW.h kW·h kilowatt-hour कि॰वॉ·घं किलोवॉट-घंटा kilo transliterated per SI prefix, watt translated per article name, hour translated
kWh kWh kilowatt-hour कि॰वॉ·घं किलोवॉट-घंटा kilo transliterated per SI prefix, watt translated per article name, hour translated
kWh/100_km kW·h/100 km kilowatt-hour per 100 kilometres कि॰वॉ·घं/सौ किमी किलोवॉट-घंटा प्रति सौ किलोमीटर
kWh/mi kW·h/mi kilowatt-hour per mile कि॰वॉ·घं/मील किलोवॉट-घंटा प्रति मील
L/100_km L/100 km litre per 100 kilometres ली/100 किमी लीटर प्रति सौ किलोमीटर
L/km L/km litre per kilometre ली/किमी लीटर प्रति किलोमीटर
lb-f lbf pound-force पाउन्ड-बल पाउन्ड-बल
lb.ft lb·ft pound force-foot पाउन्ड बल-फ़ुट पाउन्ड बल-फ़ुट
lbf lbf pound-force पाउन्ड-बल पाउन्ड-बल
lbfft lbf·ft pound force-foot पाउन्ड बल-फ़ुट पाउन्ड बल-फ़ुट
lbft lb·ft pound-foot पाउन्ड-फ़ुट पाउन्ड-फ़ुट
m/s m/s metre per second मी/सेक मीटर प्रति सेकंड
m/s2 m/s2 metre per second squared मी/वर्ग सेक मीटर प्रति वर्ग सेकंड
m3/d m3/d cubic metre per day घन मीटर/दिन घन मीटर प्रति दिन
m3/s m3/s cubic metre per second घन मीटर/सेक घन मीटर प्रति सेकंड
metric_ton metric ton metric ton मेट्रिक टन मेट्रिक टन
mi/s mi/s mile per second मील/सेक मील प्रति सेकंड
MJ/km MJ/km megajoule per kilometre मेगाजूल/किमी मेगाजूल प्रति किलोमीटर
Moilbbl/d Mbbl/d million barrels per day मिलियन बैरल/दिन मिलियन बैरल प्रति दिन
mpgimp mpg-imp mile per imperial gallon मील/इम्पीरियल गैलन मील प्रति इम्पीरियल गैलन
mpgus mpg-US mile per US gallon मील/यूएस गैलन मील प्रति अमेरिकी गैलन
mph mph mile per hour मील/घंटा मील प्रति घंटा
N N newton न्यूटन न्यूटन
Nm N·m newton metre न्यूटन मीटर न्यूटन मीटर
oilbbl/d bbl/d barrel per day बैरल/दिन बैरल प्रति दिन
ozCO2/mi oz(CO2)/mi ounce of CO2 per mile औंस CO2/मील औंस कार्बन डाईऑक्साइड प्रति मील
PD/sqkm /km2 inhabitants per square kilometre /वर्ग किमी निवासी प्रति वर्ग किलोमीटर
PD/sqmi /sq mi inhabitants per square mile /वर्ग मील निवासी प्रति वर्ग मील
PS PS metric horsepower PS मेट्रिक अश्वशक्ति
psi psi pound per square inch पाउन्ड/वर्ग इंच पाउन्ड प्रति वर्ग इंच
Torr Torr torr टॉर टॉर transliteration as used in दाब article
W W watt वॉट वॉट per article name वॉट

Unit symbol changes per sp=us usage[संपादित करें]

Unitcode en symbol en name default hi symbol (arabic numerals) sp=us symbol (nagari numerals) hi name
km2 km2 square kilometre किमी2 किमी वर्ग किलोमीटर
m2 m2 square metre मी2 मी वर्ग मीटर
m3 m3 cubic metre मी3 मी घन मीटर
/sqkm /km2 per square kilometre /किमी2 /किमी प्रति वर्ग किलोमीटर
ft/s2 ft/s2 foot per second squared फ़ुट/सेक2 फ़ुट/सेक फ़ुट प्रति वर्ग सेकंड
kWh/100_km kW·h/100 km kilowatt-hour per 100 kilometres कि॰वॉ·घं/100 किमी कि॰वॉ·घं/१०० किमी किलोवॉट-घंटा प्रति सौ किलोमीटर
L/100_km L/100 km litre per 100 kilometres ली/100 किमी ली/१०० किमी लीटर प्रति सौ किलोमीटर
m/s2 m/s2 metre per second squared मी/सेक2 मी/सेक मीटर प्रति वर्ग सेकंड
m3/d m3/d cubic metre per day मी3/दिन मी/दिन घन मीटर प्रति दिन
m3/s m3/s cubic metre per second मी3/सेक मी/सेक घन मीटर प्रति सेकंड
PD/sqkm /km2 inhabitants per square kilometre /किमी2 /किमी निवासी प्रति वर्ग किलोमीटर

I know that not all of these are SI units, but since we are adding a hack for supporting different numerals in the symbols, we might as well support more.--सिद्धार्थ घई (वार्ता) 15:03, 24 अप्रैल 2014 (UTC)

Done, please check. Johnuniq (वार्ता) 04:39, 25 अप्रैल 2014 (UTC)
Checking. I forgot km3, because it's not in the wanted unit names. Please also add the following.--सिद्धार्थ घई (वार्ता) 06:15, 25 अप्रैल 2014 (UTC)
Unitcode en symbol en name default hi symbol (arabic numerals) sp=us symbol (nagari numerals) hi name
km3 (???) ??? ??? किमी3 किमी घन किलोमीटर
Also, cm2, along the lines of cm in #Symbol overrides for specific SI units with prefixes below.--सिद्धार्थ घई (वार्ता) 06:57, 25 अप्रैल 2014 (UTC)
Unitcode en symbol en name default hi symbol (arabic numerals) sp=us symbol (nagari numerals) hi name
cm2 (???) ??? ??? सेमी2 सेमी वर्ग सेंटीमीटर
Went through the examples at सदस्य:Johnuniq/converts, and it seems ok. Since it doesn't contain any nagari numerals examples, I don't know if that works yet.
Also, I'm guessing that since millimeter and centimeter have to have override symbols per #Symbol overrides for specific SI units with prefixes below, we'd need to add overrides for their powers too, so here they are.--सिद्धार्थ घई (वार्ता) 07:28, 25 अप्रैल 2014 (UTC)
Unitcode en symbol en name default hi symbol (arabic numerals) sp=us symbol (nagari numerals) hi name
cm3 (???) ??? ??? सेमी3 सेमी घन सेंटीमीटर
mm2 (???) ??? ??? मिमी2 मिमी वर्ग मिलीमीटर
mm3 (???) ??? ??? मिमी3 मिमी घन मिलीमीटर

Symbol overrides for specific SI units with prefixes[संपादित करें]

The following units need overrides for symbols, since shortened hindi symbols have known usage.--सिद्धार्थ घई (वार्ता) 15:28, 24 अप्रैल 2014 (UTC)

Unit (common name, not unitcode) default symbol Override
milimeter मिलीमी मिमी
centimeter सेंटीमी सेमी
Have not looked at this yet. Remind me if I forget. Johnuniq (वार्ता) 04:40, 25 अप्रैल 2014 (UTC)
Will do. Also the following.--सिद्धार्थ घई (वार्ता) 06:58, 25 अप्रैल 2014 (UTC)
Unit (common name, not unitcode) default symbol Override
kilogram किलोग्रा किग्रा

Current unit names[संपादित करें]

The following information is from some of the current hiwiki convert templates.

Unitcode Symbol Name Link
m मी. मीटर (same as name)
km कि॰मी॰ किलोमीटर (same as name)
AU AU खगोलीय इकाई (same as name)
ft फुट फुट फुट (लम्बाई की इकाई)
in इंच इंच (same as name)
mi मील मील (same as name)
ly ly प्रकाश-वर्ष (same as name)
pc pc पारसैक (same as name)
acre एकड़ एकड़ (same as name)
ha ha हेक्टेयर (same as name)
m2 मी square metre वर्ग मीटर
km2 कि.मी. वर्ग कि॰मी॰ वर्ग किलोमीटर
sqft वर्ग फीट वर्ग फुट (same as name)
sqin sq in स्क्वेयर इन्च (same as name)
sqmi वर्ग मील वर्ग मील (same as name)
cumi घन मील घन मील (same as name)
g ग्राम ग्राम (same as name)
lb पौंड पाउण्ड पाउण्ड (भार)
Pa Pa पास्कल पास्कल (इकाई)
C °से. °से. सेल्सियस
F °फ़ै. °फ़ै. फ़ैरन्हाइट
K K कैल्विन (same as name)
kn kn नॉट नॉट (इकाई)
lb-f पाउंड-बल पाउंड-बल (same as name)
PD/sqkm /किमी inhabitant per square kilometre वर्ग किलोमीटर
PD/sqmi /वर्ग मील inhabitant per square mile वर्ग मील

Progress[संपादित करें]

I put all the above into Module:Convert/text, see diff:

  • Category: श्रेणी:कनवर्ट साँचे में त्रुटि (that page should be created as a hidden tracking category, although it will not be used until a convert error when using the module occurs in an article (the category is only added in the main namespace).
  • Ranges as above. The range "by" will result in "×" (multiply).
  • SI prefixes as above. It will look a bit strange when symbols are shown (abbr=on) because no hi symbols have been defined—for example, instead of "कि.मी." for km, the result would be "kमी.". That probably needs fixing.
  • I disabled hyphenation so using |adj=on will not insert hyphens.
  • Messages as above (a couple more are needed).
  • Other: per_word as above.

Changes are easy. I'll do some examples later, and glitches noticed then can be fixed. Johnuniq (वार्ता) 05:08, 13 अप्रैल 2014 (UTC)

Convert/text[संपादित करें]

I put the SI prefixes from above in Module:Convert/text. That module is good enough for use now, but one item that could readily be fixed is at "eng_scales are infrequent" above. Johnuniq (वार्ता) 06:21, 21 अप्रैल 2014 (UTC)

Convert/data[संपादित करें]

I updated the master list of units and put the results (from here) in Module:Convert/data. Many more translations could be made, but there is no point doing a lot of painful work for units that are probably not used (hundreds of the units are not used at enwiki). Ideally you would check the diff of my edit to the master list because I may have blundered somewhere.

You might like to compile a list of aliases. All I need is the wanted unit code (what you would like to work in a convert template) and its equivalent existing unit code. For example:

  • मी = m
  • मी. = m

The above are just examples. If wanted, that can be done later as it is easy to add aliases.

The unit links need to be checked. I put the links available from above into the definitions, and I sometimes used the name of the unit as the link. That is not really important because it can be fixed at any time and does not require much effort. Ideally someone would prepare a list of all converts used at hiwiki and check the outputs. I have such a list, but it is over 5000 converts which is too hard to work with. I might try omitting the converts that are different simply because of the input number, and see what is left.

See User:Johnuniq/converts for the result of doing the above.

Some of the units are defined as "per" units. Two examples follow:

  • mpgimp == mi/impgal
  • mpgus == mi/USgal

A single "=" defines an alias: the left-hand side is another name for the right-hand side. Using a double "==" defines a per unit. The first example defines mpgimp as being mi per impgal (where mi and impgal are existing units). The abbreviation and name for impgal are generated automatically. The names generated by these match the specified names above, however the symbols do not. Please check the following and let me know if a fix is needed.

  • mpgimp: specified symbol मील/इम्पीरियल गैलन and name मील प्रति इम्पीरियल गैलन
  • mpgus: specified symbol मील/यूएस गैलन and name मील प्रति अमेरिकी गैलन
  • {{Convert|1|mpgimp|abbr=on}} → 1 mpg‑imp (280 ली/100 कि॰मी॰; 0.83 mpg‑US)
  • {{Convert|1|mpgimp}} → 1 मील प्रति ब्रिटिश गैलन (280 ली/100 कि॰मी॰; 0.83 mpg‑US)
  • {{Convert|1|mpgus|abbr=on}} → 1 mpg‑US (240 ली/100 कि॰मी॰; 1.2 mpg‑imp)
  • {{Convert|1|mpgus}} → 1 मील प्रति अमेरिकी गैलन (240 ली/100 कि॰मी॰; 1.2 mpg‑imp)

Tests[संपादित करें]

Convert {{convert}} {{Convert}}
{{convert|12|mpgimp}} 12 मील प्रति ब्रिटिश गैलन (24 ली/100 कि॰मी॰; 10.0 mpg‑US) 12 मील प्रति ब्रिटिश गैलन (24 ली/100 कि॰मी॰; 10.0 mpg‑US)
{{convert|12|mpgimp|abbr=on}} 12 mpg‑imp (24 ली/100 कि॰मी॰; 10.0 mpg‑US) 12 mpg‑imp (24 ली/100 कि॰मी॰; 10.0 mpg‑US)
{{convert|12|mpgus}} 12 मील प्रति अमेरिकी गैलन (20 ली/100 कि॰मी॰; 14 mpg‑imp) 12 मील प्रति अमेरिकी गैलन (20 ली/100 कि॰मी॰; 14 mpg‑imp)
{{convert|12|mpgus|abbr=on}} 12 mpg‑US (20 ली/100 कि॰मी॰; 14 mpg‑imp) 12 mpg‑US (20 ली/100 कि॰मी॰; 14 mpg‑imp)
{{convert|1|ft|mm}} 1 फुट (300 मि॰मी॰) 1 फुट (300 मि॰मी॰)
{{convert|300|mm|ft}} 300 मिलीमीटर (0.98 फीट) 300 मिलीमीटर (0.98 फीट)
{{convert|4567|ft|km}} 4,567 फीट (1.392 कि॰मी॰) 4,567 फीट (1.392 कि॰मी॰)
{{convert|1.2|km|ft}} 1.2 किलोमीटर (3,900 फीट) 1.2 किलोमीटर (3,900 फीट)
{{convert|1|ft|mm|abbr=on}} 1 फीट (300 मि॰मी॰) 1 फीट (300 मि॰मी॰)
{{convert|300|mm|ft|abbr=on}} 300 मि॰मी॰ (0.98 फीट) 300 मि॰मी॰ (0.98 फीट)
{{convert|4567|ft|km|abbr=on}} 4,567 फीट (1.392 कि॰मी॰) 4,567 फीट (1.392 कि॰मी॰)
{{convert|1.2|km|ft|abbr=on}} 1.2 कि॰मी॰ (3,900 फीट) 1.2 कि॰मी॰ (3,900 फीट)
{{convert|1|ft|mm|abbr=off}} 1 फुट (300 मिलीमीटर) 1 फुट (300 मिलीमीटर)
{{convert|300|mm|ft|abbr=off}} 300 मिलीमीटर (0.98 फीट) 300 मिलीमीटर (0.98 फीट)
{{convert|4567|ft|km|abbr=off}} 4,567 फीट (1.392 किलोमीटर) 4,567 फीट (1.392 किलोमीटर)
{{convert|1.2|km|ft|abbr=off}} 1.2 किलोमीटर (3,900 फीट) 1.2 किलोमीटर (3,900 फीट)

Above is a very quick test. More tests needed! Johnuniq (वार्ता) 06:21, 21 अप्रैल 2014 (UTC)

Progress 2[संपादित करें]

Again, I think I have done everything up to the time of this comment. Please check if there is anything outstanding, and check the results from the following tests. Johnuniq (वार्ता) 04:38, 26 अप्रैल 2014 (UTC)

  • {{Convert|9|mm}} → 9 मिलीमीटर (0.030 फीट)
  • {{Convert|9|mm|abbr=off}} → 9 मिलीमीटर (0.030 फीट)
  • {{Convert|9|mm|abbr=on}} → 9 मि॰मी॰ (0.030 फीट)
  • {{Convert|९|mm}}[convert: invalid number]
  • {{Convert|९|mm|abbr=off}}[convert: invalid number]
  • {{Convert|९|mm|abbr=on}}[convert: invalid number]
  • {{Convert|9|cm}} → 9 सेन्टीमीटर (0.30 फीट)
  • {{Convert|9|cm|abbr=off}} → 9 सेन्टीमीटर (0.30 फीट)
  • {{Convert|9|cm|abbr=on}} → 9 से॰मी॰ (0.30 फीट)
  • {{Convert|९|cm}}[convert: invalid number]
  • {{Convert|९|cm|abbr=off}}[convert: invalid number]
  • {{Convert|९|cm|abbr=on}}[convert: invalid number]
  • {{Convert|9|km}} → 9 किलोमीटर (30,000 फीट)
  • {{Convert|9|km|abbr=off}} → 9 किलोमीटर (30,000 फीट)
  • {{Convert|9|km|abbr=on}} → 9 कि॰मी॰ (30,000 फीट)
  • {{Convert|९|km}}[convert: invalid number]
  • {{Convert|९|km|abbr=off}}[convert: invalid number]
  • {{Convert|९|km|abbr=on}}[convert: invalid number]
  • {{Convert|9|kg}} → 9 किलोग्राम (320 औंस)
  • {{Convert|9|kg|abbr=off}} → 9 किलोग्राम (320 औंस)
  • {{Convert|9|kg|abbr=on}} → 9 कि॰ग्राम (320 औंस)
  • {{Convert|९|kg}}[convert: invalid number]
  • {{Convert|९|kg|abbr=off}}[convert: invalid number]
  • {{Convert|९|kg|abbr=on}}[convert: invalid number]
  • {{Convert|9|mm2}} → 9 वर्ग मिलीमीटर (9.7×10−5 वर्ग फुट)
  • {{Convert|9|mm2|abbr=off}} → 9 वर्ग मिलीमीटर (9.7×10−5 वर्ग फुट)
  • {{Convert|9|mm2|abbr=on}} → 9 मि॰मी2 (9.7×10−5 वर्ग फुट)
  • {{Convert|९|mm2}}[convert: invalid number]
  • {{Convert|९|mm2|abbr=off}}[convert: invalid number]
  • {{Convert|९|mm2|abbr=on}}[convert: invalid number]
  • {{Convert|9|cm2}} → 9 वर्ग सेन्टीमीटर (0.0097 वर्ग फुट)
  • {{Convert|9|cm2|abbr=off}} → 9 वर्ग सेन्टीमीटर (0.0097 वर्ग फुट)
  • {{Convert|9|cm2|abbr=on}} → 9 से॰मी2 (0.0097 वर्ग फुट)
  • {{Convert|९|cm2}}[convert: invalid number]
  • {{Convert|९|cm2|abbr=off}}[convert: invalid number]
  • {{Convert|९|cm2|abbr=on}}[convert: invalid number]
  • {{Convert|9|km2}} → 9 वर्ग किलोमीटर (97,000,000 वर्ग फुट)
  • {{Convert|9|km2|abbr=off}} → 9 वर्ग किलोमीटर (97,000,000 वर्ग फुट)
  • {{Convert|9|km2|abbr=on}} → 9 कि॰मी2 (97,000,000 वर्ग फुट)
  • {{Convert|९|km2}}[convert: invalid number]
  • {{Convert|९|km2|abbr=off}}[convert: invalid number]
  • {{Convert|९|km2|abbr=on}}[convert: invalid number]
  • {{Convert|9|mm3}} → 9 घनमिली मीटर (3.2×10−7 घन फुट)
  • {{Convert|9|mm3|abbr=off}} → 9 घनमिली मीटर (3.2×10−7 घन फुट)
  • {{Convert|9|mm3|abbr=on}} → 9 मि॰मी3 (3.2×10−7 घन फुट)
  • {{Convert|९|mm3}}[convert: invalid number]
  • {{Convert|९|mm3|abbr=off}}[convert: invalid number]
  • {{Convert|९|mm3|abbr=on}}[convert: invalid number]
  • {{Convert|9|cm3}} → 9 घनसेन्टी मीटर (0.00032 घन फुट)
  • {{Convert|9|cm3|abbr=off}} → 9 घनसेन्टी मीटर (0.00032 घन फुट)
  • {{Convert|9|cm3|abbr=on}} → 9 से॰मी3 (0.00032 घन फुट)
  • {{Convert|९|cm3}}[convert: invalid number]
  • {{Convert|९|cm3|abbr=off}}[convert: invalid number]
  • {{Convert|९|cm3|abbr=on}}[convert: invalid number]
  • {{Convert|9|km3}} → 9 घनकिलो मीटर (3.2×1011 घन फुट)
  • {{Convert|9|km3|abbr=off}} → 9 घनकिलो मीटर (3.2×1011 घन फुट)
  • {{Convert|9|km3|abbr=on}} → 9 कि॰मी3 (3.2×1011 घन फुट)
  • {{Convert|९|km3}}[convert: invalid number]
  • {{Convert|९|km3|abbr=off}}[convert: invalid number]
  • {{Convert|९|km3|abbr=on}}[convert: invalid number]
The results seem fine. And yes, it seems everything mentioned up till now has been done.
Now I think we need to do some systematic example tests to make sure everything will be fine. I seem to remember that disp=table works slightly differently in the old template and the module. Example:

{{convert|510072000|km2|sqmi|disp=table}} --> style="text-align:right;"|510,072,000 |style="text-align:right;"|196,940,000 {{Convert|510072000|km2|sqmi|disp=table}} --> style="text-align:right;"|510,072,000 |style="text-align:right;"|196,940,000

I'm not sure which is better, but this definitely needs looking into.--सिद्धार्थ घई (वार्ता) 11:12, 26 अप्रैल 2014 (UTC)
I do not know why {convert} is displaying the output unit (and not displaying the input unit). The old templates at enwiki do exactly what the module does (except the module uses quotes to give align="right" while the old templates just give align=right). I copied क्षेत्रफल के अनुसार देशों की सूची (which uses {convert} 738 times) to User:Johnuniq/sandbox, and replaced each convert with {convert/sandboxlua}. The latter looks fine to me. Johnuniq (वार्ता) 22:53, 26 अप्रैल 2014 (UTC)
Regarding tests: apart from disp=table, the examples at User:Johnuniq/converts give a comprehensive set of tests because that list was created by taking all converts used in articles, then eliminating examples which do the same conversion with different numbers. Johnuniq (वार्ता) 22:58, 26 अप्रैल 2014 (UTC)
Ok, so it seems all work for making the module live has been done. The remaining work (fixing any unit links, adding input aliases etc.) can be done even after making it live.
Now all we need is good documentation so that links, aliases etc. can be changed/added without having to bother you :)
I'll import en:Help:Convert messages. Any other doc page I should import?--सिद्धार्थ घई (वार्ता) 11:34, 27 अप्रैल 2014 (UTC)
I wouldn't bother importing more than that. If you later find something is wanted you can fix it (for example, the doc links at the top of the page you mentioned). Johnuniq (वार्ता) 01:11, 28 अप्रैल 2014 (UTC)