Code review comment for lp:~openerp-dev/openobject-server/6.0-opw-18482-atp

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

On 11/22/2011 07:38 AM, Rifakat (OpenERP) wrote:
> @odo: I understand your concern here.
> I applied your patch and it didn't work for me. Its calling translate_call() of report_webkit,
> but while we do export of any po file from 'Export Translation', its calling server's act_getfile() of base.language.export
>
> report_webkit does not come into picture in exporting po procedure.

Yes that seems like the expected behavior.
As far as I can see on the bug report, the problem is that
translate_call() does not consider the translated strings because it
uses a different name than what is exported in the PO files.

The bug report says:

"""
Due to the line
#: report:addons/report_webkit_sample/report/report_webkit_html.mako:35
translation couldn't correctly imported.
"""

This is the same export format as for strings that come from the code
with _(). And as I explained, I think the exported format is fine!
We decided to consider the mako templates of report_webkit just like
normal code, as they are also using something similar to _().
So there is no reason to change that, and it's fine to see
"report:addons/report_webkit_sample/report/report_webkit_html.mako" in
the exported PO!

The only thing to do is to make translate_call() behave like the _()
method we use in the code, and thus make it ignore the name of the
report, which cannot be matched properly, just like for string that cme
from code. This is what my one-line patch is trying to do.

> Correct me if I am missing something.

Have you tested the case of the bug report after applying my patch?
If it does not work, please explain what does not work:
- what entries do you have in ir.translation after importing a PO
containing webkit translations
- are the strings translated when you generate the report in the PO
language?
- if not, can you investigate why translate_call does not find them?

Keep in mind that we want to fix the fact that the translations are
ignored, *not* the format in which the translations are exported.

Thanks!

« Back to merge proposal