Languages Supported in Google Translate - Digital Inspiration

Languages Supported in Google Translate

L
Published in: Google Apps Script

The multilingual chat program in Google Sheets internally uses the Language App service to perform the translation. When a user enters any text, the onEdit() method is triggered which performs the translation and updates the sheet.

You can also use the GoogleTranslate() formula to perform inline language translations without using Google Apps Script. And you can perform translation in all languages that are supported by Google Translate.

function onEdit(e) {

  try {

    var cell = e.range.getA1Notation();

    if ( e.value && (cell === "A6" || cell === "E6") ) {

      var sheet = e.source.getActiveSheet();
      var data = sheet.getRange("C4:G5").getValues();

      var langA  = getLanguage(data[1][0]);
      var langB  = getLanguage(data[1][4]);

      if (langA === "" || langB === "") {
        Browser.msgBox("Please select the languages of participants from the dropdowns in cell C5 and G5");
        return;
      }

      if (langA === langB) {
        Browser.msgBox("Please select a different language for each chat participant");
        return;
      }

      var userA = data[0][0];
      var userB = data[0][4];

      var colA, colB;

      if (cell === "A6") {
        colA = userA + ": " + e.value;
        colB = userA + ": " + LanguageApp.translate(e.value, langA, langB);
      } else {
        colA = userB + ": " + LanguageApp.translate(e.value, langB, langA);
        colB = userB + ": " + e.value;
      }

      sheet.appendRow([colA, "", "", "", colB]);

      e.range.clearContent();

    }
  } catch (error) {
    Browser.msg(error.toString());
  }
}

Google Translate Languages

This is a list of languages and their ISO languages Codes that are currently supported by Google Translate. When sending the translation request to the Language Translation API, as in the case of translating RSS Feeds, always make sure that the two language codes are different.

Language NameLanguage Code
Afrikaansaf
Irishga
Albaniansq
Italianit
Arabicar
Japaneseja
Azerbaijaniaz
Kannadakn
Basqueeu
Koreanko
Bengalibn
Latinla
Belarusianbe
Latvianlv
Bulgarianbg
Lithuanianlt
Catalanca
Macedonianmk
Chinese Simplifiedzh-CN
Malayms
Chinese Traditionalzh-TW
Maltesemt
Croatianhr
Norwegianno
Czechcs
Persianfa
Danishda
Polishpl
Dutchnl
Portuguesept
Englishen
Romanianro
Esperantoeo
Russianru
Estonianet
Serbiansr
Filipinotl
Slovaksk
Finnishfi
Sloveniansl
Frenchfr
Spanishes
Galiciangl
Swahilisw
Georgianka
Swedishsv
Germande
Tamilta
Greekel
Telugute
Gujaratigu
Thaith
Haitian Creoleht
Turkishtr
Hebrewiw
Ukrainianuk
Hindihi
Urduur
Hungarianhu
Vietnamesevi
Icelandicis
Welshcy
Indonesianid
Yiddishyi
📮  Subscribe to our Email Newsletter for Google tips and tutorials!
Published in: Google Apps Script

Looking for something? Find here!

Meet the Author

Web Geek, Google Developer Expert
A
Amit Agarwal

Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India. He is the developer of Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory

Get in touch

Google Add-ons

Do more with your Gmail and GSuite account
G

We build bespoke solutions that use the capabilities and the features of Google Workspace for automating business processes and driving work productivity.

  1. Mail Merge with Attachments
    Send personalized email to your Google Contact with a Google Sheet and Gmail
  2. Save Emails and Attachments
    Download email messages and file attachments from Gmail to your Google Drive
  3. Google Forms Email Notifications
    Send email notifications to multiple people when a new Google Form is submitted
  4. Document Studio
    Create beautiful pixel perfect documents merging data from Google Sheets and Google Forms
  5. Creator Studio for Google Slides
    Turn your Google Slides presentations into animated GIFs and videos for uploading to YouTube