Skip to content

Instantly share code, notes, and snippets.

@chipoglesby
Last active August 29, 2015 14:21
Show Gist options
  • Select an option

  • Save chipoglesby/c215b9693e91601a2cc4 to your computer and use it in GitHub Desktop.

Select an option

Save chipoglesby/c215b9693e91601a2cc4 to your computer and use it in GitHub Desktop.
Translating Google Spreadsheet cells using Google Translate
function onEdit(e) {
var sheet = SpreadsheetApp.getActiveSheet();
var name = sheet.getName();
var cell = sheet.getActiveCell();
var value = cell.getValue();
if (typeof value == 'string') {
var spanish = LanguageApp.translate(value, 'en', 'es');
cell.setValue(spanish);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment