odoo/odoo#197702

Created by Accounting, Dylan Kiss (dyki)
Merged at 91027494911db00f59c9b4b2434741c6b5fc34d9

Statuses:

Linked pull requests
label
odoo-dev:master-auto-format-list-translations-dyki
head
a1435bdbb957b365ea774b1b8415b181552bfee8
merged
8 months ago by Accounting, Dylan Kiss (dyki)
odoo/odoo odoo/enterprise
master #197702 #79302

[IMP] tools,web: auto format lists in translations

To localize a list of items in a translated string, you can use the functions format_list() (Python) or formatList() (Javascript) and pass the result of this call as argument to your translation function.

However, users would need to import the function each time, call it on lists and pass the env (for Python). This can be cumbersome.

In order to ease the default case, we now allow users to directly pass an iterable as argument to the translation functions. This argument would then automatically be correctly formatted using the above functions.

If users don't want to use the default list formatting, they can still manually preprocess the value with their preferred options of course.

task-4533664

Related to odoo/enterprise#79302