Skip to content

Latest commit

 

History

History
142 lines (91 loc) · 6.53 KB

CONTRIBUTING.md

File metadata and controls

142 lines (91 loc) · 6.53 KB

Contribute:

Prerequisites:

Prerequisite Steps:

  1. Fork quran-api repo
  2. 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

Add new translations:

  1. 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).

    Example 1

    Example 2

    Example 3

  2. 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

    Example 1

    Example 2

  3. Copy and paste the translations to the start directory, you can paste any number of translations.

  4. And then, enter the following command:
    echo create > command.txt

  5. Now Push the Changes and Create PR

If you got stuck somewhere, Let me Know

Update translations:

Let say there is a spelling mistake in the edition and you would like to correct:

  1. 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

  2. Copy the translations to be updated, from database/chapterverse directory and paste it into start directory

  3. 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

  4. And then, run the following command:
    echo update > command.txt

  5. Now Push the Changes and Create PR

Searching Translation:

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

  1. 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

  2. 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

Deleting Translation:

  1. 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

  2. Now Push the Changes and Create PR

Adding new font:

  1. Copy and paste the fonts into start directory, you can paste any number of fonts in start directory

  2. Run the following command:
    echo fontsgen > command.txt

  3. Now Push the Changes and Create PR

Deleting a font:

  1. Delete the font and all its formats specified in fonts.json from fonts directory .

  2. Run the following command:
    echo fontsgen > command.txt

  3. Now Push the Changes and Create PR

Pushing and Creating Pull Request:

  1. After you are done with your changes
    Run the following command:
git add -A && git commit -m "Your commit message"
git push
  1. 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




✏️Improve this page