1e62aa976d
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)
18 lines
454 B
JavaScript
18 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>
|
|
`
|
|
: '';
|
|
};
|