Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): Changed type of options in translate function of i18nProvider #5869

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions documentation/docs/guides-concepts/i18n/index.md
Expand Up @@ -131,13 +131,15 @@ import type { I18nProvider } from "@refinedev/core";
import { Refine } from "@refinedev/core";
// highlight-next-line
import { useTranslation } from "react-i18next";
// highlight-next-line
import { $Dictionary } from "i18next/typescript/helpers";

const App: React.FC = () => {
// highlight-start
const { t, i18n } = useTranslation();

const i18nProvider: I18nProvider = {
translate: (key: string, options?: any) => t(key, options),
translate: (key: string, options?: $Dictionary<unknown>) => t(key, options),
changeLocale: (lang: string) => i18n.changeLanguage(lang),
getLocale: () => i18n.language,
};
Expand Down Expand Up @@ -276,6 +278,7 @@ import { Refine, Resource } from "@refinedev/core";
import { ThemedLayoutV2 } from "@refinedev/antd";

import { useTranslation } from "react-i18next";
import { $Dictionary } from "i18next/typescript/helpers";

import "./i18n";

Expand All @@ -286,7 +289,7 @@ const App: React.FC = () => {
const { t, i18n } = useTranslation();

const i18nProvider = {
translate: (key: string, options?: any) => t(key, options),
translate: (key: string, options?: $Dictionary<unknown>) => t(key, options),
changeLocale: (lang: string) => i18n.changeLanguage(lang),
getLocale: () => i18n.language,
};
Expand Down