- Fork quran-api repo
- clone the forked repo:
git clone --filter=blob:none --no-checkout --depth 1 --sparse <YourFork.git>
cd quran-api
git sparse-checkout reapply --no-cone
git sparse-checkout add start/* command.txt
git checkout
-
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.
-
And then, enter the following command:
echo create > command.txt
If you got stuck somewhere, Let me Know
Let say there is a spelling mistake in the edition and you would like to correct:
-
Run the following command:
git sparse-checkout add database/chapterverse/<editionNametoUpdate>.txt
For example if you want to update eng-talalitani and ces-arnykl then run:
git sparse-checkout add database/chapterverse/eng-talalitani.txt database/chapterverse/ces-arnykl.txt
-
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, run the following command:
echo update > command.txt
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
-
First Run the following command:
echo search > command.txt
And Now If you want to search single verse
echo "verse to be search" >> command.txt
If you want to search multiple verses in different editions
echo "verse to be searched1" "verse to be searched2" >> command.txt
-
Now Push the Changes and Create PR ,and the result will be available at Actions tab in form of log file, after the PR is merged
-
Translations should not be deleted, otherwise it will break the api, but if there is a need, it can be done using:
echo delete > command.txt
And Now If you want to delete single edition
echo editionNameToDelete >> command.txt
And If you want to delete multiple editions
echo editionNameToDelete editionName2ToDelete >> command.txt
-
Copy and paste the fonts into start directory, you can paste any number of fonts in start directory
-
Run the following command:
echo fontsgen > command.txt
-
Delete the font and all its formats specified in fonts.json from fonts directory .
-
Run the following command:
echo fontsgen > command.txt
- After you are done with your changes
Run the following command:
git add -A && git commit -m "Your commit message"
git push
- Go to your forked repo and click on pull request
Facing any issue? Let me Know
The above given details are enough to contribute to this repo, incase you want to know how the underlying things work or want to add new features to the repo then see Local Contribute and Development details