Page 1 of 1

How to translate only some text in a textbox

Posted: June 8th, 2022, 9:44 pm
by CathyC
I have a page with a text area that I populate text in. Here is what it looks like
Translate tags showing.png
I have some text at the top followed by a bunch of addresses. The text needs to be translated, but the addresses shouldnt be
I see the text box has a "Translate" property on it.
address restrictions.PNG
I know then when there is text in an html generic control i should put it in <EPTranslate></EPTranslate> tags

I tried setting it to Translate False and putting the tags around the text I want translated, but it shows the translate tags too.

Is there a way to do this?

Re: How to translate only some text in a textbox

Posted: June 8th, 2022, 10:20 pm
by CathyC
I ended up changing the title to carry the text I need translated. I'm curious if the partial translate within the textbox is possible, but I found a workaround, so its no longer needed.

I did find though that the refresh of the page did not create the translation record. I had to manually create the record in the IDE work with translations screen. After it existed in the dictionary, it translated.

Is it something about translating the textbox title that is not working?
address restrictions UI with changed title.png
address restrictions UI with changed title.png (7.95 KiB) Viewed 1721 times
address restrictions UI with changed title.png
address restrictions UI with changed title.png (7.95 KiB) Viewed 1721 times

Re: How to translate only some text in a textbox

Posted: June 9th, 2022, 8:20 am
by SteveCap
The translate flag only turns in on/off for all text. To only translate partial text you would have to set the control translate = false. Then use a translate service on the text you want translated and then use a create service node to set the text property.

Re: How to translate only some text in a textbox

Posted: June 9th, 2022, 11:50 am
by CathyC
Ah the Translate service! Thanks, I didnt think of that. I see now that wouldve worked.

As for my second question, do you see any reason why it didn't automatically create the dictionary record?
Most of my application is translated and exists in the dictionary as a record now, but I want to make sure that the functionality to create new dictionary records is working still. Or if there is something special about the textbox title that makes it not work like expected.

Re: How to translate only some text in a textbox

Posted: June 9th, 2022, 1:22 pm
by SteveCap
Did you maybe still have translate set to false? It should have created the record and don't see anything that would have caused it not to other than that flag.

Re: How to translate only some text in a textbox

Posted: June 9th, 2022, 3:43 pm
by CathyC
Ah thank you. I think I was thinking of the flag as the textbox itself, but it controls for the title and the text area. So similarly, if I had a textbox that shouldnt get translated, but a title that should, I would need to use a translate service for the text I want to display in the title and turn Translate Off for the textbox. Is that right?

Re: How to translate only some text in a textbox

Posted: June 9th, 2022, 4:03 pm
by SteveCap
That would be correct