Skip to content

Instantly share code, notes, and snippets.

@fwojciec
Created September 3, 2019 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fwojciec/e060aec1861dccc528806ab5e2551282 to your computer and use it in GitHub Desktop.
Save fwojciec/e060aec1861dccc528806ab5e2551282 to your computer and use it in GitHub Desktop.
How to build a multilingual website in Next.js #9
// components/Artist.tsx
import React from 'react'
import useTranslation from '../hooks/useTranslation'
const Artist: React.FC = () => {
const { locale, t } = useTranslation()
return (
<div>
<h1>René Magritte</h1>
<img src="/static/img/magritte.jpg" alt="Rene Magritte" />
<p>{t('bio')}</p>
<a href={`http://${locale}.wikipedia.org/wiki/René_Magritte`}>{t('readMore')}</a>
</div>
)
}
export default Artist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment