From f8bba6b9bc30bc02af4212142b779d0059581c30 Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Thu, 24 Aug 2023 11:31:02 +0200 Subject: [PATCH] [FIX] website, *: add missing _lt and missing .pot entries This commit fixes this error: - The IMP done at [3] added a lot of fields but all of those forgot the `_t()`/`_lt()` translation. Note that: 1. A fix to replace `_t` by `_lt` was done at [4] but it was badly done as it was not targetting the correct version... and only fixed one of many occurences. 2. In this forward port, using `_t()` seems to be working again, using `_lt()` is not required anymore. This part of the PR has been removed here. For tracking purpose, here was the other bug: - The form registry fields added in [1] and [2] in Odoo 13 had a `string` attribute translated with `_t()` while now it should be translated with `_lt()`. It was surely working in Odoo 13 but not anymore. It's not worth investigating to be sure. - Not needed since a recent commit which removed `_lt()` (it's a deprecated alias to `_t()` which now handles the lazy translation directly too. [1]: https://github.com/odoo/odoo/pull/32565 [2]: https://github.com/odoo/enterprise/pull/4063 [3]: https://github.com/odoo/odoo/commit/617eba941785aa680edb826e14b0009637d60dee [4]: https://github.com/odoo/odoo/commit/2be83cae7bcda369ed5bc7806aef845c6c76e687 opw-3471873 closes odoo/odoo#134238 Signed-off-by: Quentin Smetz (qsm) Signed-off-by: Romain Derie (rde) --- addons/website/static/src/js/send_mail_form.js | 12 ++++++------ .../website_crm/static/src/js/website_crm_editor.js | 12 ++++++------ .../static/src/js/website_form_project_editor.js | 6 +++--- .../static/src/js/website_hr_recruitment_editor.js | 10 +++++----- .../static/src/js/website_sale_form_editor.js | 9 +++++---- 5 files changed, 25 insertions(+), 24 deletions(-) diff --git a/addons/website/static/src/js/send_mail_form.js b/addons/website/static/src/js/send_mail_form.js index 27d76f3f6ec..a5fe8432507 100644 --- a/addons/website/static/src/js/send_mail_form.js +++ b/addons/website/static/src/js/send_mail_form.js @@ -10,36 +10,36 @@ FormEditorRegistry.add('send_mail', { required: true, fillWith: 'name', name: 'name', - string: 'Your Name', + string: _t('Your Name'), }, { type: 'tel', custom: true, fillWith: 'phone', name: 'phone', - string: 'Phone Number', + string: _t('Phone Number'), }, { type: 'email', modelRequired: true, fillWith: 'email', name: 'email_from', - string: 'Your Email', + string: _t('Your Email'), }, { type: 'char', custom: true, fillWith: 'commercial_company_name', name: 'company', - string: 'Your Company', + string: _t('Your Company'), }, { type: 'char', modelRequired: true, name: 'subject', - string: 'Subject', + string: _t('Subject'), }, { type: 'text', custom: true, required: true, name: 'description', - string: 'Your Question', + string: _t('Your Question'), }], fields: [{ name: 'email_to', diff --git a/addons/website_crm/static/src/js/website_crm_editor.js b/addons/website_crm/static/src/js/website_crm_editor.js index 5af209c3731..c97c72a8df4 100644 --- a/addons/website_crm/static/src/js/website_crm_editor.js +++ b/addons/website_crm/static/src/js/website_crm_editor.js @@ -9,34 +9,34 @@ FormEditorRegistry.add('create_lead', { required: true, name: 'contact_name', fillWith: 'name', - string: 'Your Name', + string: _t('Your Name'), }, { type: 'tel', name: 'phone', fillWith: 'phone', - string: 'Phone Number', + string: _t('Phone Number'), }, { type: 'email', required: true, fillWith: 'email', name: 'email_from', - string: 'Your Email', + string: _t('Your Email'), }, { type: 'char', required: true, fillWith: 'commercial_company_name', name: 'partner_name', - string: 'Your Company', + string: _t('Your Company'), }, { type: 'char', modelRequired: true, name: 'name', - string: 'Subject', + string: _t('Subject'), }, { type: 'text', required: true, name: 'description', - string: 'Your Question', + string: _t('Your Question'), }], fields: [{ name: 'team_id', diff --git a/addons/website_form_project/static/src/js/website_form_project_editor.js b/addons/website_form_project/static/src/js/website_form_project_editor.js index 503dda38c7c..5c137b0254c 100644 --- a/addons/website_form_project/static/src/js/website_form_project_editor.js +++ b/addons/website_form_project/static/src/js/website_form_project_editor.js @@ -8,17 +8,17 @@ FormEditorRegistry.add('create_task', { type: 'char', modelRequired: true, name: 'name', - string: 'Task Title', + string: _t('Task Title'), }, { type: 'email', modelRequired: true, fillWith: 'email', name: 'email_from', - string: 'Your Email', + string: _t('Your Email'), }, { type: 'char', name: 'description', - string: 'Description', + string: _t('Description'), }], fields: [{ name: 'project_id', diff --git a/addons/website_hr_recruitment/static/src/js/website_hr_recruitment_editor.js b/addons/website_hr_recruitment/static/src/js/website_hr_recruitment_editor.js index a61a4ce36f6..9076f019f16 100644 --- a/addons/website_hr_recruitment/static/src/js/website_hr_recruitment_editor.js +++ b/addons/website_hr_recruitment/static/src/js/website_hr_recruitment_editor.js @@ -9,27 +9,27 @@ FormEditorRegistry.add('apply_job', { modelRequired: true, name: 'partner_name', fillWith: 'name', - string: 'Your Name', + string: _t('Your Name'), }, { type: 'email', required: true, fillWith: 'email', name: 'email_from', - string: 'Your Email', + string: _t('Your Email'), }, { type: 'char', required: true, fillWith: 'phone', name: 'partner_mobile', - string: 'Phone Number', + string: _t('Phone Number'), }, { type: 'char', name: 'linkedin_profile', - string: 'LinkedIn Profile', + string: _t('LinkedIn Profile'), }, { type: 'text', name: 'description', - string: 'Short Introduction', + string: _t('Short Introduction'), }, { type: 'binary', custom: true, diff --git a/addons/website_sale/static/src/js/website_sale_form_editor.js b/addons/website_sale/static/src/js/website_sale_form_editor.js index 3b17a6cd857..673225f6e5a 100644 --- a/addons/website_sale/static/src/js/website_sale_form_editor.js +++ b/addons/website_sale/static/src/js/website_sale_form_editor.js @@ -1,5 +1,6 @@ /** @odoo-module **/ +import { _t } from "@web/core/l10n/translation"; import FormEditorRegistry from "@website/js/form_editor_registry"; FormEditorRegistry.add('create_customer', { @@ -8,22 +9,22 @@ FormEditorRegistry.add('create_customer', { modelRequired: true, name: 'name', fillWith: 'name', - string: 'Your Name', + string: _t('Your Name'), }, { type: 'email', required: true, fillWith: 'email', name: 'email', - string: 'Your Email', + string: _t('Your Email'), }, { type: 'tel', fillWith: 'phone', name: 'phone', - string: 'Phone Number', + string: _t('Phone Number'), }, { type: 'char', name: 'company_name', fillWith: 'commercial_company_name', - string: 'Company Name', + string: _t('Company Name'), }], });