Friday, May 24, 2024
2 changes · master
Enhancements to existing features
Project sharing tests were updated to stay aligned with related changes in the community edition. This helps ensure sales timesheet features continue to be validated correctly after the shared wizard behavior changed.
Original PR description
This commit adapts the using of `project.share.wizard` wizard due to the changes made in the related PR in community. Community PR: odoo/odoo#165065
This update makes translated messages more reliable by naming placeholders in text that contains multiple dynamic values. It helps translators reorder words naturally for different languages, reducing awkward or incorrect translations across affected Odoo Enterprise modules.
Original PR description
## The problem Translating text in a language sometimes involves reordering words. Positional arguments are always inserted in the same order, which order matches English syntax, but this isn't…
## The problem
Translating text in a language sometimes involves reordering words. Positional arguments are always inserted in the same order, which order matches English syntax, but this isn't necessarily right for every syntax of every language in the world.
Here's an eloquent example of the problem, taken from the GNU gettext documentation:
```c
printf(gettext("String '%s' has %d characters\n"), s, strlen(s));
```
which one could translate in German as follows:
```c
"%d Zeichen lang ist die Zeichenkette `%s'"
```
Even without knowing any of German, you could notice that the positions of `%d` and `%s` have been swapped; yet printf would still insert its arguments in the same order.
That's the reason why, whenever there is more than one “format specifier” (`%s`), you should always use keyworded arguments so that the translators can freely reorder the words without any problems.
## The fix
This pull request fixes the problem by naming providing a name to the placeholders of every call to gettext with more than two placeholders.
Part of task-3869533
Community: https://github.com/odoo/odoo/pull/166014