Quick test for:

Input Output
{{englishdetect|Example}} Example Green tickY
{{englishdetect|Wiki উইকি}} Wiki উইকি Green tickY
{{englishdetect|উইকি}} উইকি Green tickY
{{englishdetect|উইকিWiki}} উইকিWiki Green tickY
{{englishdetect|উইকিWiki বাংলা}} উইকিWiki বাংলা Green tickY
{{englishdetect|1234567890 ১২৩৪৫৬৭৮৯০}} 1234567890 ১২৩৪৫৬৭৮৯০ Green tickY
{{englishdetect|.-*^?&% etc.}} .-*^?&% etc. Green tickY
{{englishdetect|1১২2}} 1১২2 Green tickY
{{englishdetect|a১২b}} a১২b Green tickY
{{englishdetect|a1১২b2}} a1১২b2 Green tickY
{{englishdetect|1a১২2b}} 1a১২2b Green tickY

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.

Johnuniq (আলাপ) ০৩:৩২, ১৭ ডিসেম্বর ২০১৫ (ইউটিসি)


I found a problem. It need to be fixed, otherwise i can't use Template:englishdetect via another template. Problem is: when i give any wikilink in english, Template:englishdetect unlink that wikilink. (see this exemple)

Input Output expected/should be
{{englishdetect|This is a [[Example]]}} This is a Example This is a Example
{{englishdetect|This is a [[Example|Test]]}} This is a Test This is a Test
{{englishdetect|[[Dhaka]] ([[Dhaka|Uttara]])}} Dhaka (Uttara) Dhaka (Uttara)
Input Output expected/should be
{{englishdetect|[[ঢাকা]], [[ঢাকা|উওরা]] ([[এক]])}} ঢাকা, উওরা (এক) ঢাকা, উওরা (এক)  Y :)

আফতাব (আলাপ) ১৬:০৬, ১৭ ডিসেম্বর ২০১৫ (ইউটিসি)

A program has to follow a set of rules, and the suggested solutions above may require too much intelligence from the module. Consider the input:
Ages 12–18 are [[Example123]] more
We can see that the best way to handle that is to put a single span around the whole text, but it would be hard to produce some rules which do that while also giving the results wanted in the previous examples. The problem is that while it is easy to detect English letters, there is no straight forward way of detecting Bangla characters. Please consider how englishdetect would be used and think about whether the following rules would work:
  • If the input contains English letters and if the input contains "[[" then put a single span around the whole input.
  • Otherwise, process as currently occurs, so spans are inserted around each sequence of English letters and the result may have several spans.
Those rules are not ideal because the input "[[Dhaka|ঢাকা]] বাংলাদেশের" would have a span around the whole input. However, the rule would be simple and therefore reliable. Would that work? Johnuniq (আলাপ) ২৩:১০, ১৭ ডিসেম্বর ২০১৫ (ইউটিসি)
Yes. Considering Bangla characters detecting problem, i accept your suggested rules. go ahead আফতাব (আলাপ) ১৭:৪৩, ১৮ ডিসেম্বর ২০১৫ (ইউটিসি)
OK, I've done that. Please give it a thorough test! Johnuniq (আলাপ) ০০:০৯, ১৯ ডিসেম্বর ২০১৫ (ইউটিসি)

Problem 2সম্পাদনা

If i use <br> or <small></small> or <big></big> inside this template, Module doesn't give correct result. And because of this there are many incorrect result

Input Output expected/should be
{{englishdetect|This is a <br>Example}} This is a
This is a
{{englishdetect|This is a <big>Example</big>}} This is a Example This is a Example
{{englishdetect|This is a <small>Example</small>)}} This is a Example This is a Example

Is it possible to add something to ignore <br> or <small></small> or <big></big>? আফতাব (আলাপ) ২২:৫৩, ১২ মে ২০১৮ (ইউটিসি)