diff --git a/src/css/common.css b/src/css/common.css index bb32d3b..8b5aab0 100644 --- a/src/css/common.css +++ b/src/css/common.css @@ -43,6 +43,13 @@ display: inline-block; } +html { + direction: ltr; + } +html.rtl { + direction: rtl; + } + /* http://stackoverflow.com/questions/2011142/how-to-change-the-style-of-title-attribute-inside-the-anchor-tag?answertab=votes */ *[data-tip] { position: relative; diff --git a/src/js/i18n.js b/src/js/i18n.js index 0774548..c070b20 100644 --- a/src/js/i18n.js +++ b/src/js/i18n.js @@ -23,6 +23,16 @@ // jQuery must be present at this point. window.addEventListener('load', function() { + // http://en.wikipedia.org/wiki/Right-to-left + var rtlLanguages = { + 'ar': true, + 'fa': true, + 'he': true + }; + if ( rtlLanguages[navigator.language] ) { + uDom('html').addClass('rtl'); + } + var nodeList = document.querySelectorAll('[data-i18n]'); var i = nodeList.length; var node;