Note:
This documentation requires you to clone this huge repo locally, incase you want to contribute by following simple and easy steps,
Please refer Contribute
pip3 install googletrans
npm install -g -D playwright extract-zip opentype.js
To Create/Update/Delete/Search the editions, we will use apiscript.js.
Never modify/add the files manually, for everything we will use apiscript.js
Set CI environment variable to true, so all files are generated:
- Windows:
set CI=true
- Linux:
CI=true
-
The translation should either be in 6236 lines(ignoring empty lines) or if it has more lines then it should at least have verse number at the beginning of each verse, It doesn't matter whether the chapter number is there or not. The database/originals folder have different translations that were used as an input to apiscript.js, please refer those files to check whether your translation file will work fine or not. You may want to preprocess the file, if it is in other than text format(pdf, Images, docx, etc).
-
Add JSON data at end of the file in following format:
{ "author":"Name of the author", "language":"Name of the language", "source":"Specify source here if any", "comments":"Add any comments here" }
Please see database/originals , all the files have the json data at end of file. When specifying the language, please use proper iso name of language
-
Copy and paste the translations to the start directory, you can paste any number of translations.
-
Run the following command:
node apiscript.js create
If everything goes well, then the start directory will be empty and all your translations will move into database/originals
now push the changes to this repo
If you got stuck somewhere, Let me Know
Let say there is a spelling mistakes you want to correct in the translations:
-
Copy the translations to be updated, from database/chapterverse directory and paste it into start directory
-
Update the translation text, Please do not modify the JSON values which are stored at the end of file,specifically the name and language json values
-
And then, enter the following command:
node apiscript.js update
Lets say you what to know whether a translation exists in the database or not, or you want to find the edition which have a specific verse
-
Run the following command:
node apiscript.js search "String To be Searched"
It can take multiple arguments example:
node apiscript.js search "String To be Searched" "String2 To be Searched"
-
Translations should not be deleted, otherwise it will break the api, but if there is a need, it can be done using:
node apiscript.js delete editionNameToDelete
It can take multiple arguments at single time example:
node apiscript.js delete editionNameToDelete editionName2ToDelete
-
Copy and paste the fonts into start directory, you can paste any number of fonts in start directory
-
Run the following command:
node apiscript.js fontsgen
- Updating a font is a two step process,
- First you have to delete the font which needs to be updated
- Then you have to add the newly updated font
-
Delete the font and all its formats specified in fonts.json from fonts directory .
-
Run the following command:
node apiscript.js fontsgen
Facing any issue? Let me Know
The above given details are enough to contribute to this repo, incase you want to know how the script works or want to add new features to the apiscript.js then see Development details