You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 27, 2018. It is now read-only.
Fairly niche use case (and I don't expect anyone to be crazy enough to implement it other than me), but useful to enable international use: detect Hebrew and Arabic text input and then style the display so that those text fields are aligned right.
Rough idea how to implement this:
Take the string, use the .mb_chars method that Rails mixes into strings, then check to see that whether 50% of the characters or more are in any of the following ranges:
Hebrew - U+05D0 to U+05EA, U+05F0 to U+05F2, U+05BE, U+05C0, U+05C3, U+05F3, U+05F4, U+05B0 to U+05C4, U+0591 to U+05AF.
Arabic - U+0600 to U+06FF, U+0750 to U+077F, U+FB50 to U+FDFF, U+FE70 to U+FEFF, U+10E60 to U+10E7F.
If so, set a flag on the text that makes it so it is displayed with a dir attribute set to "rtl". Style appropriately.
The text was updated successfully, but these errors were encountered:
Fairly niche use case (and I don't expect anyone to be crazy enough to implement it other than me), but useful to enable international use: detect Hebrew and Arabic text input and then style the display so that those text fields are aligned right.
Rough idea how to implement this:
Take the string, use the .mb_chars method that Rails mixes into strings, then check to see that whether 50% of the characters or more are in any of the following ranges:
Hebrew - U+05D0 to U+05EA, U+05F0 to U+05F2, U+05BE, U+05C0, U+05C3, U+05F3, U+05F4, U+05B0 to U+05C4, U+0591 to U+05AF.
Arabic - U+0600 to U+06FF, U+0750 to U+077F, U+FB50 to U+FDFF, U+FE70 to U+FEFF, U+10E60 to U+10E7F.
If so, set a flag on the text that makes it so it is displayed with a dir attribute set to "rtl". Style appropriately.
The text was updated successfully, but these errors were encountered: