english language fix

Bug #453269 reported by Leigh Willard
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Undecided
Vinay Rana (OpenERP)

Bug Description

I have a fix for the tools/amount_to_text_en.py file. The english in the file was extremely wrong!

I've attached a replacement file.

Revision history for this message
Leigh Willard (leigh) wrote :
Changed in openobject-server:
assignee: nobody → Jay (Open ERP) (jvo-openerp)
Changed in openobject-server:
status: New → In Progress
assignee: Jay (Open ERP) (jvo-openerp) → Anup (Open ERP) (ach-openerp)
Changed in openobject-server:
assignee: Anup (Open ERP) (ach-openerp) → vra (openerp) (vra-openerp)
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Leigh,

Would you please check with the attached patch?

And Tell us the behaviour.

Thank you.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Thank you for your response.

It has been improved by revision 1882 <email address hidden>.

Thank you.

Changed in openobject-server:
status: In Progress → Fix Released
Revision history for this message
Leigh Willard (leigh) wrote :

I just finally downloaded the new file amount_to_text_en.py from the bazaar trunk branch
lp:~openerp/openobject-server/trunk server
and it is not working properly.

I give:

68.60

and it prints out:

Sixty-Eight dollar and Six Cents

and it should be:
Sixty-Eight dollars and Sixty Cents

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote :

Hello Leigh Willard,

It is not the problem of amount_to_text_en.py, because in word conversion it will concatenate currency name or code which you have passed when you did call this function so simply pass dollars instead of only dollar if you pass company currency code or name simple change the currency code or name which you did pass from Financial Management/Configuration/Currencies menu.

Hope this will help you.

Thanks.

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote :

Hello Leigh Willard,

The problem ('Six Cents'=> 'Sixty Cents') has been fixed in following revision:
stable addons=>stable 1968 <email address hidden>.
trunk addons=>trunk 2052 <email address hidden>.

Thanks.

Revision history for this message
Leigh Willard (leigh) wrote : Re: [Bug 453269] Re: english language fix

I looked in the code and understand what you are saying. I do pass
"dollar" instead of "dollars". However, what if I pass
amount_to_text(1.50,'en','dollars'), then it will print out:

one dollars and fifty cents

But it should be "one dollar and fifty cents".

I believe that making dollar plural should be done in the function
amount_to_text. Would this be possible?

Thanks,

Leigh

vra (openerp) wrote:
> Hello Leigh Willard,
>
> It is not the problem of amount_to_text_en.py, because in word
> conversion it will concatenate currency name or code which you have
> passed when you did call this function so simply pass dollars instead
> of only dollar if you pass company currency code or name simple change
> the currency code or name which you did pass from Financial
> Management/Configuration/Currencies menu.
>
> Hope this will help you.
>
> Thanks.
>
>

Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote :

Hello Leigh Willard,

No we cannot maintain currency plural from this function.Because it is generic function and user can pass any currency name or code so it is very difficult to maintain this so it is better that user will maintain him/her self,if the amount is in single digit then user will not pass plural name.

Thanks.

Revision history for this message
Leigh Willard (leigh) wrote :

This is not standard programming practices. The logic of a function
should be completely encapsulated in the function.

All you need to do is to have two calling parameters for currency, one
singular, and one plural.

Leigh

vra (openerp) wrote:
> Hello Leigh Willard,
>
> No we cannot maintain currency plural from this function.Because it is
> generic function and user can pass any currency name or code so it is
> very difficult to maintain this so it is better that user will maintain
> him/her self,if the amount is in single digit then user will not pass
> plural name.
>
> Thanks.
>
>

Revision history for this message
Numérigraphe (numerigraphe) wrote :

Maybe the 'dollar' parameter's type could be checked:
- if it's a string us it as-is,
- if its a list use the first for 1, the second for 2
That won't fix it for polish, romanian and others - they appear to have more complex plural rules.
GNU gettext has an interesting approach to this problem with "plural forms": http://www.gnu.org/software/hello/manual/gettext/Plural-forms.html
Lionel.

Revision history for this message
Leigh Willard (leigh) wrote :

That sounds good - it would be backwards compatable as well.

At least it would fix it for the majority of languages. The others...
well.... maybe they will have to submit a code fix themselves? :)

Thanks,
Leigh

Numérigraphe wrote:
> Maybe the 'dollar' parameter's type could be checked:
> - if it's a string us it as-is,
> - if its a list use the first for 1, the second for 2
> That won't fix it for polish, romanian and others - they appear to have more complex plural rules.
> GNU gettext has an interesting approach to this problem with "plural forms": http://www.gnu.org/software/hello/manual/gettext/Plural-forms.html
> Lionel.
>
>

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.