Guide
MultipleLanguages

MultipleLanguage

Usage

import { useTranslations } from "next-intl";
 
export default function MyClientComponent() {
  const t = useTranslations();
 
  return <div>{t("hello")}</div>;
}

Translations

Translations are defined in the src/translations folder. The default locale is en and the translations are stored in en.json.

Add a new locale

  1. next.config.js add Language
  2. LanguageSwitcher add Language (LANGUAGES)
  3. To add a new locale you need to create a new file in the src/translations eg: fr.json for French.
{
  "hello": "Bonjour le monde!"
}