From 1ea61e3650e43d5fd5d1bc530f83914d6a051166 Mon Sep 17 00:00:00 2001 From: andrewblond Date: Wed, 19 Aug 2015 18:11:01 +0300 Subject: [PATCH 1/2] Fixed provide i18n to BEM.I18N --- techs/i18n.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/techs/i18n.js b/techs/i18n.js index e31d5fc..634e956 100644 --- a/techs/i18n.js +++ b/techs/i18n.js @@ -100,8 +100,8 @@ module.exports = require('enb/lib/build-flow').create() '', globals && [ ' if (defineAsGlobal) {', - ' global.BEM || (global.BEM = {});', - ' global.BEM.I18N = __i18n__;', + ' var __bem__ = (typeof BEM !== \'undefined\') ? BEM : (global.BEM || {});', + ' __bem__.I18N = __i18n__;', ' }' ].join(EOL), '})(this);' From 9d96b30e41636ee6087ecb1a2830d01475dc15d5 Mon Sep 17 00:00:00 2001 From: andrewblond Date: Wed, 19 Aug 2015 18:19:11 +0300 Subject: [PATCH 2/2] fix --- techs/i18n.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/techs/i18n.js b/techs/i18n.js index 634e956..9fc4524 100644 --- a/techs/i18n.js +++ b/techs/i18n.js @@ -100,8 +100,11 @@ module.exports = require('enb/lib/build-flow').create() '', globals && [ ' if (defineAsGlobal) {', - ' var __bem__ = (typeof BEM !== \'undefined\') ? BEM : (global.BEM || {});', + ' var __bem__ = (typeof BEM !== \'undefined\') ? BEM : {};', ' __bem__.I18N = __i18n__;', + '', + ' global.BEM || (global.BEM = {});', + ' global.BEM.I18N = __i18n__;', ' }' ].join(EOL), '})(this);'