MCPcopy
hub / github.com/refinedev/refine / translate

Function translate

packages/core/src/hooks/i18n/useTranslate.ts:22–34  ·  view source on GitHub ↗
(
      key: string,
      options?: string | any,
      defaultMessage?: string,
    )

Source from the content-addressed store, hash-verified

20 function translate(key: string, defaultMessage?: string): string;
21
22 function translate(
23 key: string,
24 options?: string | any,
25 defaultMessage?: string,
26 ) {
27 return (
28 i18nProvider?.translate(key, options, defaultMessage) ??
29 defaultMessage ??
30 (typeof options === "string" && typeof defaultMessage === "undefined"
31 ? options
32 : key)
33 );
34 }
35
36 return translate;
37 }, [i18nProvider]);

Callers 15

DocBreadcrumbsFunction · 0.90
useReadingTimePluralFunction · 0.90
useBlogPostsPluralFunction · 0.90
MessageFunction · 0.85
RegisterPageFunction · 0.85
ForgotPasswordPageFunction · 0.85
LoginPageFunction · 0.85
UpdatePasswordPageFunction · 0.85
ErrorComponentFunction · 0.85
renderTitleFunction · 0.85
renderTitleFunction · 0.85

Calls

no outgoing calls

Tested by 3

TestComponentFunction · 0.68
TestComponentFunction · 0.68
TestComponentFunction · 0.68