Closed vahidtakro closed 3 years ago
@vahidtakro Ideally, the siteMetadata should be a namespace (locales/en/siteMetadata.json
, locales/es/siteMetadata.json
, etc.), so instead of using the object to access the value with:
return <div>siteMetadata.comment.provider</div>
you can do this:
const { t } = useTranslation('siteMetadata') // which namespace
// ...
return <div>t('comment.provider')</div>
hello, i'm getting my pages main info from a file called siteMetadata, how can I use next-translate to translate the value of each string in the file? this is the file: