Translation of purchase_order_webkit is missing term 'Quotation N°'

Bug #1067764 reported by Niels Huylebroeck
0
Affects Status Importance Assigned to Milestone
Purchase - Reports
Confirmed
Undecided
Alexandre Fayolle - camptocamp

Bug Description

The purchase_order.mako file contains the line:

<h1 style="clear:both; padding-top: 20px;">${quotation and _(u'Quotation N°') or _(u'Purchase Order N°') } ${purch.name}</h1>

Since the automated translation generator for openerp searches for _(' and ') to match translations these terms are not detected.

Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

since ° is non ascii, we need the unicode string prefix.

Arguably, we should stick to ascii in there and have unicode in the translation. I propose using _('Quotation Nbr') and _('Purchase Order Nbr') in the source code. Any objection?

Changed in c2c-addons:
status: New → Confirmed
assignee: nobody → Alexandre Fayolle @ camptocamp (alexandre-fayolle-c2c)
Revision history for this message
Niels Huylebroeck (red15) wrote : Re: [Bug 1067764] Re: Translation of purchase_order_webkit is missing term 'Quotation N°'

The parsing of the tools/translate.py function already expects unicode to
be extracted.
So this should not be a problem to remove the u''

2012/10/17 Alexandre Fayolle @ camptocamp <email address hidden>

> since ° is non ascii, we need the unicode string prefix.
>
> Arguably, we should stick to ascii in there and have unicode in the
> translation. I propose using _('Quotation Nbr') and _('Purchase Order
> Nbr') in the source code. Any objection?
>
> ** Changed in: c2c-addons
> Status: New => Confirmed
>
> ** Changed in: c2c-addons
> Assignee: (unassigned) => Alexandre Fayolle @ camptocamp
> (alexandre-fayolle-c2c)
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1067764
>
> Title:
> Translation of purchase_order_webkit is missing term 'Quotation N°'
>
> Status in Camptocamp Addons For OpenERP:
> Confirmed
>
> Bug description:
> The purchase_order.mako file contains the line:
>
> <h1 style="clear:both; padding-top: 20px;">${quotation and
> _(u'Quotation N°') or _(u'Purchase Order N°') } ${purch.name}</h1>
>
> Since the automated translation generator for openerp searches for _('
> and ') to match translations these terms are not detected.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/c2c-addons/+bug/1067764/+subscriptions
>

--
Niels Huylebroeck
Bubbles-IT
Tel. : +32 (0)9 328 33 88
Web : http://www.bubbles-it.be

Revision history for this message
Niels Huylebroeck (red15) wrote :

Perhaps worth noting is that OpenERP has changed the _() extraction methods between 6.1 and trunk. This bug appeared on a 6.1 server where the code is a bit more manual than in trunk (where they use babel library to find strings to translate)

See difference between 6.1
http://bazaar.launchpad.net/~openerp/openobject-server/6.1/view/head:/openerp/tools/translate.py#L801

and trunk:
http://bazaar.launchpad.net/~openerp/openobject-server/trunk/view/head:/openerp/tools/translate.py#L833

Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

I remember adding the u'' because of a crash in the report generation.

Revision history for this message
Niels Huylebroeck (red15) wrote :

2012/10/18 Alexandre Fayolle @ camptocamp <email address hidden>

> I remember adding the u'' because of a crash in the report generation.
>

I suppose this is possible if the translated value (loaded from po /
database) itself contains unicode characters, the source string would
already be expected to be in unicode (while the code is attempting to
extract the values from the mako template)

In my current situation I was not able to test any accented characters for
translated values.

--
Niels Huylebroeck
Bubbles-IT
Tel. : +32 (0)9 328 33 88
Web : http://www.bubbles-it.be

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Making the bug follow the module's migration

affects: c2c-addons → purchase-report
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.