I have copied these pages from en.wikipedia: Module:Convert/data and Module:Convert/text and Template:Convert/sandboxlua. I also checked that Module:Convert is a copy of the module from en.wikipedia. The following shows some tests:

  • {{convert/sandboxlua|70|mi|km}} → ৭০ মাইল (১১০ কিমি)
  • {{convert/sandboxlua|70|kg|lb}} → ৭০ কিলোগ্রাম (১৫০ পা)

Johnuniq (আলাপ) ১১:২৩, ২৩ জুন ২০১৩ (ইউটিসি)

I have restored Template:Convert to use the Lua module. The module has several problems when used here (for example, the unit names have not yet been customized, so it's showing "metre" instead of "মিটার"). However, whatever is causing the previous template to break seems to be causing severe problems, so maybe a half-working module is better than the previous template? I will return in the next day or two to clean it up. To remove what I did, just undo my last edit to Template:Convert/sandboxlua. Johnuniq (আলাপ) ১২:০০, ২৪ জুন ২০১৩ (ইউটিসি)

Update: I have moved the links to my user page. Johnuniq (আলাপ) ০২:৫০, ১৭ ফেব্রুয়ারি ২০১৪ (ইউটিসি)

Unit namesসম্পাদনা

I got your message.--বেলায়েত (আলাপ | অবদান) ০৯:৫৮, ২৪ জুলাই ২০১৩ (ইউটিসি)

Thanks, I see that the standard orange bar is used here. There is a new notification system at en.wikipedia which is not nearly so noticeable. Johnuniq (আলাপ) ১০:২৪, ২৫ জুলাই ২০১৩ (ইউটিসি)

Module:Location mapসম্পাদনা

@User:Aftabuzzaman: I am starting to look at your report at en:WT:Lua#Script error. I have edited Module:অবস্থান মানচিত্র/খেলাঘর. See "TODO" for stuff I have not yet looked at.

Template:অবস্থান মানচিত্র/sandbox uses wikitext like:

{{#invoke:অবস্থান মানচিত্র/খেলাঘর|main|Croatia|coordinates={{Coord|44|26|N|15|3|E}}}}

I do not understand how that relates to {{Infobox settlement}}. Please set up a test that shows an error such as at ছাতনা. The following, from that article, shows the error:

{{Infobox settlement
|name = Example
|pushpin_map = India West Bengal # India
|coordinates = {{coord|23|18|06.3|N|86|58|57.8|E|display=inline,title}}

Johnuniq (আলাপ) ১০:০৩, ৫ আগস্ট ২০১৭ (ইউটিসি)

Because Module:Location map has coordinates parameter which is used by {{Infobox settlement}} via {{Location map}}. If {{#invoke:অবস্থান মানচিত্র/খেলাঘর|main|Croatia|coordinates={{Coord|44|26|N|15|3|E}}}} gives correct result, automatically |coordinates = {{coord|23|18|06.3|N|86|58|57.8|E|display=inline,title}}also give you correct result. anyway, i set up a test page here. (note: Module:Location map/sandbox isn't live, so to test টেমপ্লেট:অবস্থান মানচিত্র/sandbox/Infobox settlement, you have to put this {{#invoke:অবস্থান মানচিত্র/খেলাঘর|main}} code here). --আফতাব (আলাপ) ১৮:১১, ৫ আগস্ট ২০১৭ (ইউটিসি)
@User:Aftabuzzaman: Thanks, but what I need is a page where the Infobox settlement error I mentioned above is shown. Preferably there should be no other tests on that page because I want to keep it simple. However, everything would use sandbox templates and modules so I can experiment with them. The test case would use "Infobox settlement/sandbox" and it would do whatever it does, but would end up invoking মডিউল:অবস্থান মানচিত্র/খেলাঘর (Module:Location map/sandbox). I am happy if the templates involved use /খেলাঘর rather than /sandbox. Clicking "Edit source" on the test page should show, under "Templates used on this page", that মডিউল:অবস্থান মানচিত্র/খেলাঘর is used. Johnuniq (আলাপ) ০৭:৪৬, ৬ আগস্ট ২০১৭ (ইউটিসি)
Ok. Everything is done accordingly:
1) Template:অবস্থান মানচিত্র/খেলাঘর for invoking module
2) Template:Infobox settlement/খেলাঘর it does whatever {{Infobox settlement}} does except it use Template:অবস্থান মানচিত্র/খেলাঘর
3) Template:Infobox settlement/sandbox for testing settlement
4) Template:অবস্থান মানচিত্র/sandbox for testing Location map.
Sorry, do you want settlement's test page with one example or do you want article page? if you want settlement's test page with one example then remove other three examples from Template:Infobox settlement/sandbox or if you want article page here are some articles: সাইদ বন্দর, কোল্লাম মহানগর অঞ্চল, কাস্কো ভিয়েজো, পানামা, জৈসলমের জেলা. --আফতাব (আলাপ) ১৪:২৬, ৬ আগস্ট ২০১৭ (ইউটিসি)
Thanks. I put a test in my sandbox and will work with that at first. Johnuniq (আলাপ) ১১:২১, ৭ আগস্ট ২০১৭ (ইউটিসি)
I think you should add coord direction there, otherwise it will always give you error. --আফতাব (আলাপ) ১৪:৫১, ৭ আগস্ট ২০১৭ (ইউটিসি)
Thanks! I don't know that happened or how long I would have failed to notice the blunder. Johnuniq (আলাপ) ২২:৫৮, ৭ আগস্ট ২০১৭ (ইউটিসি)

@User:Aftabuzzaman: I have edited মডিউল:অবস্থান মানচিত্র/খেলাঘর (Module:Location map/sandbox) with some fixes that might be all that is needed. Please test and let me know if there are any problems. I decided to translate all the parameters in the way that you had done. My code is much more efficient and covers all the cases where getArgs is used. That is probably necessary although there is a lot about the module and how it is used that I do not understand.

When I originally looked at the module, I started with some translation code in coord2text and felt compelled to clean up the enwiki original which was unduly complex. I see no reason to restore the original enwiki code and in the future I might propose that en:Module:Location map be changed in a similar manner. It is true that regex code is always difficult and likely to not do what the programmer wanted—there is a well-known joke that if you have a problem and solve it using a regex, the result is that you have two problems [the original problem plus the problem of getting the regex to work for all inputs]. Therefore, I can understand that people don't want to think about when mw.ustring.match is needed, but it is not needed in coord2text and it is a lot slower than Lua's string.match. Johnuniq (আলাপ) ০২:৪৩, ৮ আগস্ট ২০১৭ (ইউটিসি)

Everything is working except one thing. Problem is if map name contain any of those word: পূর্ব, পশ্চিম, উত্তর or দক্ষিণ module replace that word with following E, W, N, S. For example, if map name is দক্ষিণ আফ্রিকা (South Africa) module replace that with Sআফ্রিকা () and because Template:অবস্থান মানচিত্র Sআফ্রিকা or Module:অবস্থান মানচিত্র/উপাত্ত/Sআফ্রিকা didn't exist, module return error. see test 1 here & test case 2 here. --আফতাব (আলাপ) ১৬:০৩, ৮ আগস্ট ২০১৭ (ইউটিসি)
That should be fixed now. There may be other parameters that should not be translated. Johnuniq (আলাপ) ২২:৫৯, ৮ আগস্ট ২০১৭ (ইউটিসি)
I had a quick look at the documentation at en:Template:Location map. Do you agree that the following parameters should not be translated?
alt, AlternativeMap, caption, overlay_image
I added them as "no translate". Johnuniq (আলাপ) ২৩:১১, ৮ আগস্ট ২০১৭ (ইউটিসি)
It seems everything working as expected. So implemented the patch. Thank you very very much for fixing this module. --আফতাব (আলাপ) ১৫:৫১, ৯ আগস্ট ২০১৭ (ইউটিসি)
Good! Johnuniq (আলাপ) ১০:২৮, ১০ আগস্ট ২০১৭ (ইউটিসি)

Module:Location map/manyসম্পাদনা

Hi, i'm sorry for disturbing again. after updating Module:Location map, i thought "Module:Location map/many" will work automatically but it gives error. Main problem is it's work with lat1_deg, lat2_deg, lon1_deg, lon2_deg etc parameter but doesn't work with coordinates, coordinates2, coordinates3 etc parameter. Could you please take a look?

Module:অবস্থান মানচিত্র/বহু/খেলাঘর -Module:Location map/many/sandbox (same code as enwiki)
Template:অবস্থান মানচিত্র বহু/খেলাঘর -for invoking module
Template:অবস্থান মানচিত্র বহু/sandbox -test page

--আফতাব (আলাপ) ২২:৫৫, ১৯ আগস্ট ২০১৭ (ইউটিসি)

The problem is that মডিউল:অবস্থান মানচিত্র/বহু/খেলাঘর (Module:Location map/many/sandbox) is directly calling p.mark in মডিউল:অবস্থান মানচিত্র (Module:Location map). The translations I put in the latter are only effective when the module is invoked from a template. I'll think about how to fix that later. If you don't hear from me within three days I have probably been distracted and forgotten, so please remind me by posting here. Johnuniq (আলাপ) ০৫:০৭, ২০ আগস্ট ২০১৭ (ইউটিসি)
Thanks & Ok. আফতাব (আলাপ) ১৪:৪৫, ২০ আগস্ট ২০১৭ (ইউটিসি)
Off-wiki difficulties have delayed me, but this should be fixed within a week from now. Johnuniq (আলাপ) ২২:৩৭, ২২ আগস্ট ২০১৭ (ইউটিসি)
Ok. আফতাব (আলাপ) ২২:৪২, ২২ আগস্ট ২০১৭ (ইউটিসি)
টেমপ্লেট:অবস্থান মানচিত্র বহু/খেলাঘর Template:Location map many/sandbox
টেমপ্লেট:অবস্থান মানচিত্র বহু/sandbox test page
মডিউল:অবস্থান মানচিত্র/খেলাঘর Module:Location map/sandbox
মডিউল:অবস্থান মানচিত্র/বহু/খেলাঘর Module:Location map/many/sandbox
মডিউল:অবস্থান মানচিত্র Module:Location map
মডিউল:অবস্থান মানচিত্র/বহু Module:Location map/many

@আফতাব: I edited মডিউল:অবস্থান মানচিত্র/খেলাঘর (Module:Location map/sandbox) to enhance the way translation works. The modules are complex and it is not clear what templates or modules that I know nothing about may use them. That is, I am not confident that everything will work. Problems may be discovered but they will have to be found from trial and error. Please check the results and let me know how it goes. Johnuniq (আলাপ) ০৯:৪৪, ২৬ আগস্ট ২০১৭ (ইউটিসি)

Thank you. I implemented the patch. I think everything is working but if i find anything, i will let you know. --আফতাব (আলাপ) ১৬:৪৭, ২৬ আগস্ট ২০১৭ (ইউটিসি)


By the way, I noticed that Template:Coord has some tricky wikitext whereas en:Template:Coord just invokes the module. I do not understand the details, but you might like to think about whether to update the template. You would also need to update মডিউল:স্থানাঙ্ক from en:Module:Coordinates. If wanted, I can help do that by transferring the translations you have done to a sandbox Coordinates module. Johnuniq (আলাপ) ০৩:৫৩, ৮ আগস্ট ২০১৭ (ইউটিসি)

I updated Template:Coord. It will be great if you help with মডিউল:স্থানাঙ্ক also. here is everything:
1) Module:স্থানাঙ্ক/খেলাঘর sandbox (everything same as enwiki with solution. Solution only give bengali result. But current problem is if i give input in bengali, module return error. also coord2text isn't working. Important:two gadgets, GeoData API depends on this module's {{#coordinates:}} function, // also, i guess those won't work in bengali digit. So we have to make sure whatever the input is (en/bn), those function gets their input in en digit and at the same time visible result should be in bengali. Current Module:স্থানাঙ্ক's code does that correctly. Expand this {{coord|44.112|N|87.913|W}} here, you will understand what i'm trying to tell you.)
2) Template:Coord/খেলাঘর for invoking module
3) Template:Coord/sandbox for testing
--আফতাব (আলাপ) ১৬:৪১, ৮ আগস্ট ২০১৭ (ইউটিসি)
I edited মডিউল:স্থানাঙ্ক/খেলাঘর (Module:Coordinates/sandbox) and put some extra tests in my sandbox. I was a bit rushed and will need to check everything carefully later. In particular, the new code translates all arguments for coordinsert and I have not yet looked at that function or what it is supposed to do. Johnuniq (আলাপ) ১০:১৬, ৯ আগস্ট ২০১৭ (ইউটিসি)
Thanks. After your edit everything is working. but there is a little problem. There should be a space between digit and word (e.g like this 55°45′08″ North 37°36′56″ East). For some reason module adds space for some example and for some example it doesn't, see here (example no 2 & 3). --আফতাব (আলাপ) ১৭:০৩, ৯ আগস্ট ২০১৭ (ইউটিসি)
OK. I'll look at that in a day or two, and will consider your other comments above. Johnuniq (আলাপ) ১০:৩০, ১০ আগস্ট ২০১৭ (ইউটিসি)
@আফতাব: I made an edit. Let me know what else is needed. Ideally there would be a better way of handling the direction (N/S/E/W) translations but I might leave that for now if nothing more is needed. I do not know the effect of the translations in the en:Geo (microformat) output, but experiments will show any problems. Johnuniq (আলাপ) ১০:১৫, ১১ আগস্ট ২০১৭ (ইউটিসি)
Thanks, everything is working. Two things,
1) currently module uses module:Numeral converter/খেলাঘর (local convert = require( "মডিউল:Numeral converter/খেলাঘর" ).convert;) to convert en to bn digit. You said that this module isn't much efficient, can you fix that too. e.g by removing local convert then adding something like local function translate2bn(text) or can i replace module:Numeral converter/খেলাঘর with Module:ConvertDigit?
2) Before your edit, 3-4 months ago i added a function there called local function banglaChars(enChar). Is that necessary now? --আফতাব (আলাপ) ১৫:০৭, ১১ আগস্ট ২০১৭ (ইউটিসি)

@আফতাব: I edited মডিউল:স্থানাঙ্ক/খেলাঘর (Module:Coordinates/sandbox) to replace the "convert" from মডিউল:Numeral converter/খেলাঘর (Module:Numeral converter/sandbox) with a more efficient function. I do not want to clean the numeral converter module unless you can clarify exactly what is wanted. It looks as if the module is from fawiki and my guess is that almost all of the module could be omitted. The module has:

function p.convert(lang, text, signs, virgule)
  • Can signs and virgule be omitted? I think they are not relevant at bnwiki.
  • The module allows "as" + "bpy" + "glk" for lang. Are they wanted?
  • Is there a need for lang? It's simpler to have two different functions with clearer names. To me, it would be clearer to use translate2bn and translate2en because "convert" is frequently used, at least at enwiki, to convert things like feet to meters, or other similar ideas. You would know what makes more sense at bnwiki, so that's up to you.

Let me know what is wanted. Johnuniq (আলাপ) ০২:৩২, ১৩ আগস্ট ২০১৭ (ইউটিসি)

First, Thank you very much. I have almost every possible test case here and it seems everything working. So i implemented your patch.
Ya, the module is from fawiki and you're right, we don't need signs and virgule, as well as "as" + "bpy" + "glk". You can use translate2bn and translate2en, i have no objection. After rewriting the module, could you please give some example how to call those function from another module? (Currently i do this: i call from another module using local convert = require( "মডিউল:Numeral converter/খেলাঘর" ).convert;, then i use convert("bn",.......) to convert en to bn and convert("en",.......) to convert bn to en where needed) --আফতাব (আলাপ) ১৫:০৪, ১৩ আগস্ট ২০১৭ (ইউটিসি)

@আফতাব: I updated মডিউল:Numeral converter/খেলাঘর.It needs testing, but I think the comments I put at the top are correct. Examples:

  • {{#invoke:numeral converter/খেলাঘর|translate2bn|1234}} → ১২৩৪
  • {{#invoke:numeral converter/খেলাঘর|translate2en|১২৩৪}} → 1234
  • {{#invoke:numeral converter/খেলাঘর|convert_template|bn|1234}} → ১২৩৪
  • {{#invoke:numeral converter/খেলাঘর|convert_template|en|১২৩৪}} → 1234

Johnuniq (আলাপ) ০৩:৫১, ১৫ আগস্ট ২০১৭ (ইউটিসি)

Thank you very much. আফতাব (আলাপ) ১৯:১০, ১৫ আগস্ট ২০১৭ (ইউটিসি)

@আফতাব: I just discovered something new:

  • {{formatnum:১২৩৪|R}} → 1234

That came up at en:Module talk:WikidataIB#Trying to use on sawiki. Also see en:Template talk:Time ago#Sawiki error for a trick using "xnU" with formatDate in a module. Johnuniq (আলাপ) ০৯:১২, ২ এপ্রিল ২০১৮ (ইউটিসি)

@Johnuniq: I knew this. but it's not very helpful when we need to convert number & month at the same time, That's why i usually don't use it. And Bangla wiki alreday use "xnU" for Module:TimeAgo (although i copied it from fawiki  ) --আফতাব (আলাপ) ১৪:৩২, ২ এপ্রিল ২০১৮ (ইউটিসি)


@আফতাব: I'm working on a module to implement en:Template:NUMBEROF, namely en:Module:NUMBEROF. It uses data from a page at Commons in the Data: namespace. There's nothing for you to see, but if you wanted to read the background, it's at en:Template talk:NUMBEROF#Overhead. I'm pinging you here to let you know that I am creating some pages to see how the module performs on another Wikipedia. You may never want to use it because you have a working system, but I'm hoping to check the module's operation even if it's never used here.

Johnuniq (আলাপ) ০৪:৫৭, ৭ মে ২০২০ (ইউটিসি)

Here is a quick test.
  • {{NUMBEROF/খেলাঘর|edits|en}} → 985865945
  • {{NUMBEROF/খেলাঘর|edits|bn}} → 4702813
  • {{NUMBEROF/খেলাঘর|edits|en|N}} → ৯৮,৫৮,৬৫,৯৪৫
  • {{NUMBEROF/খেলাঘর|edits|bn|N}} → ৪৭,০২,৮১৩
  • {{NUMBEROF/খেলাঘর|depth|en}} → 1035
  • {{NUMBEROF/খেলাঘর|depth|bn}} → 334
  • {{NUMBEROF/খেলাঘর|depth|en|N}} → ১,০৩৫
  • {{NUMBEROF/খেলাঘর|depth|bn|N}} → ৩৩৪
Johnuniq (আলাপ) ০৭:২৬, ৭ মে ২০২০ (ইউটিসি)
Hello Johnuniq. I changed my username from "Aftabuzzaman" to "আফতাবুজ্জামান", that's why i didn't got your ping in time. I can see it was already implemented here by user:GreenC and everything is working correctly. Thank you both of you. --আফতাবুজ্জামান (আলাপ) ০০:১৯, ১৮ মে ২০২০ (ইউটিসি)