- Go to Console Google Cloud Platform
- Enable "Google Sheets API"
- Click "Manage"
- Click "Credentials"
- Click "Create credentials"
- Click "OAuth client ID"
- Click "Configure consent screen"
- Choose "External" > Create
- Add scopes for "Google Sheets API"
.../auth/drive.file
- Save and continue
- Publish app
- Click on “Credentials” and choose "OAuth Client ID" from the “Create credentials”
- Choose "Web application" and click "Create"
- Click on "Download json", put file in root of your project and rename it in
client_secret.json
- Click "Service account"
- Type "ServiceAccount" in "Service account name" text field
- Click "Create and continue"
- Click "Done"
- Copy EMAIL address of service account created
- Start a new spreadsheet
- Click "Share" the button into the top right corner
- Past copied service account email and click "Done"
- Add to your .env ID of spreadsheet created.
Example:
SPREADSHEETID=1Tu3EvufoNVnnUvRnc-3d-3raww6Z7ti951xegnqlsDM
- Add to your .env sheet name.
Example:
SHEETNAME=Sheet1
- Set A1 with value "key" without double quotes
- From B1 to Z1 set ISO 639-1 Code languages of interest
Example:
- Install
composer require vladislavbogomolov/transheet
- Add into
./config/app.php
file, afterPackage Service Providers...
comment
Vladislavbogomolov\Transheet\TransheetServiceProvider::class,
This command will create transheet.php
in each language folder that will contain translation lists.
php artisan transheet:download