shahednasser / quran-extension

Replace the new tab page with Quran verses and beautiful nature pictures.
https://chrome.google.com/webstore/detail/quran-in-new-tab/hggkcijghhpkdjeokpfgbhnpecliiijg?authuser=1
MIT License
87 stars 12 forks source link

Add Explanation for Ayah in Arabic #15

Closed shahednasser closed 2 years ago

shahednasser commented 2 years ago

Based on feedback from a user, we should add explanations for Ayah in Arabic.

murtuzaalisurti commented 2 years ago

you mean tafseer, right?

shahednasser commented 2 years ago

yes. I think we just need to add the Arabic option from this endpoint:

http://api.alquran.cloud/v1/edition/type/translation

to the array returned in getTranslationLanguageIdentifier in options.js.

murtuzaalisurti commented 2 years ago

the _locale string is not displayed even though I added a message in messages.json for the arabic language. I am attaching related screenshots!

Screenshot (140) Screenshot (139) Screenshot (141)

shahednasser commented 2 years ago

You need to refresh your extension from chrome://extensions in order for localized strings to update.

murtuzaalisurti commented 2 years ago

the tafsir is available only in arabic language! check it out at this endpoint :- https://api.alquran.cloud/v1/edition/type/tafsir

shahednasser commented 2 years ago

You just need to add the identifier from this endpoint to the select list. Then, when it is selected in the options the tafsir will be fetched based on the identifier.

murtuzaalisurti commented 2 years ago

yes, but the tafsir is only available in arabic, so it will not be visible for any other language

shahednasser commented 2 years ago

It doesn't matter. The endpoint that retrieves the translation will work for both.

murtuzaalisurti commented 2 years ago

umm... sorry, I don't get it. Can you elaborate?

shahednasser commented 2 years ago

In the options, the user only needs to choose the language for the translation. The value of the language is the identifier used to retrieve the translation from the endpoint https://api.alquran.cloud/v1/ayah/<VERSE_NUMBER>/editions/quran-uthmani-min,<TRANSLATION_IDENTIFIER> Where <VERSE_NUMBER> is the number of the verse to be translated and <TRANSLATION_IDENTIFIER> is the identifier for either the translations which we already support, or the new tafsir we're adding with the identifier ar.muyassar. For example: https://api.alquran.cloud/v1/ayah/255/editions/quran-uthmani-min,ar.muyassar

So, we just need to add the new option in the options with the identifier ar.muyassar. Then, when it's selected the tafsir will be shown on the new tab page under "Quran Translation". The same will apply for other languages.

murtuzaalisurti commented 2 years ago

got it and done! I am making a pull request!

murtuzaalisurti commented 2 years ago

21