ember-intl
Version:
Internationalization for Ember projects
15 lines (12 loc) • 361 B
text/typescript
import type { IntlShape } from '@formatjs/intl';
export type FormatMessageParameters = Parameters<
IntlShape<string>['formatMessage']
>;
export function formatMessage(
intlShape: IntlShape,
...[descriptor, parameters]: FormatMessageParameters
): string {
return intlShape.formatMessage(descriptor, parameters, {
ignoreTag: true,
}) as string;
}