Skip to content

using next-translate in Const #667

Answered by vspirandeli
vahidtakro asked this question in Q&A
Discussion options

You must be logged in to vote

Hello vahidtakro. I use something loke this:
js file:
const headerNavLinks = [ { href: '/blog', title: 'namespace:homepage' } ]

  • Note that namespace should be your translate namespacefile.
    and on page you can use:

`
import useTranslation from 'next-translate/useTranslation';
......

const { t } = useTranslation();
...
{headerNavLinks.map((link) => (

{t(link.title)} .... `

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by aralroca
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #656 on August 20, 2021 15:57.