Community: Translators mailing list archives

translators@mail.odoo.com

Re: Some translations that don't work

by
Projetgrup, Levent Karakaş
- 03/30/2015 08:03:26
Hello,

I found a solution for the first one, if you specify the string attribute to the field with the field name and add the form name to your pot/po files it works. 

<record model="ir.ui.view" id="view_account_check_tree">
<field name="name">test.tree</field>
<field name="model">test.test</field>
<field name="priority">100</field>
<field name="arch" type="xml">
<tree string="Test">
<field name="name" string="Name"/>
</tree>
</field>
The search forms also have the same problem. I couldn't get  the point of not translating the computed fields but we have a solution now at least.

For the second, if you export an empty pot file of the module, these translations are not exported. If you put it manually it works:

#. module: testing
#: code:addons/testing/wizard/test.py:11
#, python-format
msgid "Not translated."
msgstr ""
In conclusion it's not the translation of wizard but the export of translations which is not working.

For the last one, I still couldn't find a solution.

I hope this helps someone else too...




2015-03-26 18:22 GMT+02:00 Levent Karakas <levent@mektup.at>:
Hello,

I am trying to make Turkish translations and I have few cases that I couldn't get them work.

1) compute fields like this don't get translated:

name = fields.Char(
    compute='_get_name', string='Number'
)

<record model="ir.ui.view" id="view_account_check_tree">
<field name="name">test.tree</field>
<field name="model">test.test</field>
<field name="priority">100</field>
<field name="arch" type="xml">
<tree string="Test">
<field name="name"/>
</tree>
</field>
I've tried several options like store=True translate=True with no luck. Put string='Number' in the beginning with no luck.

These terms are not exported as if they don't exist. If I add them manually to pot and po files they are imported but not shown.

2) raised Warnings in a wizard action:

Such as:class test_action(models.TransientModel):
    _name = 'test.action'
def action_confirm(self, cr, uid, ids, context=None):
  raise Warning(
_('Not translated.'))
with this form:

<record model="ir.ui.view" id="test.test_action_form_view">
<field name="name">test.action.wizard.form</field>
<field name="model">test.action</field>
<field name="arch" type="xml">
<form string="Test Action" version="7.0">
<field name="testing"/>
<footer>
<button string="Confirm" name="action_confirm" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel"/>
</footer>
</form>
</field>
</record>
3) Warnings raised from within workflow:


It happens because there is no context (and language) when these messages triggered. Check this thread:

It seems like problem is still there.

I'll be glad if you can suggest workarounds/solutions for these cases.

Thanks in advance,
Levent Karakaş