diff --git a/src/static/js/html10n.js b/src/static/js/html10n.js
index a38f76d78..9c85cd2f8 100644
--- a/src/static/js/html10n.js
+++ b/src/static/js/html10n.js
@@ -804,6 +804,14 @@ window.html10n = (function(window, document, undefined) {
cb(null, build)
})
}
+
+ /**
+ * Returns the language that was last applied to the translations hash
+ * thus overriding most of the formerly applied langs
+ */
+ html10n.getLanguage = function() {
+ this.language
+ }
/**
* Index all s
diff --git a/src/static/js/l10n.js b/src/static/js/l10n.js
new file mode 100644
index 000000000..0bd060fe1
--- /dev/null
+++ b/src/static/js/l10n.js
@@ -0,0 +1,13 @@
+(function(document) {
+ // Set language for l10n
+ var language = document.cookie.match(/language=(\w{2})/);
+ 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)
\ No newline at end of file