Custom component internationalization
// ...
import { useTranslations } from "adminjs"
// ...
const CustomComponent = (props) => {
const {translateComponent} = useTranslations()
return <div> {translateComponent('CustomComponent.textToTranslate')} </div>
}const options = {
// ...
locale: {
translations: {
en: {
components: {
CustomComponent: {
textToTranslate: 'This is text to translate'
}
}
}
}
}
// ...
}Last updated