MCPcopy
hub / github.com/OpenCoworkAI/open-codesign / useT

Function useT

packages/i18n/src/index.ts:117–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

115}
116
117export function useT(): (key: string, options?: Record<string, unknown>) => string {
118 const { t, i18n } = useTranslation();
119 // Memoize keyed on the active language so that `useEffect` dependency
120 // arrays holding this function only re-run when the locale actually
121 // changes, not on every render (react-i18next's `t` identity is not
122 // stable across renders).
123 // biome-ignore lint/correctness/useExhaustiveDependencies: identity must track locale, not `t`.
124 return useCallback((key, options) => t(key, options ?? {}) as string, [i18n.language]);
125}
126
127export { useTranslation } from 'react-i18next';
128export { i18next as i18n };

Callers 15

AppFunction · 0.90
ToastItemFunction · 0.90
PreviewPaneFunction · 0.90
DeleteDesignDialogFunction · 0.90
AskModalFunction · 0.90
FileFieldFunction · 0.90
TopBarFunction · 0.90
ErrorBoundaryFallbackFunction · 0.90
ChatgptLoginCardFunction · 0.90
SettingsFunction · 0.90
UpdateBannerFunction · 0.90
DesignsViewFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected