Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

114
Visualizações
How to add properly react-i18next

I have a problem with the setup of my i18next. There's a warning that says react-i18next:: You will need to pass in an i18next instance by using initReactI18next and if I refresh the page everything turns out as variables' names.

this is my i18n.ts file:

import i18n from 'i18next';
import Backend from 'i18next-http-backend';
import LanguageDetector from 'i18next-browser-languagedetector';
import { initReactI18next } from 'react-i18next';

const backend = new Backend({
  // path where resources get loaded from
  loadPath: '../locales/{{lng}}/{{ns}}.json',
});

i18n
  // load translation using http -> see /public/locales
  // learn more: https://github.com/i18next/i18next-http-backend
  .use(backend)
  // detect user language
  // learn more: https://github.com/i18next/i18next-browser-languageDetector
  .use(LanguageDetector)
  // pass the i18n instance to react-i18next.
  .use(initReactI18next)
  // init i18next
  // for all options read: https://www.i18next.com/overview/configuration-options
  .init({
    fallbackLng: 'EN',
    debug: false,

    interpolation: {
      escapeValue: false,
    },
    react: {
      useSuspense: false,
    },
  });

export default i18n;

I got this from the official doc.

I use it in the following way around my project:

import { useTranslation } from 'react-i18next';

const MyComponent () => {
  //...
  const { t } = useTranslation();
  //...

  return (<>{t("COMMONS.SAY_HI")}</>)

}

I have a basic nextjs project with typescript. This error occures only inone specific page but things seem to be used as the same everywhere and I can't figure out what's the problem.

Also, when I build the project, then everywhere I see only the name variables instead of their content. Is there a problem with the execution stack or something?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda