Translation - Pages

I am looking at gtranslate.io as a viewer translation tool. It can translate any HTML website, but I’m guessing that Glide is not in that category - can someone confirm this? I played around with the free version and can’t figure out any way of using the code that was generated. It looks like this:

< div class=“gtranslate_wrapper”>
< script>window.gtranslateSettings = {“default_language”:“en”,“detect_browser_language”:true,“languages”:[“en”,“fr”,“de”,“it”,“es”,“zh-CN”],“wrapper_selector”:“.gtranslate_wrapper”,“switcher_horizontal_position”:“right”,“switcher_vertical_position”:“top”}
< script src=“https://cdn.gtranslate.net/widgets/v1.0.0/dwf.js” defer>

(I had to insert spaces after the < for the code to show up here)

Any insight would be appreciated as to if this is even possible in Glide Pages. Thanks!

and where are you planning to insert that code? :wink:

LOL I have no idea - not even sure if I can. Just looking for a way for a viewer to chose another language to translate an app. If I can’t use this, I may just make the page in wordpress.

yep… you can paste that code there at the beginning of HTML…

in Glide, you can translate text using fetch JSON, and substitute it with a template column

1 Like

Okay - so I think I’m supposed to paste the URL part into the URL field and this part into the JQ Query part
window.gtranslateSettings = {“default_language”:“en”,“detect_browser_language”:true,“languages”:[“en”,“fr”,“de”,“it”,“es”,“zh-CN”],“wrapper_selector”:“.gtranslate_wrapper”,“switcher_horizontal_position”:“right”,“switcher_vertical_position”:“top”}

But that doesn’t seem to be working. Not sure what I’m doing wrong.

no… i don’t know this service so I would have to experiment with that… but this is not how Query works

1 Like

Thanks, I haven’t been able to find any instructions on how to do it so was hoping to make it work.

Just for future reference, you can format code blocks using triple back ticks.

So this:

Will render like this:

<div class=“gtranslate_wrapper”>
<script>window.gtranslateSettings = { 
  “default_language”:“en”,
  “detect_browser_language”:true,
  “languages”: [“en”,“fr”,“de”,“it”,“es”,“zh-CN”],
  “wrapper_selector”:“.gtranslate_wrapper”,
  “switcher_horizontal_position”:“right”,
  “switcher_vertical_position”:“top”
}
<script src=“https://cdn.gtranslate.net/widgets/v1.0.0/dwf.js” defer>
1 Like

Thanks. One of my sons is a software developer so I’m going to see if he can help me figure out the JSON stuff this weekend.

I can’t say for certain, but I don’t think it will be possible.

1 Like

Always worth a try. Uzo has something working on his demo so that might be my plan B

1 Like

buy me a beer o two… and ill make you a JSON translator :wink:

@kabookie if you want something that will do dynamic translations at the Glide Table level, I have a code column that will do the job (I originally copied it from David).

It uses the Google Translation API and requires an API key.

I use it in together with static translations whenever I need to support multiple languages.

You’re welcome to use it (or fork it) if it suits your purpose.

that is a complicated method, just fetch directly from google using the fetch column… no API key, and no quota limits :wink:

really fast… instant translation while typing.

1 Like

I did see that but when I tried to implement, I got lost in the google API world - too many choices to make that I couldn’t figure out :crazy_face:

My goal is for the user to select a language and then be able to read the page in that language - not an entry based translation. That is why I liked what I saw with gtranslate

I know, but you can’t do that in glide… so what you can do… is let users select their language… and then have all your text in your app, to be translated… you can also use a navigator or IP address to detect visitor language, so they don’t need to choose.

I did that in my book App:

1 Like

Hmmm… I may be buying you those beers.

1 Like

beer button

I made a sample for you :wink: