pad.libre-service.eu-etherpad/src/static/js/l10n.js

15 lines
461 B
JavaScript
Raw Normal View History

2020-11-23 19:24:19 +01:00
(function (document) {
2012-12-16 18:52:39 +01:00
// Set language for l10n
2020-11-23 19:24:19 +01:00
let language = document.cookie.match(/language=((\w{2,3})(-\w+)?)/);
if (language) language = language[1];
2020-11-23 19:24:19 +01:00
html10n.bind('indexed', () => {
html10n.localize([language, navigator.language, navigator.userLanguage, 'en']);
});
2020-11-23 19:24:19 +01:00
html10n.bind('localized', () => {
document.documentElement.lang = html10n.getLanguage();
document.documentElement.dir = html10n.getDirection();
});
})(document);