"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.addTranslations = exports.addLangsTranslations = void 0;
const definition_1 = require("../ui/definition");
const addLangsTranslations = ({ i18n, langs, namespace, data, }) => {
    langs.forEach((lang) => {
        i18n.addResourceBundle(lang, namespace, data[lang]);
    });
};
exports.addLangsTranslations = addLangsTranslations;
const addTranslations = ({ i18n, translation, translations, langs = [definition_1.TranslationLang.En], }) => {
    if (translation) {
        const { namespace, data } = translation;
        i18n.addResourceBundle(definition_1.TranslationLang.En, namespace, data.en);
        (0, exports.addLangsTranslations)({ i18n, langs, namespace, data });
    }
    else {
        (translations || []).forEach(({ namespace, data }) => {
            (0, exports.addLangsTranslations)({ i18n, langs, namespace, data });
        });
    }
};
exports.addTranslations = addTranslations;
//# sourceMappingURL=addTranslations.js.map