From bb96addbed9fd6ab1796f7e7f79ed489bfcb8c2a Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 1 Apr 2021 13:59:48 +0000 Subject: [PATCH] [FIX] transifex: escape ' in urls Translation "Let's go" Makes a Transifex search text:'Let\'s go' That should be converted to q=text%3A'Let%5C%27s+go' in the URL Removing the ' works from time to time but not always closes odoo/odoo#70561 X-original-commit: 5f6d6cf1b4c76a2f0031c269501054e816c65e97 Signed-off-by: Martin Trigaux (mat) --- addons/transifex/models/ir_translation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/transifex/models/ir_translation.py b/addons/transifex/models/ir_translation.py index 18a91ef082f..d6acdb5f7cb 100644 --- a/addons/transifex/models/ir_translation.py +++ b/addons/transifex/models/ir_translation.py @@ -75,7 +75,7 @@ class IrTranslation(models.Model): continue # e.g. https://www.transifex.com/odoo/odoo-10/translate/#fr/sale/42?q=text:'Sale+Order' - src = werkzeug.urls.url_quote_plus(translation.src[:50].replace("\n", "").replace("'", "")) + src = werkzeug.urls.url_quote_plus(translation.src[:50].replace("\n", "").replace("'", "\\'")) src = f"'{src}'" if "+" in src else src translation.transifex_url = "%(url)s/%(project)s/translate/#%(lang)s/%(module)s/42?q=%(src)s" % { 'url': base_url,