Skip to main content
Version: 3.xx.xx


If you need to change the locale at runtime, refine provides the useSetLocale hook, It returns the changeLocale method from i18nProvider under the hood.


You can use the features of your own i18n library to change the locale in your own components.

import { useSetLocale } from "@pankod/refine-core";

export const LanguageSwicher = () => {
const changeLanguage = useSetLocale();

return (
<button onClick={() => changeLanguage("en")}>English</button>
<button onClick={() => changeLanguage("es")}>Spanish</button>

This hook can only be used if i18nProvider is provided.