gsheet_to_arb 0.0.2+1 gsheet_to_arb: ^0.0.2+1 copied to clipboard
Imports Application Resource Bundle (ARB) from Google Sheets documents
GSheet to ARB #
Imports Application Resource Bundle (ARB) from Google Sheets
Setup #
Google Sheet API key #
- Create a new project in 'Google Cloud Platform' console (you can use existing one)
- Select "ENABLE APIS AND SERVICES" button and make sure "Google Sheets API" is enabled
- Open "Credentials" tab of the project
- Create credentials -> Create OAuth client ID -> Other
- you may need to configure consent screen
- Save your
client_id
andclient_secret
Create Google Sheet from the template #
-
Open sample Google spreadsheet available at:
-
Copy sample to your Drive account
- File -> Make a copy
-
Save
document_id
of the Google spreadsheet- https://docs.google.com/spreadsheets/d/`<document_id>`/edit#gid=0
Configure your Dart project #
-
Add gsheet_to_arb dev dependency to the pubspec.yaml
dev_dependencies: gsheet_to_arb: ^0.0.2
-
pub update
-
Create plugin configuration e.g.
gsheet_to_arb.yaml
gsheet_to_arb: gsheet: client_id: '<google_api_client_id>' client_secret: '<google_api_secret>' document_id: '<google_sheet_id>'
You shouldn't share API secrets in VCSs, so add it to the .gitingore list
Import ARB files from the Google Sheet #
-
To import ARB files from Google Sheet run the
gsheet_to_arb:import
program.pub run gsheet_to_arb:import --config gsheet_to_arb.yaml --output-dir=lib/src/i18n
-
Click on the link displayed in the console
Please go to the following URL and grant Google Spreasheet access: => https://accounts.google.com/o/oauth2/auth?response_type=code&...
-
Log-in to the Google Account
Create Google Sheet template from existing ARB file #
Not implemented yet.