Przejdź do zawartości

Wikipedysta:Johnuniq/translate

Z Wikipedii, wolnej encyklopedii

This page is to discuss what is needed to prepare Module:Convert for possible use on this wiki. Please add comments and answer questions as needed, treating this like a talk page. Johnuniq (dyskusja) 11:29, 31 mar 2017 (CEST)[odpowiedz]

Need help with Module:Convert at Polish Wikipedia[edytuj | edytuj kod]

Hi there! I'm trying to localise Module:Convert (and the associated template) for Polish Wikipedia. I have however a couple of technical puzzles I can't solve myself. Could you please help me?

  1. The automatic English plural. I tried to get rid of it by using the method you mentioned for Slovenian, but in my sandbox the English "s" still appears (see "12 kilometr na godzinęs" there, should be "12 kilometrów na godzinę"). What am I doing wrong?
  2. Since the Polish grammar is pretty similar to Slovenian, I simply copied the translation_table from sl.wiki (the main difference is that we don't use a dual grammatical number, which means 2 Ohm and 3-4 Ohm would have the same suffix in Polish but different in Slovenian, but the table I copied from Slovenian wiki - w:pl:Moduł:Convert/tabela_jednostek/opis#Variable_names - would work as well I believe. Or would it be easier to start from scratch and provide all the details for Polish language in one place and work from there?
  3. I understand that for the module to use Polish localised parametres (say, "język" instead of "lang") I would have to translate local en_option_name = { at w:pl:Moduł:Convert/text). Do any other places need updating as well?
  4. For testing purposes I placed the template itself at w:pl:Szablon:Przelicz, since we already have w:pl:Szablon:Konwerter that is tied to Template:Convert via wikidata. It's a very crude and simplified version, possibly based on English WP's template from way back when (2008?). Do you think it would be possible to replace what we already have with new version? It doesn't have too many parametres and none of them are named (1 for the number, 2 for "from unit", 3 for "to unit", 4 for number of digits after the comma, 5 for whether only converted units are shown - yes/no - an equivalent of disp=out in your Module I believe). So the problem is with parametre 5, all others apparently match and a typical use (say, {{Konwerter|15.5|km|mi}} would be consistent if we replaced the template altogether: <code>{{Convert|15.5|km|mi}}</code> should work just as well). However, can you think of a way to cope with the 5th parametre that is already there in many articles on Polish Wikipedia? Bot the hell out of it?

BTW, if you respond here, please be so kind as to {{ping}} me. //Halibutt 13:42, 30 March 2017 (UTC)

I think I fixed the plural problem. See my edits to Module:Convert/text. I'll think about the other issues later. Johnuniq (dyskusja) 09:01, 31 mar 2017 (CEST)[odpowiedz]

Re Q3: lang is not a good example because I think you would always want digits 0123456789. If you provide translations for one option that is commonly used such as abbr=on (for both abbr and on), I will edit the module to show the procedure. The important point is that the enwiki options should not be changed because one of the reasons for wanting to use Module:Convert is to allow people to copy an article from enwiki and have it mostly work (when translated) without having to fuss with convert templates. The point is that, for example, if abbr were changed to something else, any article using that option would immediately break, and future articles would also not work. Translated options are best added. Johnuniq (dyskusja) 11:29, 31 mar 2017 (CEST)[odpowiedz]

Re Q2: This relates to the table at Module:Convert/tabela jednostek/opis#Variable names. If the "Integer 2" column is always the same as "Integer 3 or 4", I can tweak the module so that the latter can be omitted, and the former can be renamed "Integer 2, 3 or 4". Actually, the heading can be renamed to whatever you like, so long as it means 2, 3 or 4. What is wanted? Johnuniq (dyskusja) 01:43, 1 kwi 2017 (CEST)[odpowiedz]

@Halibutt: Do you want me to ping you on this wiki? Every time I edit here? Please do not ping me unless I fail to respond for 48 hours. I work in bursts, and right now this issue has my attention. Thanks for the "thank" when I fixed the plural problem, but I would prefer visible feedback (have you checked a couple of cases? did they work?) so this page records progress for each issue. Johnuniq (dyskusja) 01:43, 1 kwi 2017 (CEST)[odpowiedz]

  • Re Q1: Thanks a lot, it seems the problem is indeed fixed. At least the units already translated in Module:Convert/tabela jednostek/opis#Variable names seem to be working just fine (testing here). Of course the table is far from ready, but we'll get there in time.
  • Re Q2: Yes, merging those two rows makes sense, we don't need a separate row for "2 miles", it will always be the same as "3 miles" and "4 miles" in Polish (namely: 1 mila, 2 mile, 3 mile, 4 mile, 5 mil, 5,5 mili).
  • Re Q3: yeah, if creating aliases is an option, it would be a much better solution. The trouble is that virtually all templates on Polish Wikipedia use localised and standardised names for parametres (always a full, human-readable word; say, the illustration is always grafika= regardless of the template in question). I asked @Tar Lócesilion to help me prepare a list of parametre aliases. For starters we could use linkuj= for lk= and "tak", "z", "na" and "nie" for "on", "in", "out" and "off", respectively.
  • Re pinging: ok, will not ping you every time, ping me should you have any questions (there is a chance I might be on-wiki elsewhere and would drop by to respond).
  • As to other issues, there is a problem of decimal separator. A comma is used for that purpose in Polish (plus we use a nbsp to separate large numbers into three-digit groups). I understand that the input would have to be in the English system ({{Convert|12.5|m}} rather than {{Convert|12,5|m}}), but could this be set as default for output?

Anyway, thanks again for your help. //Halibutt 02:22, 1 kwi 2017 (CEST)[odpowiedz]

Local parameter name/options[edytuj | edytuj kod]

Following up on Q3 above, I edited Module:Convert/text to add aliases for lk. Examples:

All combinations work (en "lk" or pl "linkuj" with any en or pl parameter value). Johnuniq (dyskusja) 02:53, 1 kwi 2017 (CEST)[odpowiedz]

Number grouping[edytuj | edytuj kod]

Please provide the details for how an output number should be formatted:

  • Use , as decimal separator.
  • Use &nbsp; to separate groups of three digits.
  • Grouping occurs to digits before the decimal separator. Are digits after the separator grouped?
  • What grouping occurs with 1234?

Input is difficult. Convert will not accept numbers containing a space or a non-breaking space. It will accept numbers using comma as the decimal separator, but I would have to remind myself about the horrible complexities concerning what happens with an input like 1.23 or 1.234 (should they be interpreted as values just over 1, the same as pl 1,23 and 1,234?). Johnuniq (dyskusja) 03:26, 1 kwi 2017 (CEST)[odpowiedz]

@Halibutt: Please check my contributions to see some changes I made. The following demonstrates that convert now uses the above formatting. I have not examined what happens when . is used as the decimal separator (it's a couple of years since I looked at a translation, I think). However, I believe convert tries to accept . for values possibly copied from enwiki, but it objects to garbage:

  • {{Przelicz|1,2|m|mm|abbr=on}} → 1,2 m (1200 mm)
  • {{Przelicz|1.2|m|mm|abbr=on}} → 1,2 m (1200 mm)
  • {{Przelicz|1,234|m|mm|abbr=on}} → 1,234 m (1234 mm)
  • {{Przelicz|1.234|m|mm|abbr=on}} → 1,234 m (1234 mm)
  • {{Przelicz|1,234,567|m|mm|abbr=on}}[convert: niepoprawna liczba]
  • {{Przelicz|1.234.567|m|mm|abbr=on}}[convert: niepoprawna liczba]

Johnuniq (dyskusja) 07:04, 1 kwi 2017 (CEST)[odpowiedz]

Splendid! The above is correct. Per w:en:Polish Scientific Publishers PWN's grammar first-aid station service ([1]&[2]) nbsp; should be used to separate groups of three digits for numbers larger than 9999. The only quirk is that normally thousands do not need a non-breaking space (hence 1234 is correct), but the space is sometimes added (as in 1 234) in tables where thousands co-appear with larger numbers, for consistency's sake. It is a rare case though and it wouldn't really matter that much in the case of internet/computer applications.
As to input, that's great, that's precisely what we need. Anything with a dot or a comma should be interpreted as a fraction. And accepting both the English norm (3.14) and the Polish norm (3,14) would mean the template would be natural to use for basically everyone. This way the template would also be compatible with both the current {{Konwerter}}, and with templates from other wikis. Commas or dots are never used in Polish as a group separator, so I wouldn't consider it a problem if {{Przelicz|1.234.567|m|mm|abbr=on}} doesn't work. Nobody uses numbers that way in Polish anyway (unless they mean an IP address of their routers, obviously). //Halibutt 00:24, 2 kwi 2017 (CEST)[odpowiedz]
There is an option to only show a group separator when 5 or more digits are displayed before the decimal mark, so special cases could be worked around like this:
  • {{Przelicz|1234|m|m|comma=5}} → 1234 metry (1234 m)
  • {{Przelicz|12345|m|m|comma=5}} → 12 345 metrów (12 345 m)
Some parameter name other than comma could be added (also for the 5). Johnuniq (dyskusja) 05:32, 2 kwi 2017 (CEST)[odpowiedz]
Is there a way to make this behaviour default (unless the user specifies comma=whatever? //Halibutt 12:20, 3 kwi 2017 (CEST)[odpowiedz]

Konwerter usage[edytuj | edytuj kod]

I put a list of all pages that transclude Szablon:Konwerter in my sandbox (permalink). There are only 35 articles. Am I missing something, or is convert only used in 35 articles? By the way, this (and its sandbox) look like spam. Johnuniq (dyskusja) 11:11, 1 kwi 2017 (CEST)[odpowiedz]

There was this old Central European joke about two shoemakers sent to some tropical island as a punishment. One is terrified. "I'll starve here, nobody is wearing shoes here". "I'll be rich" thinks the other one, "nobody has shoes here yet". Polish wiki has literally thousands of places where non-typical units are used, yet are not translated for the reader to easily understand them, or are translated to units an average Pole would understand, but using god knows what methods. Take mph for example: 200+200+possibly more. //Halibutt 00:37, 2 kwi 2017 (CEST)[odpowiedz]

Translating unit names[edytuj | edytuj kod]

Note to self/for future reference: while translating the unit names, it might be tempting to copy w:en:Module:Convert/documentation/conversion data/doc (or its' local variety) to a sandbox somewhere outside of the Module: and Template: space, for easier editing in visual editor. My advice: don't, cause - while it makes editing the tables much easier, it also breaks the script at Dyskusja modułu:Convert/makeunits (it becomes filled with Missing symbol (line 19). Missing symbol (line 20). Missing unit code (line 21). Missing symbol (line 22)., and so on. //Halibutt 01:31, 2 kwi 2017 (CEST)[odpowiedz]

Yes, I'm afraid Module:Convert/makeunits requires the input to follow a rigid structure. The module is very complicated already and the thought of tweaking it to accommodate a different syntax is unattractive. Johnuniq (dyskusja) 05:38, 2 kwi 2017 (CEST)[odpowiedz]

Variable names[edytuj | edytuj kod]

This relates to Q2 above. I modified Module:Convert/makeunits so it works with four columns at Module:Convert/tabela jednostek/opis#Variable names, and I removed the redundant column. I will do a more clever test later, but here is a quick workout. By the way, I created Template:Convert because I have some test procedures that are a lot less cumbersome if "Convert" is used.

  • {{convert|1|acre}} → 1 akr (0,40 ha)
  • {{convert|2|acre}} → 2 akry (0,81 ha)
  • {{convert|3|acre}} → 3 akry (1,2 ha)
  • {{convert|0|acre}} → 0 akrów (0 ha)
  • {{convert|4|acre}} → 4 akry (1,6 ha)
  • {{convert|5|acre}} → 5 akrów (2,0 ha)
  • {{convert|6|acre}} → 6 akrów (2,4 ha)
  • {{convert|1.0|acre}} → 1,0 akra (0,40 ha)

Oops, I just remembered I have to fix Module:Convert for this to work. I'll do that later, but will post the test now. Johnuniq (dyskusja) 10:13, 3 kwi 2017 (CEST)[odpowiedz]

@Halibutt: I meant to add, that you might like to edit/translate the documentation at Template:Convert. Johnuniq (dyskusja) 11:43, 3 kwi 2017 (CEST)[odpowiedz]
I have fixed the modules to handle the four-column "Variable names" table. Johnuniq (dyskusja) 11:59, 3 kwi 2017 (CEST)[odpowiedz]
Thanks! Note to self: the documentation. I'll sit on it once the template is actually ready. Or at least half-ready (meaning 100% compatible with the units handled by {{Konwerter}}. We'll get there. :) //Halibutt 12:19, 3 kwi 2017 (CEST)[odpowiedz]
What I meant was to translate my English if you think that would be desirable (that page has been deleted a couple of times and it might irritate someone that it has been recreated). I don't mean to put actual documentation there. A more complete test follows. Please check. Johnuniq (dyskusja) 12:31, 3 kwi 2017 (CEST)[odpowiedz]
Unit code 1 2 3 4 0 5 6 1.0
acre 1 akr (0,40 ha) 2 akry (0,81 ha) 3 akry (1,2 ha) 4 akry (1,6 ha) 0 akrów (0 ha) 5 akrów (2,0 ha) 6 akrów (2,4 ha) 1,0 akra (0,40 ha)
cuft 1 stopa sześcienna (0,028 m3) 2 stopy sześcienne (0,057 m3) 3 stopy sześcienne (0,085 m3) 4 stopy sześcienne (0,11 m3) 0 stóp sześciennych (0 m3) 5 stóp sześciennych (0,14 m3) 6 stóp sześciennych (0,17 m3) 1,0 stopy sześciennej (0,028 m3)
ft 1 stopa (0,30 m) 2 stopy (0,61 m) 3 stopy (0,91 m) 4 stopy (1,2 m) 0 stóp (0 m) 5 stóp (1,5 m) 6 stóp (1,8 m) 1,0 stopy (0,30 m)
g 1 gram (0,035 oz) 2 gramy (0,071 oz) 3 gramy (0,11 oz) 4 gramy (0,14 oz) 0 gramów (0 oz) 5 gramów (0,18 oz) 6 gramów (0,21 oz) 1,0 grama (0,035 oz)
Gy 1 grej (100 rad) 2 greje (200 rad) 3 greje (300 rad) 4 greje (400 rad) 0 grejów (0 rad) 5 grejów (500 rad) 6 grejów (600 rad) 1,0 greja (100 rad)
ha 1 hektar (2,5 akra) 2 hektary (4,9 akra) 3 hektary (7,4 akra) 4 hektary (9,9 akra) 0 hektarów (0 akrów) 5 hektarów (12 akrów) 6 hektarów (15 akrów) 1,0 hektara (2,5 akra)
hp 1 horsepower (0,75 kW) 2 konie mechaniczne (1,5 kW) 3 konie mechaniczne (2,2 kW) 4 konie mechaniczne (3,0 kW) 0 koni mechanicznych (0 kW) 5 koni mechanicznych (3,7 kW) 6 koni mechanicznych (4,5 kW) 1,0 konia mechanicznego (0,75 kW)
ihp 1 indicated horsepower (0,75 kW) 2 indicated horse power (1,5 kW) 3 indicated horse power (2,2 kW) 4 indicated horse power (3,0 kW) 0 indicated horse power (0 kW) 5 indicated horse power (3,7 kW) 6 indicated horse power (4,5 kW) 1,0 indicated horse power (0,75 kW)
impgal 1 imperial gallon (4,5 l; 1,2 gal US) 2 galony imperialne (9,1 l; 2,4 gal US) 3 galony imperialne (14 l; 3,6 gal US) 4 galony imperialne (18 l; 4,8 gal US) 0 galonów imperialnych (0 l; 0 gal US) 5 galonów imperialnych (23 l; 6,0 gal US) 6 galonów imperialnych (27 l; 7,2 gal US) 1,0 galona imperialnego (4,5 l; 1,2 gal US)
in 1 cal (25 mm) 2 cale (51 mm) 3 cale (76 mm) 4 cale (100 mm) 0 cali (0 mm) 5 cali (130 mm) 6 cali (150 mm) 1,0 cala (25 mm)
km/h 1 kilometr na godzinę (0,62 mph) 2 kilometry na godzinę (1,2 mph) 3 kilometry na godzinę (1,9 mph) 4 kilometry na godzinę (2,5 mph) 0 kilometrów na godzinę (0 mph) 5 kilometrów na godzinę (3,1 mph) 6 kilometrów na godzinę (3,7 mph) 1,0 kilometra na godzinę (0,62 mph)
kn 1 węzeł (1,9 km/h; 1,2 mph) 2 węzły (3,7 km/h; 2,3 mph) 3 węzły (5,6 km/h; 3,5 mph) 4 węzły (7,4 km/h; 4,6 mph) 0 węzłów (0 km/h; 0 mph) 5 węzłów (9,3 km/h; 5,8 mph) 6 węzłów (11 km/h; 6,9 mph) 1,0 węzła (1,9 km/h; 1,2 mph)
L 1 litr (0,22 imp gal; 0,26 gal US) 2 litry (0,44 imp gal; 0,53 gal US) 3 litry (0,66 imp gal; 0,79 gal US) 4 litry (0,88 imp gal; 1,1 gal US) 0 litrów (0 imp gal; 0 gal US) 5 litrów (1,1 imp gal; 1,3 gal US) 6 litrów (1,3 imp gal; 1,6 gal US) 1,0 litra (0,22 imp gal; 0,26 gal US)
l 1 litr (0,22 imp gal; 0,26 gal US) 2 litry (0,44 imp gal; 0,53 gal US) 3 litry (0,66 imp gal; 0,79 gal US) 4 litry (0,88 imp gal; 1,1 gal US) 0 litrów (0 imp gal; 0 gal US) 5 litrów (1,1 imp gal; 1,3 gal US) 6 litrów (1,3 imp gal; 1,6 gal US) 1,0 litra (0,22 imp gal; 0,26 gal US)
lb 1 funt (0,45 kg) 2 funty (0,91 kg) 3 funty (1,4 kg) 4 funty (1,8 kg) 0 funtów (0 kg) 5 funtów (2,3 kg) 6 funtów (2,7 kg) 1,0 funta (0,45 kg)
lb-f 1 funt-siła (4,4 N) 2 funty siły (8,9 N) 3 funty siły (13 N) 4 funty siły (18 N) 0 funtów siły (0 N) 5 funtów siły (22 N) 6 funtów siły (27 N) 1,0 funta siły (4,4 N)
lbf 1 funt-siła (4,4 N) 2 funty siły (8,9 N) 3 funty siły (13 N) 4 funty siły (18 N) 0 funtów siły (0 N) 5 funtów siły (22 N) 6 funtów siły (27 N) 1,0 funta siły (4,4 N)
LT 1 tona angielska (1,0 t) 2 tony angielskie (2,0 t) 3 tony angielskie (3,0 t) 4 tony angielskie (4,1 t) 0 ton angielskich (0 t) 5 ton angielskich (5,1 t) 6 ton angielskich (6,1 t) 1,0 tony angielskiej (1,0 t)
m 1 metr ([convert: bug, ask for help]) 2 metry ([convert: bug, ask for help]) 3 metry ([convert: bug, ask for help]) 4 metry ([convert: bug, ask for help]) 0 metrów (0 ft) 5 metrów ([convert: bug, ask for help]) 6 metrów ([convert: bug, ask for help]) 1,0 metra ([convert: bug, ask for help])
m2 1 metr kwadratowy (11 sq ft) 2 metry kwadratowe (22 sq ft) 3 metry kwadratowe (32 sq ft) 4 metry kwadratowe (43 sq ft) 0 metrów kwadratowych (0 sq ft) 5 metrów kwadratowych (54 sq ft) 6 metrów kwadratowych (65 sq ft) 1,0 metra kwadratowego (11 sq ft)
m3 1 metr sześcienny (35 cu ft) 2 metry sześcienne (71 cu ft) 3 metry sześcienne (110 cu ft) 4 metry sześcienne (140 cu ft) 0 metrów sześciennych (0 cu ft) 5 metrów sześciennych (180 cu ft) 6 metrów sześciennych (210 cu ft) 1,0 metra sześciennego (35 cu ft)
mi 1 mila (1,6 km) 2 mile (3,2 km) 3 mile (4,8 km) 4 mile (6,4 km) 0 mil (0 km) 5 mil (8,0 km) 6 mil (9,7 km) 1,0 mili (1,6 km)
Mly 1 megalight-year (310 kpc) 2 miliony lat świetlnych (610 kpc) 3 miliony lat świetlnych (920 kpc) 4 miliony lat świetlnych (1 200 kpc) 0 milionów lat świetlnych (0 kpc) 5 milionów lat świetlnych (1 500 kpc) 6 milionów lat świetlnych (1 800 kpc) 1,0 miliona lat świetlnych (310 kpc)
Mpc 1 megaparsek (3,3 Mly) 2 megaparseki (6,5 Mly) 3 megaparseki (9,8 Mly) 4 megaparseki (13 Mly) 0 megaparseków (0 Mly) 5 megaparseków (16 Mly) 6 megaparseków (20 Mly) 1,0 megaparseka (3,3 Mly)
mph 1 mile per hour (1,6 km/h) 2 mile na godzinę (3,2 km/h) 3 mile na godzinę (4,8 km/h) 4 mile na godzinę (6,4 km/h) 0 mil na godzinę (0 km/h) 5 mil na godzinę (8,0 km/h) 6 mil na godzinę (9,7 km/h) 1,0 mili na godzinę (1,6 km/h)
N 1 niuton (0,22 lbf) 2 niutony (0,45 lbf) 3 niutony (0,67 lbf) 4 niutony (0,90 lbf) 0 niutonów (0 lbf) 5 niutonów (1,1 lbf) 6 niutonów (1,3 lbf) 1,0 niutona (0,22 lbf)
NM 1 mila morska (1,9 km; 1,2 mi) 2 mile morskie (3,7 km; 2,3 mi) 3 mile morskie (5,6 km; 3,5 mi) 4 mile morskie (7,4 km; 4,6 mi) 0 mil morskich (0 km; 0 mi) 5 mil morskich (9,3 km; 5,8 mi) 6 mil morskich (11 km; 6,9 mi) 1,0 mili morskiej (1,9 km; 1,2 mi)
nmi 1 mila morska (1,9 km; 1,2 mi) 2 mile morskie (3,7 km; 2,3 mi) 3 mile morskie (5,6 km; 3,5 mi) 4 mile morskie (7,4 km; 4,6 mi) 0 mil morskich (0 km; 0 mi) 5 mil morskich (9,3 km; 5,8 mi) 6 mil morskich (11 km; 6,9 mi) 1,0 mili morskiej (1,9 km; 1,2 mi)
oz 1 uncja (28 g) 2 uncje (57 g) 3 uncje (85 g) 4 uncje (110 g) 0 uncji (0 g) 5 uncji (140 g) 6 uncji (170 g) 1,0 uncji (28 g)
rad 1 rad (0,010 Gy) 2 rady (0,020 Gy) 3 rady (0,030 Gy) 4 rady (0,040 Gy) 0 radów (0 Gy) 5 radów (0,050 Gy) 6 radów (0,060 Gy) 1,0 rada (0,010 Gy)
sqft 1 stopa kwadratowa (0,093 m2) 2 stopy kwadratowe (0,19 m2) 3 stopy kwadratowe (0,28 m2) 4 stopy kwadratowe (0,37 m2) 0 stóp kwadratowych (0 m2) 5 stóp kwadratowych (0,46 m2) 6 stóp kwadratowych (0,56 m2) 1,0 stopy kwadratowej (0,093 m2)
ST 1 tona amerykańska (0,91 t) 2 tony amerykańskie (1,8 t) 3 tony amerykańskie (2,7 t) 4 tony amerykańskie (3,6 t) 0 ton amerykańskich (0 t) 5 ton amerykańskich (4,5 t) 6 ton amerykańskich (5,4 t) 1,0 tony amerykańskiej (0,91 t)
t 1 tona metryczna (0,98 tony angielskiej; 1,1 tony amerykańskiej) 2 tony metryczne (2,0 tony angielskiej; 2,2 tony amerykańskiej) 3 tony metryczne (3,0 tony angielskiej; 3,3 tony amerykańskiej) 4 tony metryczne (3,9 tony angielskiej; 4,4 tony amerykańskiej) 0 ton metrycznych (0 ton angielskich; 0 ton amerykańskich) 5 ton metrycznych (4,9 tony angielskiej; 5,5 tony amerykańskiej) 6 ton metrycznych (5,9 tony angielskiej; 6,6 tony amerykańskiej) 1,0 tony metrycznej (0,98 tony angielskiej; 1,1 tony amerykańskiej)
USgal 1 galon amerykański (3,8 l; 0,83 imp gal) 2 galony amerykańskie (7,6 l; 1,7 imp gal) 3 galony amerykańskie (11 l; 2,5 imp gal) 4 galony amerykańskie (15 l; 3,3 imp gal) 0 galonów amerykańskich (0 l; 0 imp gal) 5 galonów amerykańskich (19 l; 4,2 imp gal) 6 galonów amerykańskich (23 l; 5,0 imp gal) 1,0 galona amerykańskiego (3,8 l; 0,83 imp gal)
W 1 watt (0,0013 hp) 2 waty (0,0027 hp) 3 waty (0,0040 hp) 4 waty (0,0054 hp) 0 watów (0 hp) 5 watów (0,0067 hp) 6 watów (0,0080 hp) 1,0 wata (0,0013 hp)

Adjectives[edytuj | edytuj kod]

Note to self: since Polish language adjectival forms are created using slightly different rules, and since Polish has a grammatical gender (think of different forms for a 7-mile stretch, 7-mile road and 7-mile football field, which would be 7-milowy odcinek, 7-milowa droga and 7-milowe boisko), I guess we'll have to drop the entire adj= part. Otherwise our units table would get really enormous to compensate for the fact that plural forms would have their own forms as well. //Halibutt 12:38, 3 kwi 2017 (CEST)[odpowiedz]

I edited Module:Convert/text to disable adj=on. Let me know if there is a problem. Re your recent edits to the module, by all means translate what you want but there are a lot of words and units that plwiki is very unlikely to ever use, and agonizing over translations is possibly not needed. I'm thinking of defining język for lang and liczby słownie for spell in particular because neither of those will do anything useful at plwiki. Johnuniq (dyskusja) 02:40, 4 kwi 2017 (CEST)[odpowiedz]

Polish unit symbols[edytuj | edytuj kod]

In our thread in WP:BAR @Wostr asked an important question. Most unit symbols are pretty much universal, or at least universally understood (say, m for metre, ft for feet and so on). However, there are numerous symbols that are different from the English usage. Say, Torr: in Polish it could be either tor or Tr. What's the best way to go about it? Adding another line (as if it was a completely new unit)? Or perhaps adding a synonym? //Halibutt 23:05, 5 kwi 2017 (CEST)[odpowiedz]

@Halibutt: I think you are referring to the symbol that is displayed by convert in the result, but you might be referring to the unit code that is the input to convert. If unit code, the simplest is to define an alias such as torr=Torr as shown in the last line at Module:Convert/tabela jednostek/opis#Pressure. That means {{convert|12|torr|...}} gives exactly the same result as {{convert|12|Torr|...}}.

If the concern is the output symbol, that's up to you. At enwiki, Torr is the approved symbol but if it's different here you should edit the symbol to change "Torr" to "tor" or whatever is wanted. If people would sometimes want Tr to be displayed as the symbol, it would be necessary to define an alias which specifies Tr as the symbol. For an example see the area units which define in2 as an alias of sqin, except that the symbol is in2.

  • {{convert|12|sqin}} → 12 cale kwadratowe (77 cm2)
  • {{convert|12|in2}} → 12 cale kwadratowe (77 cm2)
  • {{convert|12|sqin|abbr=on}} → 12 sq in (77 cm2)
  • {{convert|12|in2|abbr=on}} → 12 in2 (77 cm2)
The documentation for that is here.
Bear in mind that the main purpose for convert is to allow templates copied from enwiki to work in a reasonable way, with the secondary purpose of providing conversions for cases where they are wanted. I would be inclined to wait until someone asked for Tr as the symbol because anticipating every need might end up adding hundreds of cases that are never used. After all, are Polish readers really interested in how many pounds-per-square-inch is equivalent to an SI unit of pressure? If the answer is no, convert is not needed. Johnuniq (dyskusja) 06:15, 6 kwi 2017 (CEST)[odpowiedz]

Using konwerter as a wrapper for convert[edytuj | edytuj kod]

@Halibutt: Q4 at the top of this page asks whether convert could eventually replace Template:Konwerter. From your description of the parameters, I think that could readily be done by editing konwerter to call convert with some logic to insert |disp=out if parameter 5 is "tak". For compatibility, it would also need to include |lk=on.

By the way, requiring users to specify the precision (number of decimals) is not desirable because many people have no idea about an appropriate number of significant digits. At enwiki, it is common to see stuff like:

The river is {{convert|12000|km|mi|0|abbr=on}} long.

which, at plwiki, would display as:

The river is 12 000 km (7 456 mi) long.

Omitting the precision is very often the best thing to do:

The river is {{convert|12000|km|mi|abbr=on}} long.

That would display as:

The river is 12 000 km (7 500 mi) long.

Johnuniq (dyskusja) 06:34, 6 kwi 2017 (CEST)[odpowiedz]

Tons problem[edytuj | edytuj kod]

  • 1700 ton angielskich (1700 t)
  • 1 400 ton angielskich (1 400 t)
  • 1400 ton angielskich (1400 t)
  • 1 400 ton angielskich (1 400 t)
  • 1 400 ton angielskich (1 400 t)
  • 1 400 LT (1 400 t)

@Johnuniq, sorry to bother you, but I just noticed that there is something broken with the conversion of tons. For some reason neither of those above work, as if the module assumed a long ton and a metric ton are 1:1. Yet in the test table above they seem to work just fine. Any idea what went wrong? //Halibutt 11:28, 17 paź 2017 (CEST)[odpowiedz]

Convert can be very confusing when dealing with numbers ending in zero because, by default, convert rounds the output to match the significant figures in the input. 1400 LT has two significant figures, so the output is rounded to also have two significant figures. The result is seen above. Consider these:
  • {{convert|1456|lt|abbr=on}} → 1 456 LT (1 479 t)
  • {{convert|1400|lt|0|abbr=on}} → 1 400 LT (1 422 t)
Johnuniq (dyskusja) 11:46, 17 paź 2017 (CEST)[odpowiedz]

Number grouping -> defaults in config[edytuj | edytuj kod]

There is raised issue about missing defaults for option comma=5 in Dyskusja modułu:Convert#Grupowanie liczb 4 cyfrowych. To resolve this case I prepared my sandbox allowing to pass template option directly in {{#invoke:convert|convert|...}}, which means that is the default value if not given as template argument. Please review the proposal changes and give me opinion about it. The template sandbox with use case is here. Paweł Ziemian (dyskusja) 00:17, 27 paź 2018 (CEST)[odpowiedz]

I'll need 24 hours to digest this but should reply again within that time. Johnuniq (dyskusja) 06:55, 27 paź 2018 (CEST)[odpowiedz]
@Paweł Ziemian: I haven't fully studied your code but it looks good although I think it is more than needed for this simple case. Your code is fully general which is good but given that abbr is customizable already, it is unlikely that any option other than comma would need special treatment. I don't see a quick way to test what I would do, and since the module is not used much here, I just edited Module:Convert to show what I recommend. If you put |comma=5 in Template:Przelicz it should do what I think is wanted. Johnuniq (dyskusja) 11:00, 27 paź 2018 (CEST)[odpowiedz]