detecting right to left layout

90 views
Skip to first unread message

Chrome786

unread,
Jan 10, 2011, 5:46:43 PM1/10/11
to Chromium-extensions
Hi,
 
I am trying to detect right to left layout thorugh chrome extension. When I install Chrome for Arabic or any other language which has a RTL layout, my extension UI remain LTR layout. Is there any way to detect RTL layout?
 
Thanks,
Syed

Mohamed Mansour

unread,
Jan 10, 2011, 6:47:06 PM1/10/11
to Chrome786, Chromium-extensions
Hi Syed,

Chrome extensions has neat internationalization support. There are BIDI (bi-directional) messages that you can use:

For example, to properly use  the correct LTR/RTL layout, you can do the following:

document.body.dir = chrome.i18n.getMessage('@@bidi_dir');

If you want to do it in CSS, then you can do the following:

body {
  direction: __MSG_@@bidi_dir__;
}

I noticed a bug on the documentation, I will submit a patch to fix it.

Kind regards,
Mohamed Mansour



--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.

Chrome786

unread,
Jan 10, 2011, 7:31:21 PM1/10/11
to Mohamed Mansour, Chromium-extensions
Thanks Mansour for your tip.
 
Regards,
-Syed

Reply all
Reply to author
Forward
0 new messages