translations.go (512B)
1 package display 2 3 import ( 4 "fmt" 5 6 f "git.hanabi.in/gitbox/quran-go/src/fetch" 7 ) 8 9 // Print a list of all available translations from quran.com, sorted ASC by their ID. 10 func Translations() (err error) { 11 12 translationList, err := f.AllTranslations() 13 if err != nil { 14 return err 15 } 16 17 fmt.Println("Available translations:\n") 18 fmt.Println("ID\t\ttLanguage\t\tTranslation name\n") 19 20 for _, elem := range translationList { 21 fmt.Printf("%d\t\t(%s)\t\t%s\n", elem.ID, elem.LanguageName, elem.Name) 22 } 23 24 return err 25 26 }