"use strict";

import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
class Localization {
  instance = i18n.createInstance();
  constructor(data) {
    this.init(data).then();
  }
  async init(data) {
    return this.instance.use(initReactI18next).init({
      resources: data.resources,
      lng: data.lng,
      fallbackLng: data.fallbackLng,
      compatibilityJSON: 'v4',
      load: 'currentOnly'
    }).then(() => true);
  }
  changeLanguage(language) {
    this.instance.changeLanguage(language).then();
  }
}
export { Localization };
//# sourceMappingURL=index.js.map