An open API service indexing awesome lists of open source software.

https://github.com/yaza-putu/google-sheets-translator

This project allows you to translate an Excel file across all sheets using Google Spreadsheetโ€™s built-in translation features, eliminating the need for manual translation. With just one click, all sheets are translated automatically.
https://github.com/yaza-putu/google-sheets-translator

auto-translation excel-translation google-sheet google-sheet-translation translation

Last synced: about 1 month ago
JSON representation

This project allows you to translate an Excel file across all sheets using Google Spreadsheetโ€™s built-in translation features, eliminating the need for manual translation. With just one click, all sheets are translated automatically.

Awesome Lists containing this project

README

          

# ๐ŸŒ Auto Translate Google Sheets

Automatically translate Google Sheets to any language and download as Excel.

---

## ๐Ÿ“‹ Table of Contents

- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Language Codes](#language-codes)
- [Troubleshooting](#troubleshooting)
- [FAQ](#faq)

---

## โœจ Features

- โœ… Translate single sheet or all sheets at once
- โœ… Create new sheet/file to keep original data safe
- โœ… Support 100+ languages
- โœ… 100% free (uses built-in Google Translate API)
- โœ… Export results to Excel (.xlsx)
- โœ… No external API key required

---

## ๐Ÿ“ฆ Installation

### Step 1: Prepare Your Google Sheets File

**Option A - Upload Excel File:**
1. Go to `drive.google.com`
2. Click **"+ New"** โ†’ **"File upload"**
3. Upload your Excel file
4. Right-click the file โ†’ **"Open with"** โ†’ **"Google Sheets"**
5. **IMPORTANT:** Click **File** โ†’ **"Save as Google Sheets"**
- This converts Excel to Google Sheets format
- **Extensions menu will NOT appear** without this step!

**Option B - Create New File:**
1. Go to `sheets.google.com`
2. Click **"+ Blank"** to create a new spreadsheet

**Option C - Use Existing File:**
1. Go to `sheets.google.com`
2. Click the file you want to translate
3. If file is in Excel format (.xlsx), click **File** โ†’ **"Save as Google Sheets"** first

> โš ๏ธ **CRITICAL:** If you don't see the **Extensions** menu, you MUST convert the file to Google Sheets format first by clicking **File โ†’ Save as Google Sheets**!

### Step 2: Open Apps Script Editor

1. In Google Sheets, click the **Extensions** menu
- If you don't see **Extensions** menu, go to **File โ†’ Save as Google Sheets** first!
2. Select **Apps Script**
3. A new tab will open (Apps Script Editor)

### Step 3: Paste Script

1. In Apps Script Editor, **delete all default code**
2. **Copy the script** provided (see `Code.gs` file)
3. **Paste** into the editor (Ctrl+V)
4. Click **Save** (๐Ÿ’พ or Ctrl+S)
5. Name your project: `Auto Translator`

### Step 4: Run Script (IMPORTANT!)

1. In Apps Script Editor, make sure **`onOpen`** function is selected in the dropdown (top center)
2. Click the **Run** button (โ–ถ๏ธ)
3. An **"Authorization required"** dialog will appear
4. Click **"Review Permissions"**
5. Choose your Google account
6. Click **"Advanced"** (bottom left)
7. Click **"Go to Auto Translator (unsafe)"**
8. Click **"Allow"**

> **Note:** This is normal for custom scripts. Google warns you because it's not a verified app.

### Step 5: Verify Menu Appears

1. **Go back to Google Sheets tab**
2. **Refresh the page** (F5)
3. Wait a few seconds
4. The **"๐ŸŒ Auto Translate"** menu will appear in the toolbar (between Extensions and Help)

โœ… **Installation complete!**

---

## ๐Ÿš€ Usage

### Available Menu Options

After installation, you'll see the **"๐ŸŒ Auto Translate"** menu with options:

- **๐Ÿ“ Translate This Sheet** - Translate active sheet (overwrites original data)
- **๐Ÿ“‹ Translate to New Sheet** - Translate active sheet to new sheet (original data safe)
- **๐Ÿ”„ Translate ALL Tabs** - Translate all sheets (overwrites original data)
- **๐Ÿ“‘ Translate ALL Tabs to New File** - Translate all sheets to new file (SAFEST โญ)
- **โš™๏ธ Language Settings** - View language code list
- **๐Ÿ“ฅ Export to Excel** - Generate Excel download link

---

### ๐ŸŒŸ Method 1: Translate ALL Tabs to New File (RECOMMENDED)

**This method is safest because the original file remains unchanged!**

#### Steps:

1. Click **"๐ŸŒ Auto Translate"** menu
2. Select **"๐Ÿ“‘ Translate ALL Tabs to New File"**
3. Enter **target language code** (example: `en` for English)
4. Click **"OK"**
5. Wait for the process to complete (2-5 minutes depending on file size)
- โš ๏ธ **DO NOT close the browser tab**
- โš ๏ธ **DO NOT refresh the page**
6. A new file will automatically open in a new tab
7. File name: `[Original File Name] (EN)`

#### Download as Excel:

1. In the translated file, click **"File"** menu
2. Select **"Download"** โ†’ **"Microsoft Excel (.xlsx)"**
3. File will download to your computer

โœ… **Done!**

---

### โšก Method 2: Translate 1 Sheet to New Sheet

**Perfect when you only want to translate a specific tab**

#### Steps:

1. **Select the tab/sheet** you want to translate
2. Click **"๐ŸŒ Auto Translate"** menu
3. Select **"๐Ÿ“‹ Translate to New Sheet"**
4. Enter **language code** (example: `en`)
5. Click **"OK"**
6. A new sheet will be created with name: `[Sheet Name]_EN`
7. You'll be automatically switched to the translated sheet

---

### ๐Ÿ”ฅ Method 3: Translate Directly (Overwrite)

**โš ๏ธ WARNING: Original data will be overwritten! Use only if you're sure.**

#### For 1 Sheet:

1. Select the sheet you want to translate
2. Click **"๐ŸŒ Auto Translate"** โ†’ **"๐Ÿ“ Translate This Sheet"**
3. Confirm **"Yes"** (data will be overwritten)
4. Enter language code
5. Click **"OK"**

#### For ALL Sheets:

1. Click **"๐ŸŒ Auto Translate"** โ†’ **"๐Ÿ”„ Translate ALL Tabs"**
2. Confirm **"Yes"** (data in all tabs will be overwritten)
3. Enter language code
4. Click **"OK"**

---

## ๐ŸŒ Language Codes

### Popular Languages

| Code | Language | Emoji |
|------|----------|-------|
| `en` | English | ๐Ÿ‡ฌ๐Ÿ‡ง |
| `id` | Indonesian | ๐Ÿ‡ฎ๐Ÿ‡ฉ |
| `ja` | Japanese | ๐Ÿ‡ฏ๐Ÿ‡ต |
| `ko` | Korean | ๐Ÿ‡ฐ๐Ÿ‡ท |
| `zh` | Chinese (Mandarin) | ๐Ÿ‡จ๐Ÿ‡ณ |
| `ar` | Arabic | ๐Ÿ‡ธ๐Ÿ‡ฆ |
| `es` | Spanish | ๐Ÿ‡ช๐Ÿ‡ธ |
| `fr` | French | ๐Ÿ‡ซ๐Ÿ‡ท |
| `de` | German | ๐Ÿ‡ฉ๐Ÿ‡ช |
| `pt` | Portuguese | ๐Ÿ‡ต๐Ÿ‡น |
| `ru` | Russian | ๐Ÿ‡ท๐Ÿ‡บ |
| `it` | Italian | ๐Ÿ‡ฎ๐Ÿ‡น |
| `nl` | Dutch | ๐Ÿ‡ณ๐Ÿ‡ฑ |
| `th` | Thai | ๐Ÿ‡น๐Ÿ‡ญ |
| `vi` | Vietnamese | ๐Ÿ‡ป๐Ÿ‡ณ |
| `tl` | Tagalog | ๐Ÿ‡ต๐Ÿ‡ญ |
| `hi` | Hindi | ๐Ÿ‡ฎ๐Ÿ‡ณ |
| `bn` | Bengali | ๐Ÿ‡ง๐Ÿ‡ฉ |

### View Complete List

1. Click **"๐ŸŒ Auto Translate"** menu
2. Select **"โš™๏ธ Language Settings"**
3. A dialog will show the language code list

Or visit: https://cloud.google.com/translate/docs/languages

---

## ๐Ÿ”ง Troubleshooting

### โŒ "Extensions" menu not visible

**Cause:** File is in Excel format (.xlsx), not Google Sheets format

**Solution:**
1. Click **File** menu
2. Select **"Save as Google Sheets"**
3. Wait for conversion to complete
4. **Extensions** menu will now appear
5. Continue with Apps Script installation

### โŒ "Auto Translate" menu not appearing

**Cause:** Script hasn't been run or hasn't loaded

**Solution:**
1. Open **Extensions** โ†’ **Apps Script**
2. Select **`onOpen`** function in dropdown
3. Click **Run** button (โ–ถ๏ธ)
4. Go back to Google Sheets
5. Refresh page (F5)
6. Wait 10-15 seconds

### โŒ Error: "Authorization required"

**Cause:** Script needs permission on first run

**Solution:**
1. Click **"Review Permissions"**
2. Choose your Google account
3. Click **"Advanced"**
4. Click **"Go to Auto Translator (unsafe)"**
5. Click **"Allow"**

> This is normal for custom scripts. The script only runs in your account and doesn't share data with third parties.

### โŒ Translation process too slow / stuck

**Cause:** Large files require more time

**Solution:**
- Files >1000 rows may take 5-10 minutes
- **DO NOT close tab** or refresh page
- Wait until "โœ… Done!" notification appears
- If longer than 15 minutes, try translating per sheet

### โŒ Some cells not translated

**Cause:**
- Cell contains numbers (no translation needed)
- Cell contains formulas (not translated)
- Cell is empty
- Temporary API connection error

**Solution:**
- This is normal and by design
- Formulas and numbers are not translated
- For connection errors, try running again

### โŒ Script error / not working

**Solution:**
1. Ensure script is completely copied (not truncated)
2. Open Apps Script โ†’ check for red errors
3. Delete script and paste again
4. Save โ†’ Run โ†’ Refresh

---

## ๐Ÿ’ก Tips & Best Practices

### โœจ Tip 1: Backup First!
Before translating, make a copy of the original file:
- **File** โ†’ **Make a copy**
- Name it `BACKUP - [file name]`

### โœจ Tip 2: Test with 1 Sheet First
Before translating all tabs, test with 1 sheet to check results

### โœจ Tip 3: Use "to New File/Sheet" Options
Always use options that create new file/sheet to keep original data safe

### โœจ Tip 4: Translate Gradually
For very large files (>5000 rows), translate per sheet or in batches

### โœจ Tip 5: Check Results
After translation, randomly check several rows to ensure accuracy

### โœจ Tip 6: Stable Internet Connection
Ensure stable internet connection during translation process

---

### โš ๏ธ Disclaimer & Important Notes

Before using this script, please consider the following:

- **Backup Recommended**
It is strongly recommended to create a backup copy of your Google Sheets data before running this script.

- **Sensitive Data**
If your document contains confidential or sensitive information, consider carefully before using cloud-based automation. Any security risks or data errors remain the userโ€™s responsibility.

- **Official Google Features**
This script uses `LanguageApp` or the `GOOGLETRANSLATE` function, which are official built-in Google features.
It is **not a third-party application** and is **not affiliated with or endorsed by Google**.

- **Educational & Reference Purpose**
This script is provided for educational and reference purposes only.
The author is not responsible for any data loss, corruption, or errors that may occur from using this script.

This project uses Google Apps Script and Google Translate services.
This project is not affiliated with or endorsed by Google.
Users are responsible for complying with Google's Terms of Service.

## ๐Ÿ“ Changelog

### Version 1.0 (2024)
- Initial release
- Support translate single sheet or all sheets
- Support translate to new sheet/file
- Export to Excel
- 100+ language support

---

## ๐Ÿ“„ License

Free to use. No warranty provided.

---

## โœ… Quick Checklist

Before starting, ensure:
- [ ] File is in Google Sheets (not local Excel)
- [ ] If Excel format, converted via **File โ†’ Save as Google Sheets**
- [ ] **Extensions** menu is visible
- [ ] Script pasted in Apps Script
- [ ] Script saved
- [ ] Script **Run** (important!)
- [ ] Page refreshed
- [ ] "๐ŸŒ Auto Translate" menu appears
- [ ] Know target language code (e.g., `en`)
- [ ] Stable internet connection

**If all checkboxes โœ…, you're ready to translate!**

---

## ๐ŸŽ‰ Happy Translating!

**Fastest Workflow:**
1. Upload file to Google Sheets
2. If Excel format: **File โ†’ Save as Google Sheets**
3. Install script โ†’ Run โ†’ Refresh
4. Click "Translate ALL Tabs to New File"
5. Enter language code โ†’ OK
6. Download result as Excel
7. Done! ๐Ÿš€

---

**Made with โค๏ธ using Google Apps Script**