Skip to content

Kazuki-tam/gas-deepl-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gas-deepl-starter

gas-deepl-starter is a starter kit to use DeepL on Google Sheets.

This template is inspired by DeepL API - Google Sheets Example.

Status

Release (latest by date) Issues Maintenance Release date

Features

  • Translate multiple texts from one language to another at once using the DeepL Translation API and Google Apps Script
  • Develop locally with TypeScript, Clasp and Deno
  • Bundle your files with esbuild

Main dependencies

Prerequisites

🦕 How to install Deno

How to use

Creating a repository from this template and cloning the repository.

Login google account

deno task login

Connect to your existing project

Create a .clasp.json at the root, and then add these settings. Open the app script from your spreadsheet and check out your script id on the setting page.

{
  "scriptId": "<SCRIPT_ID>",
  "rootDir": "./dist"
}

Set DeepL auth key into script properties

  1. Copy your authentication key at the DeepL account
  2. Set the authentication key into script properties in your Apps Script project.
Key: DEEPL_AUTH_KEY
value: <YOUR-AUTH-KEY>

📖 How to add script properties

Upload a script project

Deploy your code to the existing project.

deno task deploy

DeepLTranslate function

Translates from one language to another using the DeepL Translation API.

// Example 1 on Google Sheets
=DeepLTranslate(A1, "en", "JA")

// Example 2 on Google Sheets
=DeepLTranslate(A1, "ja", "FR")

// Example 3 on Google Sheets
=DeepLTranslate(A1, "ja", "EN")

DeepLUsage function

Retrieve information about your DeepL API usage during the current billing period.

// Example 1 on Google Sheets
=DeepLUsage("count")

// Example 2 on Google Sheets
=DeepLUsage("limit")

Available Commands

Build your project.

deno task build

Build your project files and force writes all local files to script.google.com.

deno task deploy

Open the current directory's clasp project on script.google.com.

deno task open

DeepL

The DeepL API provides programmatic access to DeepL’s machine translation technology, making it possible to bring high quality translation capabilities directly to your websites and applications.

Google Apps Script

Google Apps Script is a JavaScript-based scripting language that allows you to extend Google's G Suite of online productivity tools (e.g. Google Sheets, Google Forms, Gmail, etc.). It allows you to automate tasks, connect to external APIs, and build custom tools and applications that interact with G Suite data.

📖 Reference overview

Clasp

Clasp (Command Line Apps Script Projects) is a command-line tool that allows you to develop, manage, and deploy Google Apps Script projects.

📖 Command Line Interface using clasp

License

MIT

About

Translate multiple texts from one language to another at once using the DeepL Translation API and Google Apps Script.

Resources

License

Stars

Watchers

Forks

Packages

No packages published