@@ -8,6 +8,7 @@ a next-translate's tool for google spreadsheet, it can flatten 2D locale-key arr
88
99<!-- toc -->
1010* [ Usage] ( #usage )
11+ * [ Tutorial] ( #tutorial )
1112* [ Commands] ( #commands )
1213* [ Todos] ( #todos )
1314<!-- tocstop -->
@@ -18,13 +19,35 @@ $ npm install -g @uppo/next-translate-spreadsheet-i18n-tool
1819$ ntsit COMMAND
1920running command...
2021$ ntsit (--version)
21- @uppo/next-translate-spreadsheet-i18n-tool/1.1.1 darwin-x64 node-v16.14.2
22+ @uppo/next-translate-spreadsheet-i18n-tool/1.1.2 darwin-x64 node-v16.14.2
2223$ ntsit --help [COMMAND]
2324USAGE
2425 $ ntsit COMMAND
2526...
2627```
2728<!-- usagestop -->
29+ # Tutorial
30+ <!-- tutorial -->
31+ ## 1. Prepare your spreadsheet
32+ demo template: https://docs.google.com/spreadsheets/d/1mBFh5E2LzF66hV4bw-pVyCA0CvvqBJrk9-A8XntbG64/edit?usp=sharing
33+
34+ ## 2. GCP setup
35+ > reference: [ google cloud platform] ( https://developers.google.com/workspace/guides/manage-credentials?hl=zh-cn )
36+ 1 . create a project([ link] ( https://console.cloud.google.com/welcome?organizationId=0&supportedpurview=project ) )
37+ 2 . enable google sheets api
38+ 3 . create a service account
39+ 4 . download the crediential json file
40+ 5 . share your spreadsheet to the service account email
41+
42+ ## 3. Run the command
43+ ``` sh-session
44+ $ ntsit gen
45+ ```
46+
47+ ## 4. Get your sheet id
48+ e.g. https://docs.google.com/spreadsheets/d/[spreadsheetId ] /edit#gid=0
49+
50+ <!-- tutorialstop -->
2851# Commands
2952<!-- commands -->
3053* [ ` ntsit gen ` ] ( #ntsit-gen )
@@ -51,7 +74,7 @@ DESCRIPTION
5174 Start generating your files
5275```
5376
54- _ See code: [ dist/commands/gen/index.ts] ( https://github.com/fee-pg/next-translate-spreadsheet-i18n-tool/blob/v1.1.1 /dist/commands/gen/index.ts ) _
77+ _ See code: [ dist/commands/gen/index.ts] ( https://github.com/fee-pg/next-translate-spreadsheet-i18n-tool/blob/v1.1.2 /dist/commands/gen/index.ts ) _
5578
5679## ` ntsit help [COMMANDS] `
5780
@@ -312,7 +335,5 @@ DESCRIPTION
312335- [ ] Optimize code: writeFile timing, logic, etc.
313336- [ ] Add tests(btw: How to test a cli that results in some generated file ?)
314337- [ ] Upgrade google-spredsheet to v4.
315- - [ ] Change to Single Command CLI? (e.g. ` ntsit ` instead of ` ntsit gen ` ).
316- - [ ] Polish README.md: add demo gif, googlesheet template, tutorial for GCP(Google Cloud Platform) Authentication, etc.
317338- [ ] Beautify console output: spinner, color, etc.
318339<!-- todosstop -->
0 commit comments