Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Commit

Permalink
this is a start for #29
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Nov 2, 2014
1 parent 3c455d3 commit 50bcc24
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 10 additions & 0 deletions src/js/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 50bcc24

Please sign in to comment.