enb / enb-bem-tmpl-specs

BEM template specs for ENB
Other
15 stars 11 forks source link

mockI18N option #110

Closed blond closed 9 years ago

blond commented 9 years ago

After unification of i18n mock for different core (block i18n or i-bem__i18n) will have to rewrite the HTML-references in your project.

To upgrade to the new version of this package was easier need add the ability to override the mock of i18n.

mockI18N: function(global, bem_) {
    global.BEM = bem_;

    var i18n = bem_.I18N = function(keyset, key, param) {
        var result = key;
        if(param){
            result += ": " + JSON.stringify(param);
        }
        return result;
    };

    i18n.keyset = function() { return i18n; };
    i18n.key = function(key) { return key; };
    i18n.lang = function() { return; };
}