Bug 1876099 Comment 2 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Greg Tatum [:gregtatum] from comment #1)
> The work here is to detect if the language change also affects the directionality. If it does, then we should change the `element.style.direction` of the block element.

In a perfect world I would have wanted the translation engine to swap the website UI itself to RTL along with the text being translated, but alas, I think this is almost impossible to cater for every possible scenario, and there are many.
Since that's out of the question, when changing the direction of the element you also align it to the right, and this would not look food on all websites or UI layouts.
So additionally, I think something like `text-align: match-parent` would also be needed, to let the text (in the LTR->RTL case) be aligned to the left still, even though that's not "correct" for RTL users (or LTR users, for the RTL-LTR case). Having text being readable is more important than having it aligned to the correct side, I think.
Of course, this isn't a perfect solution for all cases, since I can assume there would be contexts where the parent's text alignment is not the same as the child, but I'm guessing this is a minor enough issue to let it slide.
(In reply to Greg Tatum [:gregtatum] from comment #1)
> The work here is to detect if the language change also affects the directionality. If it does, then we should change the `element.style.direction` of the block element.

In a perfect world I would have wanted the translation engine to swap the website UI itself to RTL along with the text being translated, but alas, I think this is almost impossible to cater for every possible scenario, and there are many.
Since that's out of the question, when changing the direction of the element you inherently also align it to the right (for the RTL->LTR case), and this would not look food on all websites or UI layouts.
So additionally, I think something like `text-align: match-parent` would also be needed, to let the text (in the LTR->RTL case) be aligned to the left still, even though that's not "correct" for RTL users (or LTR users, for the RTL-LTR case). Having text being readable is more important than having it aligned to the correct side, I think.
Of course, this isn't a perfect solution for all cases, since I can assume there would be contexts where the parent's text alignment is not the same as the child, but I'm guessing this is a minor enough issue to let it slide.

Back to Bug 1876099 Comment 2