@react-aria/i18n
Version:
Spectrum UI components in React
13 lines (12 loc) • 568 B
TypeScript
import { LocalizedStrings } from '@internationalized/message';
export type FormatMessage = (key: string, variables?: {
[key: string]: any;
}) => string;
/**
* Handles formatting ICU Message strings to create localized strings for the current locale.
* Automatically updates when the locale changes, and handles caching of messages for performance.
*
* @deprecated - use useLocalizedStringFormatter instead.
* @param strings - A mapping of languages to strings by key.
*/
export declare function useMessageFormatter(strings: LocalizedStrings): FormatMessage;