File Exchange

image thumbnail

Google(R) Translate

version (3.7 KB) by Michael Katz
Translates a string between languages using Google(R)'s Language API.


Updated 01 Sep 2016

View Version History

View License

This file uses MATLAB(R)'s web services with Google's AJAX Language Translation API to take one string and translate it to anther:
For example to translate a string to Sweedish:

>> gtranslate('Good morning Mr. Peterson, how is your cat?','sv')

ans =

God morgon Mr Peterson, hur är din katt?

You can specify source (default is English) and destination languages using the two-letter codes.

Note that the default character encoding may make some languages (Russian, Japanese, etc) unrenderable.

Cite As

Michael Katz (2021). Google(R) Translate (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (11)


lotus whit

I have the following error
Please use Translate v2. See, when i call the function ,although i have authentication account on google cloud platform and billing account , i don't know if should be enable some setting in my internet browser, any one help?

lotus whit

How can set API key v2 befor using gtranslate?

mohamed hamdy

dosn't work can you update this code
to translate from english to arabic plz


is there any other than google translate...?
coz now google translate web service become paid service...

Michael Katz

@Yuri, @hanan,

I believe this a limitation of the font that is only able to show latin characters. I am not sure how to change the font for GUI controls.


not working when I translate from English to Arabic.

Any Help?

Yuri K

Cool! Works well with latin characters languages. Any idea how to translate to/from let's say russian, japanese?

Husam Aldahiyat

Nice one.

Michael Katz

I added the wrong file, please wait for the update to get approved. Otherwise download the JSON Parser from


it isn't working.
i got this:
gtranslate('Good morning Mr. Peterson, how is your cat?','sv')
??? Error using ==> urlread at 108
Error downloading URL.

Error in ==> gtranslate at 43
page = urlread(url, 'get', {'v', '1.0','q', inputString, ...

but should be a funny tool, if it would run

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!