Community: Framework mailing list archives

expert-framework@mail.odoo.com

Re: Translation code question

by
Mohamed Hagag
- 04/08/2015 09:49:12

Hi Eva,


Appreciate your fast reply.


If we said that the case of one word having different meanings is about %30

    And the meaning depends on the word position and place ( for example Marketing, Accounting, Email, Fleet, ...etc )


Then the %30 can be reduced to %1 by validating the field which is being translated ( name column in the DB )

    which contains the module name, object name, field name and filed type.


I think it's enough that the query says  select translation value with the

    1- same module name ( ex. accounting) , and

    2- of the same object (ex. account.invoice) and

    3- with same field name (ex. partner_id) and,

    4- of the same field type (ex. Field/code/sql/help) and,

    5- matches this exact source - which mostly contains more than one word like " customer name", "Sale order line" ...etc.



field names contains module name and object name and field name, for ex.:


account.invoice,partner_id

object name    ,field name



Based on this we can see that the case of different meanings for one word can be less than %1,

    and it's good to have only 2-5 percent wrong values instead of losing about -30 of translation effort with every new DB.



Regards,


On 04/08/2015 03:02 PM, Eva Pinter wrote:
<blockquote cite="mid:29372A3E-0DC8-476A-BCE1-A1A834ADCC25@openit.ch" type="cite">

Hi Mohammad,


I am by no mean a technical person. But I must say that in many languages, the translation depends not only on the source but also on the context. This means, the same english word (as english is the basis language of Odoo) can be translated in different terms, based on the usage of the term.

As an example, SAP is multilingual but uses also a translation for each element. The included translation system just proposes a translation, but does not automatically put a value, as long as it has not been approved.

So, I guess, but I am absolutely not sure of it, that this may have been the reason to link the translation to the ID of the object translated.

Good Luck!
---
Eva P.

Affordable high quality training on Odoo-training.com





On 8 Apr 2015, at 13:43, Mohamed M. Hagag <mohamedhagag1981@gmail.com> wrote:

Dears,


Can we make translation more portable between databases by ignoring res_id while exporting/importing CSV translation files ?


I don't know why we need the res_id which is a data related filed as I understand from the code.


Isn't it enough to query ir_translation by src, name and type only ?


If we ignore res_id it will help solving the below behavioral issues:


- many terms not showing because of wrong res_id

- translation export ignores many terms

- translation import also ignores many terms

- lots of duplicated terms with the same src, name, type and module after multiple imports it can be 10x or 20x


And it will be easily to export the ir_translation table from one DB to another and translation will work.


AFAIK, most if not all multi-language systems do not bind the translation to a dynamic record id like res_id .


Finally, I'm working on testing the translation tools and functions of odoo with various cases.


Regards,

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-framework-62
Post to: mailto:expert-framework@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe