Page MenuHomePhabricator

Warn user when trying to add span tags with lang and dir attributes that match the wiki they're editing on
Open, Needs TriagePublic

Description

Check https://en.wikipedia.org/w/index.php?title=Bachendri_Pal&type=revision&diff=684745724&oldid=682733814

for

<span lang="en" dir="ltr">Early life</span>

etc.

It was added in October 8th. Span tags were even added around existing text.

Event Timeline

Magioladitis raised the priority of this task from to Needs Triage.
Magioladitis updated the task description. (Show Details)
Magioladitis added a project: VisualEditor.
Magioladitis subscribed.
Esanders claimed this task.
Esanders subscribed.

This is the correct markup if the user deliberately marked the page with language annotations. Most likely just user error.

Why an editor to mark the page with language annotation? This does not affect the visual outcome. Why this is even possible via VE?

@Magioladitis: This feature provides good HTML markup and prevents problems when different scripts are combined. It may be helpful to some readers if they are reading in English and a Spanish word or sentence is present, but it is essential when reading or writing in a left-to-right script and then switching to a right-to-left script.

The HTML markup has the same effect as the template {{lang-ar}} on the English Wikipedia, but with the additional benefits that it works at every wiki (regardless of the presence or absence of local templates) and doesn't require transcluding a template.

That is why it is possible. But why would someone do it? It's possible that some of them believe this is a built-in machine translation tool, rather than a way to change scripts. Providing a clearer description is the subject of T117460: Clarify the purpose of the Language character styling option.

Any interest in preventing a user from adding a <span> tag that matches the language and LTR direction of that wiki? Something like this might have helped prevent these 113 cases of English pages being marked as <span lang="en" dir="ltr"> by newish Visual Editor users.

https://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/Tasks#Remove_span_lang%3Den_dir%3Dltr_from_113_articles

Preventing seems like a bad idea. However perhaps having a warning "this is already the language for the document, are you sure you want to mark this specific part as "content language" " or something might be an opportunity ?

Novem_Linguae renamed this task from VE adds span tags with lang and dir attributes to Warn user when trying to add span tags with lang and dir attributes that match the wiki they're editing on.Jun 22 2023, 10:11 PM

@Esanders: Per emails from Sep18 and Oct20 and https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup , I am resetting the assignee of this task because there has not been progress lately (please correct me if I am wrong!). Resetting the assignee avoids the impression that somebody is already working on this task. It also allows others to potentially work towards fixing this task. Please claim this task again when you plan to work on it (via Add Action...Assign / Claim in the dropdown menu) - it would be welcome. Thanks for your understanding!