direction icon indicating copy to clipboard operation
direction copied to clipboard

Getting wrong text direction when having a mix of languages

Open HamzaLJ opened this issue 8 years ago • 1 comments

I have a text where I have a mix of 2 languages. For example: test זהו סעיף בעברית.

זהו סעיף בעברית alone is RTL and test alone is LTR. However when having : test זהו סעיף בעברית I get LTR.

I believe it's a bug somehow or a feature to add as I think it should know in percentage how much RTL exists over LTR in a text then format it correctly.

HamzaLJ avatar Feb 03 '18 12:02 HamzaLJ

The algorithm checks the first character that is either LTR or RTL. If you want percentages, create your own algorithm on top of direction.

wooorm avatar Feb 03 '18 12:02 wooorm