From b2ef1bd9e1575b6351a77da7c0c867636fcfdb6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Vanvelthem?= Date: Mon, 12 Dec 2022 10:09:16 +0100 Subject: [PATCH] fix: align with nextjs i18n config types (#2057) * fix: align with nextjs i18n config types * docs: changelog * feat: add domains too --- CHANGELOG.md | 6 ++++++ src/types.ts | 15 +++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51d2ecbc..64db172a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 13.0.1 + +### Fix + +- Fix missing `i18n.localeDetection` in UserConfig, see [#2057](https://github.com/i18next/next-i18next/pull/2057). + ## 13.0.0 The v13.0.0 release is a major version to improve stability and general experience. diff --git a/src/types.ts b/src/types.ts index 90ba1efe..4c37b4a3 100644 --- a/src/types.ts +++ b/src/types.ts @@ -15,9 +15,20 @@ import { } from 'i18next' import { appWithTranslation, i18n } from './' +/** + * Inlined from `import('next').NextConfig.i18n` v13.0.6. As we support + * multiple nextjs versions it's safer to inline and keep it up-to-date. + */ type NextJsI18NConfig = { - defaultLocale: string - locales: string[] + defaultLocale: string; + domains?: { + defaultLocale: string; + domain: string; + http?: true; + locales?: string[]; + }[]; + localeDetection?: false; + locales: string[]; } export type UserConfig = {