Jump to content
  • 0

Change Language in DataPages


QueenB

Question

5 answers to this question

Recommended Posts

  • 0

Hi @QueenB,

 

By default, computer browsers has an ability to translate the language of the pages automatically. 

One other possible solution is to create different DataPages for different Languages. Then, you will have an HTML block with a link inside that will redirect to the other DataPage based on the selected language.

Hope this helps.

 

-kristina

Link to comment
Share on other sites

  • 0

Hi QueenB,

Please consider using Google Translate Button widget.
Check the guide at w3school: https://www.w3schools.com/howto/howto_google_translate.asp
The details on usage of this widget are in this Google Developers' Blog post:  
https://developers.google.com/search/blog/2020/05/google-translates-website-translator
It might worth sing-up your subdomain in the form by the link in the article,  as it is required by Google.

I have put the JS code in the Footer of Form, Report and HTML DataPage and it works as expected. All the DataPage text content is being translated to the language chosen in the widget.

Regards,

Link to comment
Share on other sites

  • 0

Hi everyone!

I thought of sharing it here since this seems kind of related, but if you wish to prevent certain elements (HTML elements, field labels, etc.) on a DataPage to be translated by the web page's translate option, you can use the "translate" attribute and set it to "no":

For custom elements created on HTML blocks, they would look something like:

<p translate="no">Company name</p>

For labels of DataPage fields, it would require script. You would first have to select the element you want to be prevented from translation using a document.querySelector and use the setAttribute() method to add the "translate" attribute and set its value to "no", like so:

<script>
document.querySelector("[for='InsertRecordField1']").setAttribute("translate", "no");
</script> 

 

before translation:

image.png.6e27422192e68899104d7e17095f70d4.png

after translation, without the solution indicated above (texts are translated from english to filipino by the way):

image.png.de48605f1b64a1922a0d4440516f599f.png

 

 

after translating, with the solution applied on "Company name" and "Field1":

image.png.d2760643d98b87ff69c3e2d161578ff0.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...