summaryrefslogtreecommitdiff
path: root/src/static/js/l10n.js
blob: a67a7c1a4461f9afc0be8ba9be0830038a830c74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
(function(document) {
  // Set language for l10n
  var language = document.cookie.match(/language=((\w{2,3})(-w+)?)/);
  if(language) language = language[1];
  
  html10n.bind('indexed', function() {
    html10n.localize([language, navigator.language, navigator.userLanguage, 'en'])
  })
  
  html10n.bind('localized', function() {
    document.documentElement.lang = html10n.getLanguage()
    document.documentElement.dir = html10n.getDirection()
  })
})(document)