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