Language translation of column content

42 views
Skip to first unread message

Amir Gonen

unread,
Jul 22, 2022, 12:53:07 PM7/22/22
to OpenRefine
Hello - I apologize for what I assume to be a stupid question (playing with OpenRefine only one day now ..) - also, not a SW developer or anything like that. 

I am having a pretty long list of people's names in a column (all in a specific language), and I want to create another column with these names written in another language. 

It feels as if I had a way to make OpenRefine "interact" (using an API, etc) with Google translate, that would do the trick for me.  Can I invoke anything like that using GREL ? 
something along the lines of GREL_func_google_traslate(value,  src_lang, dst_lang) ?

thanks much, 
Amir

Antoine Beaubien

unread,
Jul 23, 2022, 5:24:33 PM7/23/22
to OpenRefine
If you want to use an external service, you should probably create a new column from a URL Query (of the Google translation service). No such thing exists purely in GREL. You could write it in Python, though.

Regards,
   Antoine Beaubien

hervé Piedcoq

unread,
Jul 24, 2022, 1:37:35 AM7/24/22
to openr...@googlegroups.com
- If you have python3 on your machine you can use LibreTranslate, a free local opensource that provides a translator server with an API.

- working with google translate properly will implicate the use of an api key. Their API is based on POST method, not handled by GREL so far. It’s possible to do it with jython, but not trivial.

- working with yandex translate also needs a free API key but works with GET requests. So you can craft a specific url with refine containing the API key plus the text to translate and get the result using the fetch url function.
See here for the url : 


Hervé 



--
You received this message because you are subscribed to the Google Groups "OpenRefine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrefine+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openrefine/b0d1fbd8-1008-4e3c-9138-1e000c266bc1n%40googlegroups.com.

Amir Gonen

unread,
Jul 24, 2022, 11:32:21 AM7/24/22
to OpenRefine
thanks much !
Reply all
Reply to author
Forward
0 new messages