/** @odoo-module **/

import {TranslateMenu} from "@translation_helper/translate/translate_menu";
import {WebClient} from "@web/webclient/webclient";
import {patch} from "@web/core/utils/patch";
import {registry} from "@web/core/registry";
import {useOwnTranslateContext} from "@translation_helper/translate/translate_context";

patch(WebClient.prototype, {
    setup() {
        super.setup();
        useOwnTranslateContext({categories: ["default"]});
        if (this.env.translate) {
            registry.category("systray").add(
                "web.translate_mode_menu",
                {
                    Component: TranslateMenu,
                },
                {sequence: 200}
            );
        }
    },
});
