Adding a translation table

128 views
Skip to first unread message

Martin Schönbeck

unread,
Mar 16, 2022, 5:10:39 PM3/16/22
to iDempiere
Hi,

perhaps I was a bit naive. I guessed creating a translation table for an existing table would work out of the box.

I wanted to have a translation for the m_discountschema field description. I created a translation table using the 'create/complete table'. I then added the description field, generated the table and window and so on. To be on the save side did a sync translation and restarted idempiere.

Is it impossible, to add a translation table later or did I do something wrong.

Regards,
Martin

Jesús Castillo

unread,
Mar 16, 2022, 5:38:09 PM3/16/22
to idem...@googlegroups.com
Hi, validate this,

Table name: must be table name + _Trl, e.g. M_DiscountSchema_Trl, add fields name, description, AD_Language,IsTranslated, AD_Languageand M_DiscountSchema_ID
Tab: in window and tab, check translation tab

image.png
 



Atte: Jesus Castillo.


Mailtrack Sender notified by
Mailtrack
03/16/22, 05:37:49 PM

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/e1934bc2-5918-4509-801f-47c87b1c101bn%40googlegroups.com.

Nicolas Micoud

unread,
Mar 17, 2022, 1:30:03 AM3/17/22
to iDempiere
Hi,

It works out the box :)

Regards,

Nicolas

Nicolas Micoud

unread,
Mar 17, 2022, 1:39:01 AM3/17/22
to iDempiere

Martin Schönbeck

unread,
Mar 17, 2022, 5:00:07 AM3/17/22
to iDempiere
Hi Nicolas,
nicolas...@gmail.com schrieb am Donnerstag, 17. März 2022 um 06:39:01 UTC+1:
That was the way I used to create the _trl table. Then I added then description column. But I get no chance to insert a row into it.

Regards,
Martin

Diego Ruiz

unread,
Mar 17, 2022, 5:20:33 AM3/17/22
to iDempiere
Hi Martin,

I don't know which error you are getting. But I experienced something similar not long ago.

After checking all possibilities I noticed that the error was that the Trl table had no PK. You need to add it in the Table Index tab.

Something like this:

photo_2022-03-17_10-17-06.jpg

Best regards,
Diego Ruiz

Martin Schönbeck

unread,
Mar 17, 2022, 6:53:31 AM3/17/22
to iDempiere
Hi Diego,

I had as mentioned by the 'create/complete table' run the 'create table index' after creating the _trl table. So there is an index with ad_language and m_discountschema_id as columns and one with the uuid. Can anybody point me to the source file where the creation of a translation entry should happen?

Regards,
Martin

Carlos Antonio Ruiz Gomez

unread,
Mar 17, 2022, 7:27:12 AM3/17/22
to idem...@googlegroups.com
Martin, this is the key part of your message:

> But I get no chance to insert a row into it.

At first you just said "this doesn't work" but didn't explain your problem, is easier when explained.

AFAIR translation tables are not intended to allow insertion.

If I recall correctly you need to run the process Synchronize Doc Translation to insert the records.
But again I'm not sure if that process insert or just updates.
In case it doesn't insert, then the button Language Maintenance in the Language window, must do the trick with the Add missing translations option

Regards,

Carlos Ruiz



El 17/3/22 a las 11:53, Martin Schönbeck escribió:
Hi Diego,

I had as mentioned by the 'create/complete table' run the 'create table index' after creating the _trl table. So there is an index with ad_language and m_discountschema_id as columns and one with the uuid. Can anybody point me to the source file where the creation of a translation entry should happen?

Regards,
Martin

Diego Ruiz schrieb am Donnerstag, 17. März 2022 um 10:20:33 UTC+1:
Hi Martin,

I don't know which error you are getting. But I experienced something similar not long ago.

After checking all possibilities I noticed that the error was that the Trl table had no PK. You need to add it in the Table Index tab.

Something like this:



Martin Schönbeck

unread,
Mar 17, 2022, 10:14:37 AM3/17/22
to iDempiere
Hi Carlos,

Carlos Antonio Ruiz Gómez schrieb am Donnerstag, 17. März 2022 um 12:27:12 UTC+1:
Martin, this is the key part of your message:

> But I get no chance to insert a row into it.

At first you just said "this doesn't work" but didn't explain your problem, is easier when explained.

Yes. In my first question I only wanted to know, whether it should work (and I had to investigate why not) or if there was no chance to add a translation later. That's why I didn't explain what was going wrong.

AFAIR translation tables are not intended to allow insertion.

Yes, of course, but I had expected entries when creating a new record.


If I recall correctly you need to run the process Synchronize Doc Translation to insert the records.
But again I'm not sure if that process insert or just updates.

It only updates records
 
In case it doesn't insert, then the button Language Maintenance in the Language window, must do the trick with the Add missing translations option

Yes, that the way I did it after having found the real problem

I had searched for a field to activate translations anywhere in table, column, window, field but didn't find it. So I guessed it the translation was based only on the existence of corresponding columns. Digging through the convinced me that there must be a isTranslated column and finally I found it in the collapsed 'technical' field group.

Sometimes it's so simple.

Regards,
Martin

Carlos Antonio Ruiz Gomez

unread,
Mar 17, 2022, 10:30:08 AM3/17/22
to idem...@googlegroups.com
I see Martin, maybe that's something worthy to clarify in the documentation of Create/Complete Table

If I recall correctly, the thing is that it is not intended to add columns to the _Trl table, what is intended is that you mark the columns in the main table as Translated, and then create the translation table.

BTW, I remember also that the Technical field group is collapsed because we found many times in forums that people complained about iDempiere failing, and it was because they simply enabled the "Translated" flag without taking care of creating the table, so it is very easy to mess up a system.

Regards,

Carlos Ruiz



El 17/3/22 a las 15:14, Martin Schönbeck escribió:

Martin Schönbeck

unread,
Mar 17, 2022, 4:56:59 PM3/17/22
to iDempiere
Hi Carlos,



Carlos Antonio Ruiz Gómez schrieb am Donnerstag, 17. März 2022 um 15:30:08 UTC+1:
I see Martin, maybe that's something worthy to clarify in the documentation of Create/Complete Table

Done
 
If I recall correctly, the thing is that it is not intended to add columns to the _Trl table, what is intended is that you mark the columns in the main table as Translated, and then create the translation table.

When doing the addition on the productive system I first set Translated flag on the column, but I had to add it manually after creating the translation table. Of course it would be nice to have this been done by the 'Create/Complete Table'
 
BTW, I remember also that the Technical field group is collapsed because we found many times in forums that people complained about iDempiere failing, and it was because they simply enabled the "Translated" flag without taking care of creating the table, so it is very easy to mess up a system.

When setting the flag I got a big hint to create this field in the translation table. But I guess nobody reads those messages.

Regards,
Martin
Reply all
Reply to author
Forward
0 new messages