Skip to content

Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.

1.1 KB
Raw Blame
import { getDeploymentBaseUrl } from 'common/util/baseUrl';
import i18n from 'i18next';
import Backend from 'i18next-http-backend';
import { initReactI18next } from 'react-i18next';

// TODO: Disabled for IDE performance issues with our translation JSON
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import translationEN from '../public/locales/en.json';

if (import.meta.env.MODE === 'package') {
  i18n.use(initReactI18next).init({
    lng: 'en',
    resources: {
      en: { translation: translationEN },
    },
    debug: false,
    interpolation: {
      escapeValue: false,
    },
    returnNull: false,
  });
} else {
  i18n
    .use(Backend)
    // .use(
    //   new LanguageDetector(null, {
    //     lookupLocalStorage: `${LOCALSTORAGE_PREFIX}lng`,
    //   })
    // )
    .use(initReactI18next)
    .init({
      fallbackLng: 'en',
      debug: false,
      backend: {
        loadPath: `${getDeploymentBaseUrl()}/locales/{{lng}}.json`,
      },
      interpolation: {
        escapeValue: false,
      },
      returnNull: false,
    });
}

export default i18n;