i18next / next-app-dir-i18next-example-ts

Next.js 13/14 app directory feature in combination with i18next
https://locize.com/blog/next-app-dir-i18n/
124 stars 30 forks source link

Client translation #2

Open yersultanur opened 1 year ago

yersultanur commented 1 year ago

🐛 Bug Report

A clear and concise description of what the bug is. Type instantiation is excessively deep and possibly infinite.

To Reproduce

when I use client side rendering or index.ts A minimal reproducible example. A codesandbox example or similar or at least steps to reproduce the behavior:

export function useTranslation<
  N extends Namespace,
  TKPrefix extends KeyPrefix<N> = undefined
>(
  lng: string,
  ns?: N | Readonly<N>,
  options?: UseTranslationOptions<TKPrefix>
): UseTranslationResponse<N, TKPrefix> {
  if (i18next.resolvedLanguage !== lng) i18next.changeLanguage(lng)
  return useTranslationOrg(ns, options)
}

Expected behavior

A clear and concise description of what you expected to happen.

// Paste the expected results here

Your Environment

yersultanur commented 1 year ago

image

adrai commented 1 year ago

probably because of https://github.com/i18next/i18next/issues/1921 will be fixed with https://github.com/i18next/i18next/pull/1911