@react-native-localize-ext/core
Version:
make i18n in react-native much smoother
26 lines (25 loc) • 861 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.I18nPolyfill = void 0;
const I18n_1 = require("./I18n");
class I18nPolyfill extends I18n_1.I18n {
createProxy(data, allProperties, useDefaultLocal) {
const proxyData = {};
let toDefineProperty = { ...data };
if (!useDefaultLocal) {
toDefineProperty = {
...toDefineProperty,
...this.recursiveDefaultData(allProperties),
};
}
Object.keys(toDefineProperty).forEach((property) => {
Object.defineProperty(proxyData, property, {
get: () => {
return this.getProxyData(data, allProperties, property, useDefaultLocal);
},
});
});
return proxyData;
}
}
exports.I18nPolyfill = I18nPolyfill;