Google Sheets Sync Pro
The Google Sheets provider enables collaborative translation workflows by loading translations directly from a Google Spreadsheet.
Access Modes
| Mode | Requirement | Best For |
|---|---|---|
| Public (Published to Web) | Sheet must be published to web | Quick setup, no API key needed |
| API Key | Google Cloud API key | Private sheets, full metadata access |
Important
"Shared with anyone with the link" is NOT the same as "Published to web". Public access without an API key requires the sheet to be published to the web.
Option 1: Public Access (No API Key)
For quick setup without API credentials, publish your sheet to the web:
Publishing a Google Sheet
- Open your Google Sheet in the browser
- Go to File → Share → Publish to web
- In the dialog:
- Select Entire Document or specific sheets
- Choose Web page or CSV format (either works)
- Click Publish
- Confirm when prompted
Limitations
- Sheet must remain published (anyone with URL can view)
- Cannot enumerate all sheet names automatically
- No push/write support - public access is read-only
Setup
- In LocalizationSettings, set Provider to Google Sheets
- Enter your Spreadsheet ID (from the URL)
- Check Is Public
- Click Fetch to load available sheets
- Select your sheet from the dropdown
Option 2: API Key Access
For private sheets or full functionality, use a Google Cloud API key.
Getting an API Key
- Go to Google Cloud Console
- Create a new project or select existing
- Enable the Google Sheets API:
- Go to APIs & Services → Library
- Search for "Google Sheets API"
- Click Enable
- Create an API key:
- Go to APIs & Services → Credentials
- Click Create Credentials → API Key
- (Recommended) Restrict the key to Google Sheets API only
- Copy the API key
Benefits
- Works with private sheets (shared with specific users)
- Full sheet name enumeration in the Fetch dropdown
- Push/write support for syncing translations back
Security
Never commit API keys to version control. The API key field stores keys in EditorPrefs (not in the asset). For CI/CD, set the LEXIS_GOOGLE_API_KEY environment variable.
Expected Sheet Format
| Key | en | de | fr | Comment |
|---|---|---|---|---|
| ui.welcome | Welcome! | Willkommen! | Bienvenue! | Main menu greeting |
| ui.start | Start Game | Spiel starten | Démarrer | |
| ui.quit | Quit | Beenden | Quitter |
- First column: Translation keys
- Header row: Locale codes (en, de, fr, etc.)
- Optional: Comment column for translator notes
Multi-Sheet Configuration
Lexis supports syncing multiple Google Sheets tabs, where each tab maps to a StringTable by its TableId.
How Mapping Works
- Google Sheet tab "UI" → StringTable with TableId "UI"
- Google Sheet tab "Dialogues" → StringTable with TableId "Dialogues"
- If no matching StringTable exists, one is created automatically
Configuration
API Key Mode (Recommended):
- Enter your Spreadsheet ID and API Key
- Click Fetch to load available sheets
- Check the boxes next to sheets you want to sync
Public Mode:
- Enter your Spreadsheet ID
- Use the + Add Sheet button to add sheet names
- Enter each sheet name manually (must match exactly)
Sync Operations
| Operation | Description |
|---|---|
| Pull Selected Table | Sync from sheet matching current table's TableId |
| Pull All Sheets | Sync from all configured sheets at once |
| Push Selected Table | Push current table to the provider (requires API key) |
| Push All Tables | Push all tables to the provider |
Pull Behavior
Pull performs a true sync:
- Adds new entries
- Updates modified entries
- Deletes entries that no longer exist in the source
A consent dialog shows changes before applying:
- Green: New entries to add
- Yellow: Entries to modify (with before/after preview)
- Red: Entries to delete
Push Requirements
Push operations to Google Sheets require an API key with write permissions. Pushing to public (published-to-web) sheets is not supported.
Sync Menu
Access sync operations from the String Table Browser toolbar (gear icon dropdown):
- Pull Selected Table
- Pull All Sheets
- Push Selected Table
- Push All Tables
- Configure Provider...
Troubleshooting
| Error | Cause | Solution |
|---|---|---|
| "Access denied" | Sheet not published or wrong sharing | Publish to web (File → Share → Publish to web) |
| "Invalid API key" | API key is incorrect or expired | Verify key in Google Cloud Console |
| "Could not detect sheet names" | Sheet name doesn't match defaults | Enter sheet name manually, or use API key |
| Empty data returned | Sheet has no content | Add data to your spreadsheet |
| "Push not supported" | Trying to push to public sheet | Push requires an API key |
| Entries unexpectedly deleted | Pull performs true sync | This is expected; entries not in source are removed |
