From f4d260de0d771fda0c66314d832d253f49aa2e77 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 6 Sep 2021 14:16:27 +0530 Subject: [PATCH] fix: Problems while using translations via Globe Symbol (#14128) Co-authored-by: Vama Mehta (cherry picked from commit 40f2e915918860ade1e514c8b0bb4cf1bb6d0b2b) Co-authored-by: vama --- frappe/public/js/frappe/form/controls/base_control.js | 2 +- frappe/translate.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/form/controls/base_control.js b/frappe/public/js/frappe/form/controls/base_control.js index d6c268a28a..6a14637f33 100644 --- a/frappe/public/js/frappe/form/controls/base_control.js +++ b/frappe/public/js/frappe/form/controls/base_control.js @@ -131,7 +131,7 @@ frappe.ui.form.Control = class BaseControl { if (!this.doc.__islocal) { new frappe.views.TranslationManager({ 'df': this.df, - 'source_text': value, + 'source_text': this.value, 'target_language': this.doc.language, 'doc': this.doc }); diff --git a/frappe/translate.py b/frappe/translate.py index f1dbfdec59..6f3ed81dc2 100644 --- a/frappe/translate.py +++ b/frappe/translate.py @@ -821,6 +821,9 @@ def update_translations_for_source(source=None, translation_dict=None): translation_dict = json.loads(translation_dict) + if is_html(source): + source = strip_html_tags(source) + # for existing records translation_records = frappe.db.get_values('Translation', { 'source_text': source