google-sheets-i18n-to-json v1.0.3
Google Sheets I18N To JSON
Google Sheets I18N To JSON is a command line tool to help pull google sheets as JSON objects for I18N use.
The idea is that you have a google spreadsheet where you have a google spreadsheet to maintain a reference of keys to text corresponding to the language. This way both developers and clients can be on the same track with official texts for a product.
After updating the spreadsheet, the developer would want to update the JSON objects as easy as running:
foo@bar:~$ google-sheets-i18n-to-json update
There are a short number of easy steps that the command line tool guides you to making the spreadsheet, authorizing and pulling the JSON objects. Check out the website to get a thorough and proper understanding of the command line tool.
Website: https://google-sheets-i18n-to-json.netlify.app
Getting-Started: https://google-sheets-i18n-to-json.netlify.app/getting-started
Example of Use Case
The command line tool creates a spreadsheet like this after initializing:
After initializing, the JSON objects will be pulled at first. However, say you or your team or your clients add a new key "Bye" and fill in the text in the corresponding locales. Simply run:
foo@bar:~$ google-sheets-i18n-to-json update
to get the following:
Short README of functions
Commands:
- Installing
- Initialization
- Authorizing
- Pulling JSON Objects
- Adding languages
- Deleting language
- Cleaning and removing files
Installation
Using npm:
foo@bar:~$ npm install -g google-sheets-i18n-to-json
Using yarn:
foo@bar:~$ yarn global add google-sheets-i18n-to-json
Using
Since google-sheets-i18n-to-json is long, you can use the following as a short form:
foo@bar:~$ gs-i18n-json
Alternatively, the long version would still work.
Initialization
Normal Initialization
Follow the steps to generate a spreadsheet after entering the command:
foo@bar:~$ gs-i18n-json init
Linking Initialization
Follow the steps to link a spreadsheet after entering the command:
foo@bar:~$ gs-i18n-json link
Linking New Initialization
Follow the steps to link a spreadsheet and create a new sheet inside after entering the command:
foo@bar:~$ gs-i18n-json link-new
Authorizing
Generates a token to perform actions. Initialization already includes this.
foo@bar:~$ gs-i18n-json authorize
Get the date of when the token was generated:
foo@bar:~$ gs-i18n-json token-date
Updating JSON Objects
foo@bar:~$ gs-i18n-json update
Adding languages to spreadsheet
foo@bar:~$ gs-i18n-json add-lang --lang language_1
Deleting languages from spreadsheet
foo@bar:~$ gs-i18n-json delete-lang --lang language_1
Cleaning files
foo@bar:~$ gs-i18n-json clean
Also remove config:
foo@bar:~$ gs-i18n-json clean --config