summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2021-04-01 13:59:48 +0000
committerMartin Trigaux <mat@odoo.com>2021-04-01 14:57:57 +0000
commit5f6d6cf1b4c76a2f0031c269501054e816c65e97 (patch)
tree77fdafcf84a93b60ba24e7e9d8d7f29f55aa1545
parentc7b32e0795bc1573d81563f31a75fa44c64b39c2 (diff)
[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#68651 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
-rw-r--r--addons/transifex/models/ir_translation.py2
1 files changed, 1 insertions, 1 deletions
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,