cloudfile_to_vocab
Processes any spreadsheet in the cloud into a set of vocab json files.
Setup
- Add grunt-cloudfile-to-vocab as a dependency in your project's package.json
- In your Gruntfile.js, inside your grunt.initConfig(), add the following:
cloudfile_to_vocab:
Register a task, e.g.
grunt;
Creating a service account email and certificate
- Go to https://console.developers.google.com
- Create a project
- In the project, go to 'APIs & Auth' -> 'Credentials' and 'Create New Client ID'
- Select 'Service Account' as the type and p12 as your container
- Convert the downloaded p12 to PEM with 'openssl pkcs12 -in [the pem file] -out google-oauth.pem -nocerts -nodes
- Copy your service email address into the config and change certLocation to the location of your generated certificate (.pem)
Usage
Create a Google spreadsheet and start populating it with content (see examples below).
Run your task to automatically generate vocab JSON files from a Google spreadsheet.
Running tests
To run the tests add a google account user name and password into the grunt config file.
Example input/output
Input
NB: The 'ignore' in the left column ensures that that row is not included in the rendered output.
| english | persian
ignore | Instructions go here. | ...
project_header | Hello, World! | سلام جهان!
project_intro | This is my intro... | این مقدمه من است ...
Output
english.json
persian.json
You can now populate your project with these variables, thereby being able to deliver your project in a language-agnostic way, paving the way for delivering to multiple nationalities.
Known issues
Make sure you are not on a proxy network or it cannot connect to Google.