
Google Sheets
You can sync the translations with Google Sheets.
Setup
To use Google Sheets as a sync provider, follow these steps:
Service account
- Create a service account in the Google Cloud Console.
- Download the JSON key file to the directory of your choice. Note down the path to the file.
Google Sheets
- Create a Google Sheets document.
- Set up a header row with the following columns (case-insensitive):
key: This will contain the translation key. Use a descriptive name, such asKEY.base_locale: This will contain the base locale. For example:EN.- Add columns for all the locales you want to support.
- Share the Google Sheets document with the service account email address and give it edit permissions.
- Note the following information:
- The Google Sheets document ID from the URL:
https://docs.google.com/spreadsheets/d/{ID}/edit. - The name of the sheet. E.g.,
Sheet1. - The first column letter. E.g.,
A. - The last column letter. E.g.,
C. - The heading row number. E.g.,
1. - The first row number. E.g.,
2. - The heading cell value for the key column. E.g.,
KEY. - The heading cell value for the base translation column. E.g.,
EN.
- The Google Sheets document ID from the URL:
Configuration
Add the following configuration to your .env file:
LTS_SYNC_PROVIDER=google_sheets
LTS_GOOGLE_SHEETS_AUTH_CONFIG="path/to/service-account.json"
LTS_GOOGLE_SHEETS_SPREADSHEET_ID=aabbccdd11223344
LTS_GOOGLE_SHEETS_SHEET_NAME=Sheet1
LTS_GOOGLE_SHEETS_FIRST_COLUMN=A
LTS_GOOGLE_SHEETS_LAST_COLUMN=C
LTS_GOOGLE_SHEETS_HEADING_ROW=1
LTS_GOOGLE_SHEETS_FIRST_ROW=2
LTS_GOOGLE_SHEETS_KEY_CELL_VALUE=KEY
LTS_GOOGLE_SHEETS_BASE_TRANSLATION_CELL_VALUE=ENCongratulations! You have successfully set up Google Sheets as the sync provider.
