Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

Translating/updating image and text link in web form

jasonw30638826
Level 4
Level 4

Hi,

I am working on creating a web form in English and French. I am able to translate the text but not the images and hyperlinks. Is there any way to use different images and link for different languages. I can't find image or hyperlink from the translation setting below.

1847358_pastedImage_0.png

Thanks,

7 Replies
Jyoti_Y
Community Advisor
Community Advisor

Hi,

You can add URL translation at :

Administration --> Configuration --> Global Dictionary --> User Dictionary.

Enter your url in preferred language. Choose correct language and approve your translation.

Note: Make sure sourceId and sourceStringId is correctly mapped. Your translation should be mapped to correct webApp, so that it can translate it correctly.

Thanks.

jasonw30638826
Level 4
Level 4

Hi,

Thanks for your reply.

My issue is I don't know that what SourceID and SourceStringId to be used in HTML for URLs.

For example the HTML code below, I am able to translate "Learn more", but not sure how to add sourceID to the URL "http://www.google.com" to translate to "http://www.google.fr"

<div><a class="nl-dce-translate" id="subNewsletter.htmlPage.line11" href="http://www.google.com/en" data-nl-localizable="true">Learn more</a></div>

Please send me an example on how to add the sourceID to the URL above.

Thanks,

jasonw30638826
Level 4
Level 4

Hi,

This is not resolved, can anyone help with this?

Thanks,

wodnicki
Community Advisor
Community Advisor

Hi,

Use this:

<div><a class="nl-dce-translate" id="subNewsletter.htmlPage.line11" href="http://www.google.<%= NL.session.locale.getLanguage() === 'fr' ? 'fr' : 'com' %>" data-nl-localizable="true">Learn more</a></div>

Thanks,

-Jon

jasonw30638826
Level 4
Level 4

Hi Jon,

Thanks for you help, I think this works great for this case. However, most of the time, English and French URL will be totally different.

Case 1 hyperlink:

<div><a class="nl-dce-translate" id="subNewsletter.htmlPage.line11" href="http://englishsite11.com" data-nl-localizable="true">Learn more</a></div>

I'd like to translate the URL above from http://englishsite11.com/ to http://frenchsite22.com

Case 2 image link:

<div><a href="https://www.englishsite11.com/"><img src="https://englishsite11.com/logoEN.jpg" alt="logo"></a></div>

I'd like to translate  https://www.englishsite11.com/  to http://frenchsite22.com/  and

translate from https://englishsite11.com/logoEN.jpg to https://frenchsite22.com/logofr.jpg

Thanks in advance!

Jason

wodnicki
Community Advisor
Community Advisor

<div><a class="nl-dce-translate" id="subNewsletter.htmlPage.line11" href="<%= NL.session.locale.getLanguage() === 'fr' ? 'http://frenchsite22.com' : 'http://englishsite11.com' %>" data-nl-localizable="true">Learn more</a></div>

<div><a href="<%= NL.session.locale.getLanguage() === 'fr' ? 'http://frenchsite22.com' : 'http://englishsite11.com' %>"><img src="<%= NL.session.locale.getLanguage() === 'fr' ? 'https://frenchsite22.com/logofr.jpg' : 'https://englishsite11.com/logoEN.jpg' %>" alt="logo"></a></div>

jasonw30638826
Level 4
Level 4

Thank you so much Jon! I tried your code, when I tested the French version of the form, like https://mysite.com/webApp/webform?lang=fr, it still shows the English link, http://englishsite11.com/. I assume this will work when user's computer locale set to a French location?

Thanks Again.

Jason