ব্যবহারকারী:Johnuniq/sandbox: সংশোধিত সংস্করণের মধ্যে পার্থক্য

বিষয়বস্তু বিয়োগ হয়েছে বিষয়বস্তু যোগ হয়েছে
Johnuniq (আলোচনা | অবদান)
restore 10:45, 4 July 2013 mw problem test
Johnuniq (আলোচনা | অবদান)
১ নং লাইন:
Quick test for:
Demonstration of problem using mw.ustring.gsub via mw.loadData using [[Module:Convert/sandbox]] (that is a clickable link).
*[[Module:ইংরেজি সনাক্তকরণ]] • Module to highlight any English letters in input, and add a tracking category.
*<code><nowiki>{{#invoke:convert/sandbox|main|TEST}}</nowiki></code> → {{#invoke:convert/sandbox|main|TEST}}
*[[Template:ইংরেজি সনাক্তকরণ]] • Template that invokes the module.
*<code><nowiki>{{#invoke:convert/sandbox|main|TEST|require}}</nowiki></code> → {{#invoke:convert/sandbox|main|TEST|require}}
*<code><nowiki>{{#invoke:convert/sandbox|main|TEST|load}}</nowiki></code> → {{#invoke:convert/sandbox|main|TEST|load}}
 
{| class="wikitable"
! Input !! Output
|-
| <nowiki>{{englishdetect|Example}}</nowiki> || {{englishdetect|Example}}
|-
| <nowiki>{{englishdetect|Wiki উইকি}}</nowiki> || {{englishdetect|Wiki উইকি}}
|-
| <nowiki>{{englishdetect|উইকি}}</nowiki> || {{englishdetect|উইকি}}
|-
| <nowiki>{{englishdetect|উইকিWiki}}</nowiki> || {{englishdetect|উইকিWiki}}
|-
| <nowiki>{{englishdetect|উইকিWiki বাংলা}}</nowiki> || {{englishdetect|উইকিWiki বাংলা}}
|-
| <nowiki>{{englishdetect|1234567890 ১২৩৪৫৬৭৮৯০}}</nowiki> || {{englishdetect|1234567890 ১২৩৪৫৬৭৮৯০}}
|-
| <nowiki>{{englishdetect|.-*^?&% etc.}}</nowiki> || {{englishdetect|.-*^?&% etc.}}
|-
| <nowiki>{{englishdetect|1১২2}}</nowiki> || {{englishdetect|1১২2}}
|-
| <nowiki>{{englishdetect|a১২b}}</nowiki> || {{englishdetect|a১২b}}
|-
| <nowiki>{{englishdetect|a1১২b2}}</nowiki> || {{englishdetect|a1১২b2}}
|-
| <nowiki>{{englishdetect|1a১২2b}}</nowiki> || {{englishdetect|1a১২2b}}
|}
 
Points to think about:
The "TEST" parameter causes text "১২৩৪৫৬৭৮৯০" to be used (should translate to "1234567890").
*Input may include leading/trailing spaces that are preserved.
:Test 1 uses a local table (correct result).
*Output is empty text if the input is empty.
:Test 2 uses a table accessed with "require" (correct result).
*Tracking category is added regardless of namespace of page with template.
:Test 3 uses a table accessed with "loadData" (bug).
[[ব্যবহারকারী:Johnuniq|Johnuniq]] ([[ব্যবহারকারী আলাপ:Johnuniq|আলাপ]]) ০৩:৩২, ১৭ ডিসেম্বর ২০১৫ (ইউটিসি)
 
 
The following shows the table <code>t</code> that is used in <code>mw.ustring.gsub(s, '%d', t)</code>. The tables are identical, so the gsub results should be the same.
*<code><nowiki>{{#invoke:convert/sandbox|main|SHOW}}</nowiki></code> → {{#invoke:convert/sandbox|main|SHOW}}
*<code><nowiki>{{#invoke:convert/sandbox|main|SHOW|require}}</nowiki></code> → {{#invoke:convert/sandbox|main|SHOW|require}}
*<code><nowiki>{{#invoke:convert/sandbox|main|SHOW|load}}</nowiki></code> → {{#invoke:convert/sandbox|main|SHOW|load}}