[FIX] website_gengo: adapt to 12.3 translate classes
Adapt gengo to change on translator editor classes and assets. opw-2234713 closes #49978 closes odoo/odoo#50004 X-original-commit: 4dba09388a3ba57f345c2634d7d37e268c6f1198 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
This commit is contained in:
@@ -6,14 +6,15 @@ var core = require('web.core');
|
||||
var Dialog = require('web.Dialog');
|
||||
var Widget = require('web.Widget');
|
||||
var WysiwygTranslate = require('web_editor.wysiwyg.multizone.translate');
|
||||
var TranslatorMenu = require('website.editor.menu.translate');
|
||||
|
||||
var qweb = core.qweb;
|
||||
var _t = core._t;
|
||||
|
||||
WysiwygTranslate.include({
|
||||
xmlDependencies: (WysiwygTranslate.prototype.xmlDependencies || [])
|
||||
TranslatorMenu.include({
|
||||
xmlDependencies: (TranslatorMenu.prototype.xmlDependencies || [])
|
||||
.concat(['/website_gengo/static/src/xml/website.gengo.xml']),
|
||||
events: _.extend({}, WysiwygTranslate.prototype.events, {
|
||||
events: _.extend({}, TranslatorMenu.prototype.events, {
|
||||
'click a[data-action=translation_gengo_post]': 'translation_gengo_post',
|
||||
'click a[data-action=translation_gengo_info]': 'translation_gengo_info',
|
||||
}),
|
||||
@@ -32,7 +33,6 @@ WysiwygTranslate.include({
|
||||
this.$('button[data-action=save]')
|
||||
.after(qweb.render('website.ButtonGengoTranslator'));
|
||||
}
|
||||
|
||||
this.translation_gengo_display();
|
||||
|
||||
return def;
|
||||
@@ -85,7 +85,7 @@ WysiwygTranslate.include({
|
||||
'lang': context.lang,
|
||||
}).then(function () {
|
||||
ajax.jsonRpc('/website/post_gengo_jobs', 'call', {});
|
||||
self._save();
|
||||
self.save();
|
||||
}).guardedCatch(function () {
|
||||
Dialog.alert(null, _t("Could not Post translation"));
|
||||
});
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<a role="button" class="btn btn-danger d-none gengo_inprogress disabled" href="#"> <i class="fa fa-clock-o"></i> Translation in Progress</a>
|
||||
<a role="button" class="btn btn-link gengo_info" data-action="translation_gengo_info">Count Words</a>
|
||||
</t>
|
||||
<t t-extend="web_editor.TranslatorInfoDialog">
|
||||
<t t-extend="website.TranslatorInfoDialog">
|
||||
<t t-jquery=".oe_translate_examples" t-operation="replace">
|
||||
<ul class="oe_translate_examples">
|
||||
<li style="background:#ffffb6;">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<template id="gengo_assets_editor" inherit_id="website.assets_editor" name="Editor Head">
|
||||
<template id="gengo_assets_editor" inherit_id="website.assets_wysiwyg" name="Editor Head">
|
||||
<xpath expr='.' position="inside">
|
||||
<link rel="stylesheet" href="/website_gengo/static/src/css/website_gengo.css"/>
|
||||
<script type="text/javascript" src="/website_gengo/static/src/js/website_gengo.js" />
|
||||
|
||||
Reference in New Issue
Block a user