diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2017-05-15 08:55:01 +0200 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2017-05-16 18:05:49 +0200 |
| commit | 65808bbb2e13df9c114035a07a6d21892699a940 (patch) | |
| tree | 9d3414160f583e9fdea3b124fb1dccc8d021e011 /addons/web/static/src/js/views/basic/basic_controller.js | |
| parent | b218c5410fab808d4b03cc1909031343d07dab51 (diff) | |
[FIX] models.py: less botched copy for callable translate
Fields translated with function such as `xml_translate` or
`html_translate` have translations such as:
lang=fr_FR, src="Tree", value="Arbre"
when the value directly stored in the table could be:
<strong>Tree</strong>
The code to copy translations when duplicating a record did not take
this into account and when not in english, would add previously not
existing translations such as:
lang=fr_FR, src="<strong>Tree</strong>", value="<strong>Arbre</strong>"
This is wrong since for example after a copy in french, what is in the
database is:
<strong>Arbre</strong>
This commit change this so that the translation in the database stay the
same:
lang=fr_FR, src="Tree", value="Arbre"
This translation will still not apply (if the base language is different
and a translation different than the source exists) but it is more
logical to have this.
This change also magnify an issue that was that if a translation was:
Tree -> Arbre
and the content `<strong>Arbre</strong>`. The translation doesn't happen
in one way, but does when doing the reverse translation.
So:
translation (Tree -> Arbre):
`<strong>Arbre</strong>` -> `<strong>Arbre</strong>` <= FAIL
reverse translation (Arbre -> Tree):
`<strong>Arbre</strong>` -> `<strong>Tree</strong>` <= WORKS
this broke the test that something reverse translation of a translation
got the original. But testing this if the translation did not work seems
to make little sense.
opw-740213
closes #16984
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
0 files changed, 0 insertions, 0 deletions
