Merge pull request #1177 from marcelklehr/fix/optimize-l10n-loading-times
optimize l10n loading times
This commit is contained in:
commit
d6c0f96084
|
@ -1,4 +1,4 @@
|
||||||
[en]
|
[*]
|
||||||
index.newPad = New Pad
|
index.newPad = New Pad
|
||||||
index.createOpenPad = or create/open a Pad with the name:
|
index.createOpenPad = or create/open a Pad with the name:
|
||||||
pad.toolbar.bold.title = Bold (Ctrl-B)
|
pad.toolbar.bold.title = Bold (Ctrl-B)
|
||||||
|
|
|
@ -5,7 +5,9 @@ var Globalize = require('globalize')
|
||||||
|
|
||||||
var localesPath = __dirname+"/../../locales";
|
var localesPath = __dirname+"/../../locales";
|
||||||
|
|
||||||
var localeIndex = '[*]\r\n@import url(locales/en.ini)\r\n';
|
// Serve English strings directly with /locales.ini
|
||||||
|
var localeIndex = fs.readFileSync(localesPath+'/en.ini')+'\r\n';
|
||||||
|
|
||||||
exports.availableLangs = {en: 'English'};
|
exports.availableLangs = {en: 'English'};
|
||||||
|
|
||||||
fs.readdir(localesPath, function(er, files) {
|
fs.readdir(localesPath, function(er, files) {
|
||||||
|
|
|
@ -34,6 +34,15 @@
|
||||||
<link rel="resource" type="application/l10n" href="locales.ini" />
|
<link rel="resource" type="application/l10n" href="locales.ini" />
|
||||||
<link rel="shortcut icon" href="<%=settings.favicon%>">
|
<link rel="shortcut icon" href="<%=settings.favicon%>">
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
(function(document) {
|
||||||
|
// Set language for l10n
|
||||||
|
var language = document.cookie.match(/language=(\w{2})/);
|
||||||
|
if(language) document.documentElement.lang = language[1];
|
||||||
|
})(document)
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="static/js/l10n.js" async></script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
html, body {
|
html, body {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -184,14 +193,7 @@
|
||||||
return randomstring;
|
return randomstring;
|
||||||
}
|
}
|
||||||
|
|
||||||
(function(document) {
|
|
||||||
// Set language for l10n
|
|
||||||
var language = document.cookie.match(/language=(\w{2})/);
|
|
||||||
if(language) document.documentElement.lang = language[1];
|
|
||||||
})(document)
|
|
||||||
|
|
||||||
// start the custom js
|
// start the custom js
|
||||||
if (typeof customStart == "function") customStart();
|
if (typeof customStart == "function") customStart();
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="static/js/l10n.js"></script>
|
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -32,11 +32,17 @@
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="robots" content="noindex, nofollow">
|
<meta name="robots" content="noindex, nofollow">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
|
||||||
|
<link rel="shortcut icon" href="<%=settings.favicon%>">
|
||||||
|
|
||||||
<link rel="resource" type="application/l10n" href="../locales.ini" />
|
<link rel="resource" type="application/l10n" href="../locales.ini" />
|
||||||
|
<script type="text/javascript">
|
||||||
|
(function() {
|
||||||
<link rel="shortcut icon" href="<%=settings.favicon%>">
|
// Set language for l10n
|
||||||
|
var language = document.cookie.match(/language=(\w{2})/);
|
||||||
|
if(language) document.documentElement.lang = language[1];
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="../static/js/l10n.js" async></script>
|
||||||
|
|
||||||
<% e.begin_block("styles"); %>
|
<% e.begin_block("styles"); %>
|
||||||
<link href="../static/css/pad.css" rel="stylesheet">
|
<link href="../static/css/pad.css" rel="stylesheet">
|
||||||
|
@ -381,14 +387,9 @@
|
||||||
// call original error handler
|
// call original error handler
|
||||||
if(typeof(originalHandler) == 'function') originalHandler.call(null, arguments);
|
if(typeof(originalHandler) == 'function') originalHandler.call(null, arguments);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Set language for l10n
|
|
||||||
var language = document.cookie.match(/language=(\w{2})/);
|
|
||||||
if(language) document.documentElement.lang = language[1];
|
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/javascript" src="../static/js/l10n.js"></script>
|
|
||||||
<script type="text/javascript" src="../static/js/require-kernel.js"></script>
|
<script type="text/javascript" src="../static/js/require-kernel.js"></script>
|
||||||
<script type="text/javascript" src="../socket.io/socket.io.js"></script>
|
<script type="text/javascript" src="../socket.io/socket.io.js"></script>
|
||||||
|
|
||||||
|
|
|
@ -32,8 +32,16 @@
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="robots" content="noindex, nofollow">
|
<meta name="robots" content="noindex, nofollow">
|
||||||
<link rel="shortcut icon" href="<%=settings.favicon%>">
|
<link rel="shortcut icon" href="<%=settings.favicon%>">
|
||||||
<script type="text/javascript" src="../../static/js/l10n.js"></script>
|
|
||||||
<link rel="resource" type="application/l10n" href="../../locales.ini" />
|
<link rel="resource" type="application/l10n" href="../../locales.ini" />
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
(function() {
|
||||||
|
// Set language for l10n
|
||||||
|
var language = document.cookie.match(/language=(\w{2})/);
|
||||||
|
if(language) document.documentElement.lang = language[1];
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="../../static/js/l10n.js" async></script>
|
||||||
<link rel="stylesheet" href="../../static/css/pad.css">
|
<link rel="stylesheet" href="../../static/css/pad.css">
|
||||||
<link rel="stylesheet" href="../../static/css/timeslider.css">
|
<link rel="stylesheet" href="../../static/css/timeslider.css">
|
||||||
<link rel="stylesheet" href="../../static/custom/timeslider.css">
|
<link rel="stylesheet" href="../../static/custom/timeslider.css">
|
||||||
|
@ -169,15 +177,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
(function() {
|
|
||||||
// Set language for l10n
|
|
||||||
var language = document.cookie.match(/language=(\w{2})/);
|
|
||||||
if(language) document.documentElement.lang = language[1];
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="../../static/js/l10n.js"></script>
|
|
||||||
<script type="text/javascript" src="../../static/js/require-kernel.js"></script>
|
<script type="text/javascript" src="../../static/js/require-kernel.js"></script>
|
||||||
<script type="text/javascript" src="../../socket.io/socket.io.js"></script>
|
<script type="text/javascript" src="../../socket.io/socket.io.js"></script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue