odoo/odoo#205719

Created by fw-bot
Merged at ec3a5bffbf1766a7236f9b4292e1307984270c9c

Statuses:

label
odoo-dev:saas-18.1-17.0-opw-4442038-translation_regex_match_any_character-magm-429036-fw
head
81b4117f83110abe5250d442a897f5a2de879338
merged
7 months ago by Website, Serge Bayet (seba)
odoo/odoo
17.0 #194416
saas-17.4 #204131
18.0 #205705
saas-18.1 #205719
saas-18.2 #205733
saas-18.3
saas-18.4
19.0
master #205746

[FW][FIX] website: translation regex match any character of the content

Steps to reproduce:
(This are for this specific case)

  1. Get website_appointment_sale and a 2nd language for our website.
  2. Make sure that for the appointment we select Allow Guests.
  3. Now, we go to the website and go to the appointment, until we reach the "Add more details about you" page.
  4. Here is when we have to try to modify the translation with editor.

Issue:
We're receiving an error as
"Cannot read properties of null (reading '2')" which arises from the trans not being appropiate due to the translation regex, which will cause the match to be null when calling it on this "defective" trans.

Solution:
The current solution will make the regex to better match anything in the translation, by modifying (.*) to ([\s\S]*?) we make sure that we're matching any character, including new lines.

opw-4442038

Forward-Port-Of: #204131
Forward-Port-Of: #194416