Skip to content

yaza-putu/google-sheets-translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

🌐 Auto Translate Google Sheets

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


📋 Table of Contents


✨ 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 ExtensionsApps 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:

  • FileMake 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

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors