iitc-project / ingress-intel-total-conversion

ingress.com/intel total conversion user script with some new features. Should allow easier extension of the intel map.
http://iitc.jonatkins.com/
ISC License
989 stars 552 forks source link

Language Support for Arabic and Hebrew #1200

Open iAmOren opened 7 years ago

iAmOren commented 7 years ago

Some portal titles are in Arabic or Hebrew. Please add dir support. I'm using: var pdtitle=document.getElementsByClassName("title")[0]; if(pdtitle.textContent.search(/[\u0590-\u06FF]/)>=0) pdtitle.setAttribute("dir","rtl");

I'm not sure where to post this and who and how to tag and who will see this...

Artoria2e5 commented 7 years ago

Is there like a forced ltr style somewhere? Normally the browser will get everything (including mixtures) right...

iAmOren commented 7 years ago

@Artoria2e5 Nothing is forced. LTR is the default.

FesterCluck commented 7 years ago

@iAmOren The property you are looking for is called unicode-bidi. If you are overriding the current direction, you'd most likely want to set it to unicode-bidi: isolate-override;

However, if you can help me identify all the elements where we can possibly have names which need be reversed, then we can go and set unicode-bidi: isolate on all of them and allow the engine to set their direction based on content. Should be a simple pull request, and is much more desirable. The behavior you are seeing is caused by the behavior of most rendering engines to render all content of an element in the same direction based on an algorithm. We might have to insert a couple spans around this sort of data to fix it, but it shouldn't be too difficult.