mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-27 02:46:15 -04:00
Move locale detection to the client
* l10n.js is doing locale detection already, so we shouldn't interfere but help it do its job * this should also fix the ?lang embed parameter * Set language from cookie on page init for l10n to load the right translation
This commit is contained in:
parent
ffb7cf47f2
commit
f5563ab704
4 changed files with 29 additions and 13 deletions
|
@ -33,7 +33,7 @@
|
|||
<meta name="robots" content="noindex, nofollow">
|
||||
<link rel="shortcut icon" href="<%=settings.favicon%>">
|
||||
<script type="text/javascript" src="../../static/js/l10n.js"></script>
|
||||
<link rel="resource" type="application/l10n" href="../../locale.ini" />
|
||||
<link rel="resource" type="application/l10n" href="../../locales.ini" />
|
||||
<link rel="stylesheet" href="../../static/css/pad.css">
|
||||
<link rel="stylesheet" href="../../static/css/timeslider.css">
|
||||
<link rel="stylesheet" href="../../static/custom/timeslider.css">
|
||||
|
@ -184,6 +184,9 @@
|
|||
var clientVars = {};
|
||||
|
||||
(function () {
|
||||
// Set language for l10n
|
||||
var language = document.cookie.match(/language=(\w{2})/);
|
||||
document.documentElement.lang = language? language[1] : 'en';
|
||||
|
||||
var pathComponents = location.pathname.split('/');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue