[trunk/7.0]OE chatter's doesn't translate created objects in mail_thread widget

Bug #1262000 reported by Sandy Carter (http://www.savoirfairelinux.com)
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Status tracked in Trunk
7.0
Fix Committed
Undecided
OpenERP Publisher's Warranty Team
Trunk
Confirmed
Low
OpenERP R&D Addons Team 1
OpenERP Community Backports (Addons)
Fix Released
Undecided
Unassigned

Bug Description

When an object which inherits mail.thread with description OBJECT is created, a message is posted saying:
OBJECT created.

In french, this is translated as:
OBJECT créé(e).

The problem is that OBJECT isn't translated.

Reproducing:
The simplest way to duplicate this bug is by installing mail and creating a discussion group while in another language.

Expected output:
Groupe de discussion créé(e)

Actual output:
Discussion group créé(e)

Versions:
r9018 for trunk
r9701 for 7.0

Related branches

Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :
Changed in openobject-addons:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
Changed in openobject-addons:
assignee: OpenERP Publisher's Warranty Team (openerp-opw) → nobody
Revision history for this message
Amit Dodiya (OpenERP) (ado-openerp) wrote :

Hi Sandy Carter,

Thanks for your contribution.
The fix from your branch: lp:~savoirfairelinux-openerp/openobject-addons/7.0_mail_thread_translate_bug1262000 is working fine.
Soon our experts will review and merged this with stable 7.0 addons branch.

Regards,
Amit Dodiya

Revision history for this message
maddie (supereggx) wrote :

Hi,

We've found this problem a long time ago, and used the same technique to try solving this problem.

However, although this method works just fine, there is another problem:

This function looks into ir.translation model for the string, where 'type' equals [code].

So far it seems to work fine, but considering the origin string didn't exist before this patch, we will have to try adding the translation by exporting the PO file, adding the translation then import it back to OpenERP.

But just when you have exported the PO file and try to find the newly untranslated string, you'll discover that it wasn't being exported at all.

We found that there are also some other strings with type 'code' in ir.translation model won't get exported either.

Any way to solve this problem?

Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :

@maddie
To export the description into the .po file I just put _() around it.

example:
from openerp.tools.translate import _

class simplenote_note(orm.Model):
    _name = 'simplenote.note'
    _description = _('A simple Note')

Revision history for this message
Amit Dodiya (OpenERP) (ado-openerp) wrote :

Hello Sandy Carter,

>> To export the description into the .po file I just put _() around it.
The above issue is already fixed with following branch:
branch: lp:~openerp-dev/openobject-addons/7.0-opw-601820-ado
revision-id: <email address hidden>
revision-no: 9707

Regards,
Amit Dodiya

Revision history for this message
maddie (supereggx) wrote :

Hi Sandy,

Thanks for your advice.

But some of the strings in the official addons don't get exported sometimes, is it also because of this?

Revision history for this message
Yann Papouin (yann-papouin) wrote :

@maddie, you could take a look on links attached, I don't have any translation export problem since using their fixes in production.

https://bugs.launchpad.net/openobject-server/+bug/906821
https://bugs.launchpad.net/openobject-server/+bug/1029344
https://code.launchpad.net/~openerp-dev/openobject-server/6.1-opw-581687-cbi

Revision history for this message
maddie (supereggx) wrote :

@Yann

Thanks a lot, I will take a look at the links.

Changed in ocb-addons:
status: New → Fix Released
Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

Hello,

This may work for some models by some but _description is not translated by default. Fixing it this way in Sandy's merge prop will not be coherent. By luck you may have translation for res.groups but not others.
We should find a cleaner solution.
In Amit's commit, adding manually _description string is not a valid solution either. Quite overkill. Should be done globally.

In other models we use the subtypes (eg: project.task) which are translated.

Regards

Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :

@Martin
This was discussed in ocb, the proposed MP for openobject-server guarantees that _description is exported in the translation files

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.