"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.translate = translate;
var _utils = require("@grozav/utils");
var _i18n = require("@inkline/inkline/i18n");
var _utils2 = require("@inkline/inkline/utils");
function translate(path, scope = {}) {
  const template = (0, _utils.getValueByPath)(_i18n.i18n.messages[_i18n.i18n.locale], path);
  const string = ((0, _utils.isFunction)(template) ? template(scope) : template) || path;
  return (0, _utils2.interpolate)(string, scope);
}