Page MenuHomePhabricator

VisualEditor: Text-alignment tool support
Open, Needs TriagePublicBUG REPORT

Assigned To
None
Authored By
eranroz
Aug 7 2021, 8:50 AM
Referenced Files
F34586689: image.png
Aug 7 2021, 8:53 AM
F34586683: image.png
Aug 7 2021, 8:50 AM
F34586687: image.png
Aug 7 2021, 8:50 AM

Description

The issue came from inputs from newcomers - they don't find option to set text-alignment in VE.
Text alignment is essential basic feature, required for example when citing or mentioning long English text within Arabic or Hebrew article.

Below is example of usecase to demonstrate the issue.

List of steps to reproduce (step by step, including full links if applicable):

R. Macrides, "George Akropolites' Rhetoric," in E. Jeffreys (ed.), Rhetoric in Byzantium. Papers from the Thirty-fifth Spring Symposium of Byzantine Studies, Exeter College, University of Oxford, March 2001 (Aldershot, 2003), 201–211.

What happens?:

  • The references is added with right-to-left alignment, although it is English reference. Main problem is that user can't align it to left.

What should have happened instead?:

LibraOffice:

image.png (39×114 px, 1 KB)

Google Docs example

image.png (54×129 px, 841 B)

  • At minimum we need it in the Language option, so it would support also text-align setting in addition to language and dir. (though this is not intuitive as not aligned with other major editors mentioned above)

image.png (546×270 px, 32 KB)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Are you actually asking for alignment or for direction?

I'm asking for alignment. I think we already have direction support in VE - under language selection (my last screenshot).

The direction is set inline (<span>) and not on a block (<p> or <div>). For scenarios that you've described, it would make more sense to set direction and not alignment. The alignment would be set automatically according to the direction.

It's true that it's available in common word processors like Microsoft Word and Google Docs, but are they actually used there frequently? And what semantic roles can they have in wikis?

I am not saying that there are no such semantic roles. There probably are. For example, you could display quotations from books or section summaries like this. It's often convenient to align numbers to the right, especially in tables. To actually do such things now, there is no wikitext, and Visual Editor buttons usually map to wikitext constructs and not to HTML (the language button is an exception to that, and I'm not so happy about it). It's possible to define alignment on wiki pages today, but you have to do it with actual HTML and CSS, and it's often wrapped in a template. The template is often the thing that makes the content semantic, at least in how the editors perceive it.

So I would first think of specific semantic scenarios where a different alignment would be needed, and then think about adding them to the toolbar.

(To clarify: The comment above is just my thinking about it, and it's based on my editing experience in wikis and in word processors. I'm not a decision-maker when it comes to Visual Editor. I'll leave more professional comments to real designers and product managers.)

I use them frequently on word and needs them on the VE as well.
The senario is common on the further reading section when recommending materials in two languages.

I use them frequently on word and needs them on the VE as well.
The senario is common on the further reading section when recommending materials in two languages.

This is indeed often necessary when writing in Hebrew (or another RTL language) and having to quote something in English (or another LTR language). But what you actually need to change is language and direction and not alignment. Even in Microsoft Word it's incorrect to use the alignment button for this, and you should use the direction button instead. It looks like ¶▶. You can also use the the left-hand Ctrl-Shift keys on the keyboard as a shortcut.

In the Hebrew Wikipedia, there's the {{ltr}} template for this for general text. I wish it was integrated directly into Visual Editor as a toolbar button, but it currently isn't. For references, there's something more structured that Eran worked on in wikitext, but I don't think it's properly integrated with Visual Editor, and it definitely should be. Eran, you probably know what I am talking about, can you please remind us what's the status of that?

Actually the best solution might be to creat a ribbon bottom that offers you the two options relating to multi language editing.

Ref supports dir parameter since T15673 but we didn't expose it to VE

Ref supports dir parameter since T15673 but we didn't expose it to VE

Is there a task for that? There should be.

Winston_Sung moved this task from Vertical writing to RTL on the I18n board.