why was everything sl 💀

This commit is contained in:
Arya 2023-08-28 20:41:57 +05:30
parent f586163648
commit b7e2755ab2
Signed by: arya
GPG Key ID: 842D12BDA50DF120
7 changed files with 19 additions and 9 deletions

View File

@ -35,7 +35,7 @@ var translateCmd = &cobra.Command{
fmt.Println(err)
}
for _, idx := range idxs {
fmt.Println("Selected Language:", list[idx].Id)
fmt.Println("Selected Language:", list[idx].Id, "("+list[idx].Name+")")
}
} else if engine == "all" {
fmt.Println(utils.TranslateAll(dest, source, query))

View File

@ -128,6 +128,8 @@ func LangListDeepl(listType string) []List {
Name: "Detect Language",
}}
ListD = append(append([]List{}, auto...), ListData...)
} else {
ListD = ListData
}
return ListD
}

View File

@ -524,6 +524,8 @@ func LangListDuckDuckGo(listType string) []List {
Name: "Detect Language",
}}
ListD = append(append([]List{}, auto...), ListData...)
} else {
ListD = ListData
}
return ListD
}

View File

@ -543,6 +543,8 @@ func LangListGoogle(listType string) []List {
Name: "Detect Language",
}}
ListD = append(append([]List{}, auto...), ListData...)
} else {
ListD = ListData
}
return ListD
}

View File

@ -78,6 +78,8 @@ func LangListLibreTranslate(listType string) []List {
Name: "Detect Language",
}}
ListD = append(append([]List{}, auto...), ListData...)
} else {
ListD = ListData
}
return ListD
}

View File

@ -239,6 +239,8 @@ func LangListWatson(listType string) []List {
Name: "Detect Language",
}}
ListD = append(append([]List{}, auto...), ListData...)
} else {
ListD = ListData
}
return ListD
}

View File

@ -22,21 +22,21 @@ func LangList(engine string, listType string) ([]List, error) {
return []List{}, errors.New("list type invalid: either give tl for target languages or sl for source languages.")
}
if engine == "google" {
data = LangListGoogle("sl")
data = LangListGoogle(listType)
} else if engine == "libre" {
data = LangListLibreTranslate("sl")
data = LangListLibreTranslate(listType)
} else if engine == "reverso" {
data = LangListReverso("sl")
data = LangListReverso(listType)
} else if engine == "deepl" {
data = LangListDeepl("sl")
data = LangListDeepl(listType)
} else if engine == "watson" {
data = LangListWatson("sl")
data = LangListWatson(listType)
} else if engine == "yandex" {
data = LangListYandex("sl")
data = LangListYandex(listType)
} else if engine == "mymemory" {
data = LangListMyMemory("sl")
data = LangListMyMemory(listType)
} else if engine == "duckduckgo" {
data = LangListDuckDuckGo("sl")
data = LangListDuckDuckGo(listType)
} else {
return []List{}, errors.New("Engine does not exist.")
}