You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
locale in .getCompiledData() should default to fallback locale, but following adds store['undefined']:
var BabelFish = require('babelfish');
var i18n = new BabelFish('ru');
i18n.addPhrase('ru', 'i', 'я');
console.dir(i18n.getCompiledData());
console.dir(i18n._storage);
Please, write a more essential test, what will be broken in real life.
Something test-like in first-message already. I'd like to help in other way, but currently have no time to dig into internals, sorry. Maybe later, doesn't seem so critical anyway.
Nothing will break, just feels odd. As far as I can see, such call results in compiling phrases for fallbackLocale and writing result to _storage['undefined'] returned by getLocaleStorage(this, undefined). Now we have two disctinct objects with same data (_storage[fallbackLocale] and storage['undefined'], latter just lives there and probably never going to be used / GC'ed), memory wasted.
getCompiledData() MUST have locale param (the first one).
Throw then? (It's done in addPhrase and other places, so I guess there is no policy against exceptions.)
locale
in.getCompiledData()
should default to fallback locale, but following addsstore['undefined']
:Outputs:
The text was updated successfully, but these errors were encountered: