How to export and import a batch translation?

1
We are about to translate an application from Dutch to English. But we would like to export the Dutch labels and import their English translation at a later time. Sadly, the batch translate feature in the Modeler does not have export/import functionality. Is there another way? Is there perhaps a SQL-script we could use on the model database? Thanks in advance dor suggestions.
asked
2 answers
4

Note: I have made some edits since first posting this answer to make things more clear.

You are right that there is no export/import functionality in the batch translation form. That could be a feature request.

I think something could be done by working directly on the Modeler project database. You would have to look at the table I18N_Item. Rows in this table with the same _ContainerID refer to the same translatable text in the Modeler. The language code column tells you for which language the item is. For example, in a database I am looking at now there are two rows with _ContainerID 3343 and they have "Next" en "Volgende" in their Text column.

By selecting the text column of all rows with language code nl_NL you will get all the texts you would have to translate. You could fill a table with those. I am no SQL wizard so I'll leave the queries as an exercise for the reader :-) Create a table with two columns: one for the Dutch text and one for the English text. Fill the English translations either in the database or exporting the table to some other format and importing it back in. SQLite manager, a Firefox plugin, has support for exporting and importing.

After this, you have your table with translations and you will have to apply them to the Modeler texts. First clear the English language using Tools > Language Operations. This makes sure that no items with code en_US remain. Afterwards, for each Dutch text you look up all rows in I18N_Item that have that same text in their Text column. You then insert an I18N_Item with the following columns:

  • _ID is a unique number greater than the value _NewObjectID in the _Metadata table.
  • _Revision is 1.
  • _ContainerID is the same as the _ContainerID of the Dutch item.
  • _SubType is "I18N_Item".
  • LanguageCode is "en_US".
  • Text is the English translation.

After doing all this make sure to increase the _NewObjectID value in the _Metadata to a number higher than the highest _ID you have given to a I18N_Item.

Oh, and make a backup of your project if you attempt any of this! I haven't tested this process and I could have made a mistake in my description.

answered
1

I've created two small WinTask scripts to export to and from Excel via the GUI. Not fancy, but allowed me to have translations done by somebody else in Excel.

The tricky part is when changes in the application insert new translatable items or remove (rename) them, because the english translation is the key.

answered