From a777a808eea1bb1d7cd4bd714d5c1f89fd48bca5 Mon Sep 17 00:00:00 2001 From: Danny Coates Date: Wed, 7 Feb 2018 19:18:11 -0800 Subject: [PATCH] renamed localization ctx global to reduce the chance of collision (seen in sentry) --- build/fluent_loader.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/fluent_loader.js b/build/fluent_loader.js index 26d6ee56..a1919877 100644 --- a/build/fluent_loader.js +++ b/build/fluent_loader.js @@ -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;