Skip to content

Commit 3a09906

Browse files
authored
Merge pull request #8 from fee-pg/chore/docs
chore: README.md
2 parents f40badb + 46138cc commit 3a09906

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
/tmp
1010
node_modules
1111
oclif.manifest.json
12-
*credentials.json
12+
*crediential.json

README.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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
1920
running 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]
2324
USAGE
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 -->

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@uppo/next-translate-spreadsheet-i18n-tool",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "a next-translate's tool for google spreadsheet, it can flatten 2D locale-key array to multi 1D JSON.",
55
"author": "fee-pg",
66
"bin": {

0 commit comments

Comments
 (0)