We need right-to-left layout, at least for messages, in our chat room: https://chat.stackoverflow.com/rooms/418/persian. How to achieve that?
3 Answers
The Stack Exchange sites (including the chat rooms) do not yet support localization. There is no way to set up a site or a chat room to properly display Persian text. Localization is planned but no date has been established, yet
-
1Is it planned? BTW showing RTL text is a matter of setting dir="rtl" on parent element (e.g. 'div' or 'p'). Commented Dec 22, 2010 at 19:17
-
Localization is planned but no date has been established, yet. I added that to my post. Commented Dec 22, 2010 at 19:57
-
5
-
@ShadowWizard Don't know. It's been about 1-1/2 years since renewed Q&A development has been just around the corner, so I have to back away from this and let someone more in-the-know answer. Commented Apr 10, 2018 at 14:46
-
Thanks. But with this new SO for Teams project, isn't there any RTL support planned? Commented Apr 10, 2018 at 15:25
-
-
This is probably a hack, but this script changes Farsi looking lines to right-to-left alignment:
$('div.content').filter(':not(.gmRTLOldMessage)').addClass('gmRTLOldMessage')
.filter(function(){
var div = $(this);
var text = div.text();
var rtlLetter = text.replace(/[^\u0590-\u05FF\u0600-\u06FF\uFB50-\uFDFF\u2000-\u206F]+/g,'');
var neutral = text.replace(/[^\s\d.,()!?\-+*\/\\]+/g, '');
return rtlLetter.length > (text.length - neutral.length) / 2;
}).css('direction','rtl');
$('.monologue .timestamp').css('margin-left','5px');
Needs some tweaking.
Here's a user script which runs that every second, it seems to be working:
http://userscripts.org/scripts/show/93396
-
Thanks! Currently My Greasemonkey is not working on Firefox 4.0b8. I'll check it later. Commented Dec 23, 2010 at 13:46
As a side note to Robert's reply... while chat is a bit more relaxed than SO, there are some obvious babel problems (in particular with moderation) of too many languages. Chat, however, serves also a social function (in addition to technical content), so I think we need to continue playing this "by ear" for now. I honestly don't know what the full answer is here - it isn't a simple one.
But to repeat Robert's point; we don't have current support for that right now.
-
2