Set option to modify locale used (#60)

This commit is contained in:
ByteDream 2022-11-01 22:17:19 +01:00
parent 10617df834
commit 59e8793a2f
3 changed files with 26 additions and 0 deletions

View file

@ -14,6 +14,10 @@ import (
// SystemLocale receives the system locale
// https://stackoverflow.com/questions/51829386/golang-get-system-language/51831590#51831590
func SystemLocale(verbose bool) crunchyroll.LOCALE {
if lang, ok := os.LookupEnv("CRUNCHY_LANG"); ok {
return crunchyroll.LOCALE(lang)
}
if runtime.GOOS != "windows" {
if lang, ok := os.LookupEnv("LANG"); ok {
var l crunchyroll.LOCALE