translation not done

Bug #638796 reported by Jean-Luc WEYL
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Undecided
Unassigned

Bug Description

In 5.0.14, a field defined in a .xml with attribute string="xxx" will never be translated using a .po file.

Exemple
in base/res/partner/parter_view.xml, you have the following line:
<field domain="[('domain', '=', 'contact')]" name="title" string="Type"/>

If you try to translate "Type" into something else using a .po file, it will not work.

Solution:
in base/ir/ir_translation.py, routine _get_source, remove or comment the 2 lines:
#if source and not trad:
# return source

affects: account-banking → openobject-addons
Revision history for this message
Anup(SerpentCS) (anup-serpent) wrote :

Hello Jean,

   For getting translation in xml strings you need to have translation with type view. So you need to have an entry in the ir_translation with type=view. For that keep the entry in the .po file of your installed language as shown below and update the server. You'll get the required translation in your view.

For e.g.
In your case the entry would be :
 in fr.po

#. module: base
#: view:res.partner:0
msgid "Type"
msgstr "Typo"

Thanks.

Changed in openobject-addons:
milestone: none → 6.0
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.