mirror of
https://gitlab.com/timvisee/send.git
synced 2024-11-10 05:02:45 +01:00
renamed localization ctx global to reduce the chance of collision (seen in sentry)
This commit is contained in:
parent
a78150b7ad
commit
a777a808ee
@ -38,14 +38,14 @@ module.exports = \`
|
||||
if (typeof window === 'undefined') {
|
||||
var fluent = require('fluent');
|
||||
}
|
||||
var ctx = new fluent.MessageContext('${locale}', {useIsolating: false});
|
||||
ctx._messages = new Map(${toJSON(merged)});
|
||||
var fluentContext = new fluent.MessageContext('${locale}', {useIsolating: false});
|
||||
fluentContext._messages = new Map(${toJSON(merged)});
|
||||
function translate(id, data) {
|
||||
var msg = ctx.getMessage(id);
|
||||
var msg = fluentContext.getMessage(id);
|
||||
if (typeof(msg) !== 'string' && !msg.val && msg.attrs) {
|
||||
msg = msg.attrs.title || msg.attrs.alt
|
||||
}
|
||||
return ctx.format(msg, data);
|
||||
return fluentContext.format(msg, data);
|
||||
}
|
||||
if (typeof window === 'undefined') {
|
||||
module.exports = translate;
|
||||
|
Loading…
Reference in New Issue
Block a user