# Translate Column

**URL:** <https://community.glideapps.com/t/translate-column/30668>\
**Category:** Ask for Help\
**Tags:** custom-code\
**Created:** [August 19, 2021, 7:10am UTC](https://community.glideapps.com/t/translate-column/30668 "2021-08-19T07:10:22Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aymeric\_de\_Maussion](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/aymeric_de_maussion/32/29505_2.png) [@Aymeric\_de\_Maussion](https://community.glideapps.com/u/Aymeric_de_Maussion)\
**Post date:** [August 19, 2021, 7:10am UTC](https://community.glideapps.com/t/translate-column/30668/1 "2021-08-19T07:10:22Z")

</div>

Hi,

Is there someone who did a Yes code column to translate another column ?

Thank you

---

<div class="post-metadata">

**Author:** ![Mark\_Turrell](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark_turrell/32/26605_2.png) [@Mark\_Turrell](https://community.glideapps.com/u/Mark_Turrell)\
**Post date:** [August 19, 2021, 7:56am UTC](https://community.glideapps.com/t/translate-column/30668/2 "2021-08-19T07:56:17Z")

</div>

Thee we I would be a lovely add-on to Glide apps - great idea!

---

<div class="post-metadata">

**Author:** ![david](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david/32/62831_2.png) [@david](https://community.glideapps.com/u/david)\
**Post date:** [August 19, 2021, 8:08am UTC](https://community.glideapps.com/t/translate-column/30668/3 "2021-08-19T08:08:11Z")

</div>

Here you go: [https://replit.com/@dvdsgl/glide-translate-column](https://replit.com/@dvdsgl/glide-translate-column)

![CleanShot 2021-08-19 at 11.16.45](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/9/096d7df9d064e7a1046a27771e29f1916de77118.gif)

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [August 19, 2021, 8:11am UTC](https://community.glideapps.com/t/translate-column/30668/4 "2021-08-19T08:11:50Z")

</div>

excellent,  
thanks david

---

<div class="post-metadata">

**Author:** ![Aymeric\_de\_Maussion](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/aymeric_de_maussion/32/29505_2.png) [@Aymeric\_de\_Maussion](https://community.glideapps.com/u/Aymeric_de_Maussion)\
**Post date:** [August 19, 2021, 8:16am UTC](https://community.glideapps.com/t/translate-column/30668/5 "2021-08-19T08:16:18Z")

</div>

Amazing thanks a lot @david

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [August 19, 2021, 8:22am UTC](https://community.glideapps.com/t/translate-column/30668/6 "2021-08-19T08:22:42Z")

</div>

If I can afford Master David,  
as it is a paid API (well after a while), is it possible to add a Cache, to avoid a call to the API each time the YC column is refreshed

---

<div class="post-metadata">

**Author:** ![Mark\_Turrell](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark_turrell/32/26605_2.png) [@Mark\_Turrell](https://community.glideapps.com/u/Mark_Turrell)\
**Post date:** [August 19, 2021, 8:24am UTC](https://community.glideapps.com/t/translate-column/30668/7 "2021-08-19T08:24:00Z")

</div>

I have forked the code (big thanks 🌟) but my forked version (unchanged from the fork) does not allow me to save - any ideas?

(and I am putting my own API key in 🙂  
Thanks!

 ![Screenshot 2021-08-19 at 10.22.25](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/0/406bd69c8517be95b8f644b1d9be605fd0778386.png)  
 ![Screenshot 2021-08-19 at 10.22.39](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/8/f81a6a39f15ccc0a0550c76a8ab9f28cffdf5a42.png)

---

<div class="post-metadata">

**Author:** ![david](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david/32/62831_2.png) [@david](https://community.glideapps.com/u/david)\
**Post date:** [August 19, 2021, 8:25am UTC](https://community.glideapps.com/t/translate-column/30668/8 "2021-08-19T08:25:18Z")

</div>

> [@Manu.n](#):
>
> is it possible to add a Cache, to avoid a call to the API each time the YC column is refreshed

It is possible.

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [August 19, 2021, 8:36am UTC](https://community.glideapps.com/t/translate-column/30668/9 "2021-08-19T08:36:56Z")

</div>

Hi @Mark_Turrell  
(it’s late for david 😴 )  
Maybe I can answer you.  
For the 1st image, rename manifest.json to glide.json

For the 2nd  
Test with lowercase “fr”

> **[Langues acceptées  |  Cloud Translation  |  Google...](https://cloud.google.com/translate/docs/languages?hl=fr)**

---

<div class="post-metadata">

**Author:** ![david](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david/32/62831_2.png) [@david](https://community.glideapps.com/u/david)\
**Post date:** [August 19, 2021, 8:44am UTC](https://community.glideapps.com/t/translate-column/30668/10 "2021-08-19T08:44:00Z")

</div>

@Mark_Turrell it also looks like you are using my repl still.

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [August 19, 2021, 10:08am UTC](https://community.glideapps.com/t/translate-column/30668/11 "2021-08-19T10:08:40Z")

</div>

Can’t remember how to convert a format  
“C&#39 ;est super ce truc” in  
“C’est super ce truc”

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/d/5d32fa017be66e91086060bd862a473e41b570d8.png)

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [August 19, 2021, 10:12am UTC](https://community.glideapps.com/t/translate-column/30668/12 "2021-08-19T10:12:03Z")

</div>

We have encodeURI to encode, to reverse this does decodeURI help?

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [August 19, 2021, 10:14am UTC](https://community.glideapps.com/t/translate-column/30668/13 "2021-08-19T10:14:58Z")

</div>

Hi @ThinhDinh  
no it didn’t work

---

<div class="post-metadata">

**Author:** ![david](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david/32/62831_2.png) [@david](https://community.glideapps.com/u/david)\
**Post date:** [August 19, 2021, 10:22am UTC](https://community.glideapps.com/t/translate-column/30668/14 "2021-08-19T10:22:28Z")

</div>

The Google translation API probably has a parameter to control the response format. By default this looks like HTML escaped text.

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [August 19, 2021, 10:31am UTC](https://community.glideapps.com/t/translate-column/30668/15 "2021-08-19T10:31:13Z")

</div>

I did a test with this, but it’s still pariel.

“Content-Type: application/json; charset=utf-8”

---

<div class="post-metadata">

**Author:** ![david](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david/32/62831_2.png) [@david](https://community.glideapps.com/u/david)\
**Post date:** [August 19, 2021, 11:23am UTC](https://community.glideapps.com/t/translate-column/30668/16 "2021-08-19T11:23:18Z")

</div>

That’s not the API.

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [August 19, 2021, 11:28am UTC](https://community.glideapps.com/t/translate-column/30668/17 "2021-08-19T11:28:48Z")

</div>

It’s me then 🙂  
I’m not having much luck with Google APIs 🤤

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [August 19, 2021, 11:53am UTC](https://community.glideapps.com/t/translate-column/30668/18 "2021-08-19T11:53:33Z")

</div>

Well I made an old-fashioned conversion

```auto

function unicode2Ascii(str) {
  var code = str.match(/&#(\d+);/g);
  if (code === null) {
    return str;
  }
  for (var i = 0; i < code.length; i++) {
    str = str.replace(code[i], String.fromCharCode(code[i].replace(/[&#;]/g, '')));
  }
  return str;
}

```

---

<div class="post-metadata">

**Author:** ![Manu.n](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manu.n/32/11679_2.png) [@Manu.n](https://community.glideapps.com/u/Manu.n)\
**Post date:** [August 19, 2021, 12:12pm UTC](https://community.glideapps.com/t/translate-column/30668/19 "2021-08-19T12:12:18Z")

</div>

I allowed myself to add my personal touch to the excellent code of @David.  
In particular a small ‘cache’, the selection of the client’s local language and a Unicode to Ascii conversion.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/7/87cf64d12ef0c6857541a3a46ea83e1a5096d1cb.png)

YC link  
[https://glide-translate-column-Modif.manun2.repl.co](https://glide-translate-column-Modif.manun2.repl.co)

YC Souce

> **[glide-translate-column-Modif](https://replit.com/@ManuN2/glide-translate-column-Modif?v=1)**
>
> A HTML, CSS, JS repl by ManuN2

---

<div class="post-metadata">

**Author:** ![Aymeric\_de\_Maussion](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/aymeric_de_maussion/32/29505_2.png) [@Aymeric\_de\_Maussion](https://community.glideapps.com/u/Aymeric_de_Maussion)\
**Post date:** [August 19, 2021, 12:24pm UTC](https://community.glideapps.com/t/translate-column/30668/20 "2021-08-19T12:24:28Z")

</div>

“C’est vraiment super ce truc” 😉 Thanks @Manu.n for you code

[Next page](https://community.glideapps.com/t/translate-column/30668.md?page=2)
