12

We need right-to-left layout, at least for messages, in our chat room: http://chat.stackoverflow.com/rooms/418/persian. How to achieve that?

  • You couldn't elaborate more? In nearly eight years nothing has changed? – Mari-Lou A Apr 15 '18 at 12:00
7

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

  • 1
    Is it planned? BTW showing RTL text is a matter of setting dir="rtl" on parent element (e.g. 'div' or 'p'). – Ebrahim Mohammadi Dec 22 '10 at 19:17
  • Localization is planned but no date has been established, yet. I added that to my post. – Robert Cartaino Dec 22 '10 at 19:57
  • 5
    7.5 years later, any update? – ShaWiz Apr 10 '18 at 13:45
  • @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. – Robert Cartaino Apr 10 '18 at 14:46
  • Thanks. But with this new SO for Teams project, isn't there any RTL support planned? – ShaWiz Apr 10 '18 at 15:25
  • @ShadowWizard I don't know. Maybe ask in meta? – Robert Cartaino Apr 10 '18 at 15:28
  • Good idea @Robert, might do it. Thanks! :) – ShaWiz Apr 10 '18 at 15:30
5

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. – Ebrahim Mohammadi Dec 23 '10 at 13:46
4

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
    What about '42'? – juan Dec 22 '10 at 21:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .