gas-deepl-starter
is a starter kit to use DeepL on Google Sheets.
This template is inspired by DeepL API - Google Sheets Example.
- 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
Creating a repository from this template and cloning the repository.
deno task login
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"
}
- Copy your authentication key at the DeepL account
- 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
Deploy your code to the existing project.
deno task deploy
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")
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")
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
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 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.
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
MIT