[FIX] web_editor: translate editor commands

Steps to reproduce:
- switch to any language other than English
- go to a page where you can use the text editor,
  for instance you can try to edit a project's description.
- type `/` in the editor

You should see that some commands are not translated.

Some files modified in this commit are located in the
web_editor/static/lib/web-editor directory.
However, only the JS code located into /static/src/ is considered for
export of translations. This is done to avoid polluting translations for
code not managed by Odoo.

We have to update the .pot file manually. A good workaround is to copy
the web-editor folder inside to static/src, export the
translations and then delete the copy folder.

However, this means that those updates to the .pot file will be lost in
the next translation export.

opw-2918128

closes odoo/odoo#96939

X-original-commit: 0cc5505b27f29d44c25af83653b09b1b49cfec79
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Nshimiyimana Serge Séna (sesn) <sesn@odoo.com>
This commit is contained in:
Nshimiyimana Séna
2022-07-28 10:28:06 +02:00
parent 27854c787a
commit 679fed2c52
3 changed files with 178 additions and 41 deletions
+137
View File
@@ -227,6 +227,27 @@ msgstr ""
msgid "Add URL"
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/js/wysiwyg/wysiwyg.js:0
#, python-format
msgid "Add a blockquote section."
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/js/wysiwyg/wysiwyg.js:0
#, python-format
msgid "Add a button."
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/js/wysiwyg/wysiwyg.js:0
#, python-format
msgid "Add a code section."
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/xml/editor.xml:0
@@ -241,6 +262,13 @@ msgstr ""
msgid "Add a column right"
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/js/wysiwyg/wysiwyg.js:0
#, python-format
msgid "Add a link."
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/xml/editor.xml:0
@@ -415,6 +443,15 @@ msgstr ""
msgid "Background Position"
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/js/wysiwyg/wysiwyg.js:0
#: code:addons/web_editor/static/src/js/wysiwyg/wysiwyg.js:0
#: code:addons/web_editor/static/src/odoo-editor/src/OdooEditor.js:0
#, python-format
msgid "Basic blocks"
msgstr ""
#. module: web_editor
#: model_terms:ir.ui.view,arch_db:web_editor.snippet_options
msgid "Basics"
@@ -501,6 +538,7 @@ msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/js/wysiwyg/wysiwyg.js:0
#: code:addons/web_editor/static/src/xml/snippets.xml:0
#: code:addons/web_editor/static/src/xml/snippets.xml:0
#, python-format
@@ -561,6 +599,7 @@ msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/js/wysiwyg/wysiwyg.js:0
#: code:addons/web_editor/static/src/xml/editor.xml:0
#, python-format
msgid "Code"
@@ -665,6 +704,13 @@ msgstr ""
msgid "Create a simple bulleted list."
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/odoo-editor/src/OdooEditor.js:0
#, python-format
msgid "Create an URL."
msgstr ""
#. module: web_editor
#: model:ir.model.fields,field_description:web_editor.field_web_editor_converter_test_sub__create_uid
msgid "Created by"
@@ -879,6 +925,42 @@ msgid ""
"prevent it from being updated during future App upgrades."
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/odoo-editor/src/OdooEditor.js:0
#: code:addons/web_editor/static/src/odoo-editor/src/OdooEditor.js:0
#, python-format
msgid "Embed"
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/odoo-editor/src/OdooEditor.js:0
#, python-format
msgid "Embed Image"
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/odoo-editor/src/OdooEditor.js:0
#, python-format
msgid "Embed Youtube Video"
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/odoo-editor/src/OdooEditor.js:0
#, python-format
msgid "Embed the image in the document."
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/odoo-editor/src/OdooEditor.js:0
#, python-format
msgid "Embed the youtube video in the document."
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/js/common/ace.js:0
@@ -1233,6 +1315,7 @@ msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/js/editor/snippets.editor.js:0
#: code:addons/web_editor/static/src/js/wysiwyg/wysiwyg.js:0
#: code:addons/web_editor/static/src/xml/wysiwyg.xml:0
#: model_terms:ir.ui.view,arch_db:web_editor.snippet_options_background_options
#, python-format
@@ -1287,6 +1370,13 @@ msgstr ""
msgid "Insert a table."
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/js/wysiwyg/wysiwyg.js:0
#, python-format
msgid "Insert a video."
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/odoo-editor/src/OdooEditor.js:0
@@ -1294,6 +1384,13 @@ msgstr ""
msgid "Insert an horizontal rule separator."
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/js/wysiwyg/wysiwyg.js:0
#, python-format
msgid "Insert an image."
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/xml/editor.xml:0
@@ -1415,6 +1512,7 @@ msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/js/wysiwyg/widgets/link.js:0
#: code:addons/web_editor/static/src/js/wysiwyg/wysiwyg.js:0
#, python-format
msgid "Link"
msgstr ""
@@ -1469,6 +1567,14 @@ msgstr ""
msgid "Media"
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/js/wysiwyg/wysiwyg.js:0
#: code:addons/web_editor/static/src/js/wysiwyg/wysiwyg.js:0
#, python-format
msgid "Medias"
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/xml/editor.xml:0
@@ -1505,6 +1611,14 @@ msgstr ""
msgid "Name"
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/js/wysiwyg/wysiwyg.js:0
#: code:addons/web_editor/static/src/js/wysiwyg/wysiwyg.js:0
#, python-format
msgid "Navigation"
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/js/editor/snippets.editor.js:0
@@ -1654,6 +1768,20 @@ msgstr ""
msgid "Paragraph block."
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/odoo-editor/src/OdooEditor.js:0
#, python-format
msgid "Paste as URL"
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/odoo-editor/src/OdooEditor.js:0
#, python-format
msgid "Paste as text"
msgstr ""
#. module: web_editor
#: model_terms:ir.ui.view,arch_db:web_editor.snippet_options
msgid "Patterns"
@@ -1710,6 +1838,7 @@ msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/js/wysiwyg/wysiwyg.js:0
#: code:addons/web_editor/static/src/xml/editor.xml:0
#, python-format
msgid "Quote"
@@ -2185,6 +2314,13 @@ msgstr ""
msgid "Show optimized images"
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/odoo-editor/src/OdooEditor.js:0
#, python-format
msgid "Simple text paste."
msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/js/editor/snippets.options.js:0
@@ -2681,6 +2817,7 @@ msgstr ""
#. module: web_editor
#. openerp-web
#: code:addons/web_editor/static/src/js/editor/snippets.editor.js:0
#: code:addons/web_editor/static/src/js/wysiwyg/wysiwyg.js:0
#: code:addons/web_editor/static/src/xml/wysiwyg.xml:0
#, python-format
msgid "Video"
@@ -1798,7 +1798,7 @@ export class OdooEditor extends EventTarget {
const mainCommands = [
{
groupName: 'Basic blocks',
groupName: this.options._t('Basic blocks'),
title: this.options._t('Heading 1'),
description: this.options._t('Big section heading.'),
fontawesome: 'fa-header',
@@ -1807,7 +1807,7 @@ export class OdooEditor extends EventTarget {
},
},
{
groupName: 'Basic blocks',
groupName: this.options._t('Basic blocks'),
title: this.options._t('Heading 2'),
description: this.options._t('Medium section heading.'),
fontawesome: 'fa-header',
@@ -1816,7 +1816,7 @@ export class OdooEditor extends EventTarget {
},
},
{
groupName: 'Basic blocks',
groupName: this.options._t('Basic blocks'),
title: this.options._t('Heading 3'),
description: this.options._t('Small section heading.'),
fontawesome: 'fa-header',
@@ -1825,7 +1825,7 @@ export class OdooEditor extends EventTarget {
},
},
{
groupName: 'Basic blocks',
groupName: this.options._t('Basic blocks'),
title: this.options._t('Text'),
description: this.options._t('Paragraph block.'),
fontawesome: 'fa-paragraph',
@@ -1834,7 +1834,7 @@ export class OdooEditor extends EventTarget {
},
},
{
groupName: 'Basic blocks',
groupName: this.options._t('Basic blocks'),
title: this.options._t('Bulleted list'),
description: this.options._t('Create a simple bulleted list.'),
fontawesome: 'fa-list-ul',
@@ -1843,7 +1843,7 @@ export class OdooEditor extends EventTarget {
},
},
{
groupName: 'Basic blocks',
groupName: this.options._t('Basic blocks'),
title: this.options._t('Numbered list'),
description: this.options._t('Create a list with numbering.'),
fontawesome: 'fa-list-ol',
@@ -1852,7 +1852,7 @@ export class OdooEditor extends EventTarget {
},
},
{
groupName: 'Basic blocks',
groupName: this.options._t('Basic blocks'),
title: this.options._t('Checklist'),
description: this.options._t('Track tasks with a checklist.'),
fontawesome: 'fa-check-square-o',
@@ -1861,7 +1861,7 @@ export class OdooEditor extends EventTarget {
},
},
{
groupName: 'Basic blocks',
groupName: this.options._t('Basic blocks'),
title: this.options._t('Separator'),
description: this.options._t('Insert an horizontal rule separator.'),
fontawesome: 'fa-minus',
@@ -1870,7 +1870,7 @@ export class OdooEditor extends EventTarget {
},
},
{
groupName: 'Basic blocks',
groupName: this.options._t('Basic blocks'),
title: this.options._t('Table'),
description: this.options._t('Insert a table.'),
fontawesome: 'fa-table',
@@ -1879,7 +1879,7 @@ export class OdooEditor extends EventTarget {
},
},
{
groupName: 'Basic blocks',
groupName: this.options._t('Basic blocks'),
title: this.options._t('Switch direction'),
description: this.options._t('Switch the text\'s direction.'),
fontawesome: 'fa-exchange',
@@ -3146,8 +3146,8 @@ export class OdooEditor extends EventTarget {
const baseEmbedCommand = [
{
groupName: 'paste',
title: 'Paste as URL',
description: 'Create an URL.',
title: this.options._t('Paste as URL'),
description: this.options._t('Create an URL.'),
fontawesome: 'fa-link',
callback: () => {
this.historyUndo();
@@ -3169,8 +3169,8 @@ export class OdooEditor extends EventTarget {
},
{
groupName: 'paste',
title: 'Paste as text',
description: 'Simple text paste.',
title: this.options._t('Paste as text'),
description: this.options._t('Simple text paste.'),
fontawesome: 'fa-font',
callback: () => {},
},
@@ -3192,9 +3192,9 @@ export class OdooEditor extends EventTarget {
this.commandBar.open({
commands: [
{
groupName: 'Embed',
title: 'Embed Image',
description: 'Embed the image in the document.',
groupName: this.options._t('Embed'),
title: this.options._t('Embed Image'),
description: this.options._t('Embed the image in the document.'),
fontawesome: 'fa-image',
shouldPreValidate: () => false,
callback: () => {
@@ -3220,9 +3220,9 @@ export class OdooEditor extends EventTarget {
this.commandBar.open({
commands: [
{
groupName: 'Embed',
title: 'Embed Youtube Video',
description: 'Embed the youtube video in the document.',
groupName: this.options._t('Embed'),
title: this.options._t('Embed Youtube Video'),
description: this.options._t('Embed the youtube video in the document.'),
fontawesome: 'fa-youtube-play',
shouldPreValidate: () => false,
callback: async () => {
@@ -1849,27 +1849,27 @@ const Wysiwyg = Widget.extend({
const options = this._editorOptions();
const commands = [
{
groupName: 'Basic blocks',
title: 'Quote',
description: 'Add a blockquote section.',
groupName: _t('Basic blocks'),
title: _t('Quote'),
description: _t('Add a blockquote section.'),
fontawesome: 'fa-quote-right',
callback: () => {
this.odooEditor.execCommand('setTag', 'blockquote');
},
},
{
groupName: 'Basic blocks',
title: 'Code',
description: 'Add a code section.',
groupName: _t('Basic blocks'),
title: _t('Code'),
description: _t('Add a code section.'),
fontawesome: 'fa-code',
callback: () => {
this.odooEditor.execCommand('setTag', 'pre');
},
},
{
groupName: 'Basic blocks',
title: 'Signature',
description: 'Insert your signature.',
groupName: _t('Basic blocks'),
title: _t('Signature'),
description: _t('Insert your signature.'),
fontawesome: 'fa-pencil-square-o',
callback: async () => {
const res = await this._rpc({
@@ -1886,18 +1886,18 @@ const Wysiwyg = Widget.extend({
if (options.allowCommandLink) {
commands.push(
{
groupName: 'Navigation',
title: 'Link',
description: 'Add a link.',
groupName: _t('Navigation'),
title: _t('Link'),
description: _t('Add a link.'),
fontawesome: 'fa-link',
callback: () => {
this.toggleLinkTools({forceDialog: true});
},
},
{
groupName: 'Navigation',
title: 'Button',
description: 'Add a button.',
groupName: _t('Navigation'),
title: _t('Button'),
description: _t('Add a button.'),
fontawesome: 'fa-link',
callback: () => {
this.toggleLinkTools({forceDialog: true});
@@ -1911,9 +1911,9 @@ const Wysiwyg = Widget.extend({
}
if (options.allowCommandImage) {
commands.push({
groupName: 'Medias',
title: 'Image',
description: 'Insert an image.',
groupName: _t('Medias'),
title: _t('Image'),
description: _t('Insert an image.'),
fontawesome: 'fa-file-image-o',
callback: () => {
this.openMediaDialog();
@@ -1922,9 +1922,9 @@ const Wysiwyg = Widget.extend({
}
if (options.allowCommandVideo) {
commands.push({
groupName: 'Medias',
title: 'Video',
description: 'Insert a video.',
groupName: _t('Medias'),
title: _t('Video'),
description: _t('Insert a video.'),
fontawesome: 'fa-file-video-o',
callback: () => {
this.openMediaDialog({noVideos: false, noImages: true, noIcons: true, noDocuments: true});