@hashicorp/design-system-components
Version:
Helios Design System Components
26 lines (22 loc) • 734 B
JavaScript
import Helper from '@ember/component/helper';
import { service } from '@ember/service';
import { assert } from '@ember/debug';
import { isPresent } from '@ember/utils';
import { g, i } from 'decorator-transforms/runtime';
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
class HdsTHelper extends Helper {
static {
g(this.prototype, "hdsIntl", [service]);
}
#hdsIntl = (i(this, "hdsIntl"), void 0);
compute(positional, named) {
const key = positional[0];
assert('Hds::T helper requires a key as the first positional argument', typeof key === 'string' && isPresent(key));
return this.hdsIntl.t(key, named);
}
}
export { HdsTHelper as default };
//# sourceMappingURL=hds-t.js.map