1
0
mirror of https://gitlab.com/timvisee/send.git synced 2024-09-20 08:01:32 +02:00
send/server/initScript.js
Danny Coates 1e62aa976d reimplemented l10n using dynamic import() (#1012)
this should greatly reduce the complexity of the l10n code
and build pipeline and eliminate the most common error
seen in sentry logs (no translate function)
2018-11-20 09:50:59 -05:00

19 lines
454 B
JavaScript

const html = require('choo/html');
const raw = require('choo/html/raw');
module.exports = function(state) {
// return '';
return state.cspNonce
? html`
<script nonce="${state.cspNonce}">
const LOCALE = '${state.locale}';
const downloadMetadata = ${
state.downloadMetadata
? raw(JSON.stringify(state.downloadMetadata))
: '{}'
};
</script>
`
: '';
};