UNPKG

@inkline/inkline

Version:

Inkline is the intuitive UI Components library that gives you a developer-friendly foundation for building high-quality, accessible, and customizable Vue.js 3 Design Systems.

14 lines (13 loc) 518 B
"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); }