Skip to content

useTranslator

@astryxdesign/core v0.7.1 · useTranslator

Returns ​

NameTypeDescription
t(key: string, values?: Record<string, string | number>) => stringA translator function bound to the current InternationalizationProvider context. Call it with a message key and optional placeholder values to get the formatted string in the active locale. The function itself stays the same for the life of the component; every call reads the provider, so it is safe to use in render, event handlers, watchers, or any code that runs during the component's lifecycle.