[Solved] Unable to tag elements for translation

At the moment I have a separate script that retrieves a text string from a html snippet that contains the translation and based on the locale it picks the right one.

As I want to try to stick to the OL way of working I decided to change this to working with translation files. It is also way cleaner and will probably make things faster as I no longer have to call a script for each piece of text I require on the document.

I do make extensive use of scripts within my document templates and on most of my documents I use a script to create an address table that, depending on what the document requires, creates a table with 1, 2 or 3 address sections with a title and address details.
The titles for the table are coming from the html snippet and are based on locale.

Unfortunately I am unable to tag the titles for translation. This kind of makes sense as translations are done before any script executes and as the table is completely created via a script there is nothing to tag.

Is there a way around this so I can still tag the titles for translation?
I looked at the specific tag in the html but using this in other places is not enough as there is no link between the tag and the translation.

Thanks

Hi @dvdmeer,

We also translate content added by scripts.

Please see “Tagging text that is inserted by a script” at PReS Connect 2022.1 User Guide

If you are still having trouble please attach or pm your template (ideally stripped down so that it only contains the relevant parts) and I’ll take a look.

Thank you very much. I was not aware of this but it makes a lot of sense.
I have been able to translate a lot of the items but now I would like to test this further. In order to do that I need to set the correct locale.
So I have added the translation (po file) to the template. I want the locale to be based on one of the fields in the datamapper but for some reason a lot of the options are not available:

image

I tried the sync button but still the list of Data fields is empty. When I select Parameter the Data field drop down list is even greyed out, even though I know there are parameters defined.
Only the first 2 options work, so I can use the System locale or specifically set a locale.

Am I doing something wrong?

Does your data field reside in the root of the Data Model?

No, it is one level deeper.

Ok, I have now moved my locale field to the root and now it can be found. Thank you.