translate-maker
Version:
Lightweight translation module. Internationalize your great project.
16 lines (11 loc) • 360 B
JavaScript
import set from 'lodash/set';
import forEach from 'lodash/forEach';
export default function as(value, part, attrs, metadata, ...args) {
const params = {};
forEach(args, (param) => {
const { from, to } = param;
const paramValue = this.resolveValue(from, attrs);
set(params, to, paramValue);
});
return this.resolveValue(part, params);
}