-
Create
.env
file from example.env-example
-
Add your google translate api key to
.env
-
Open
index.js
-
Jamstack Translate takes these parameters
GOOGLEKEY
: string of your google translate api key.OPTIONS
: objecttargetLanguages
: array of desired languages (language codes)targetFiles
: array of files/folders. You can specify specific file paths, or globs.targetDirectory
: string of generated file structure.sourceDirectory
: string of where the package starts fromtranslationFile
: file which translations can be saved to / loaded from (ifloadTranslationsFromFile
is set to true)loadTranslationsFromFile
: boolean to tell the package to pull translations fromtranslationFile
. Note: if set tofalse
, whichever value oftranslationFile
will be overwritten.
-
Run the program with
node translate.js
-
Explore your specified
targetDirectory
folder with your translated source files.
npm install
npm run serve
npm run build
npm run lint