API Reference
Advanced Tutorials
Comparison
FAQ
Contributing
Testing
Migration Guide
Licence
This is documentation for Refine 3.xx.xx, which is no longer actively maintained.
For up-to-date documentation, see the latest version (4.xx.xx).
Version: 3.xx.xx
useTranslate
If you need to translate the texts in your own components, refine provides the useTranslate
hook, It returns the translate method from i18nProvider
under the hood.
Usage
You can use the features of your own i18n library for translation in your own components.
import { useTranslate } from "@pankod/refine-core";
export const MyComponent = () => {
const translate = useTranslate();
return <button>{translate("my.translate.text")}</button>;
};
CAUTION
This hook can only be used if i18nProvider
is provided.
Was this helpful?