/** @odoo-module **/

import {TranslationDialog} from "@web/views/fields/translation_dialog";

export function editModelTranslate(env, title, model, id, reloadType) {
    env.services.dialog.add(TranslationDialog, {
        fieldName: "arch_db",
        resId: id,
        resModel: model,
        userLanguageValue: env.services.user.lang,
        userUserCurrentLang: true,
        isComingFromTranslationAlert: false,
        onSave: async () => {
            env.bus.trigger("CLEAR-CACHES");
            await env.services.action.doAction({
                type: "ir.actions.client",
                tag: reloadType,
            });
        },
    });
}
