ব্যবহারকারী:Johnuniq/sandbox: সংশোধিত সংস্করণের মধ্যে পার্থক্য
বিষয়বস্তু বিয়োগ হয়েছে বিষয়বস্তু যোগ হয়েছে
restore 10:45, 4 July 2013 mw problem test |
test of Template:Englishdetect |
||
১ নং লাইন: | ১ নং লাইন: | ||
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}} |
০৩:৩২, ১৭ ডিসেম্বর ২০১৫ তারিখে সংশোধিত সংস্করণ
Quick test for:
- Module:ইংরেজি সনাক্তকরণ • Module to highlight any English letters in input, and add a tracking category.
- Template:ইংরেজি সনাক্তকরণ • Template that invokes the module.
Input | Output |
---|---|
{{englishdetect|Example}} | Example |
{{englishdetect|Wiki উইকি}} | Wiki উইকি |
{{englishdetect|উইকি}} | উইকি |
{{englishdetect|উইকিWiki}} | উইকিWiki |
{{englishdetect|উইকিWiki বাংলা}} | উইকিWiki বাংলা |
{{englishdetect|1234567890 ১২৩৪৫৬৭৮৯০}} | 1234567890 ১২৩৪৫৬৭৮৯০ |
{{englishdetect|.-*^?&% etc.}} | .-*^?&% etc. |
{{englishdetect|1১২2}} | 1১২2 |
{{englishdetect|a১২b}} | a১২b |
{{englishdetect|a1১২b2}} | a1১২b2 |
{{englishdetect|1a১২2b}} | 1a১২2b |
Points to think about:
- Input may include leading/trailing spaces that are preserved.
- Output is empty text if the input is empty.
- Tracking category is added regardless of namespace of page with template.