odoo/odoo#197702
Created by Accounting, Dylan Kiss (dyki)
Merged
at 91027494911db00f59c9b4b2434741c6b5fc34d9
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- ci/l10n: (runtime 0s)
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.
Related to odoo/enterprise#79302