mirror of
https://github.com/watn3y/steamsalty.git
synced 2025-10-28 01:21:07 +01:00
refactor!: change config structure to be more readable
This commit is contained in:
parent
f17601c470
commit
038d375ae7
7 changed files with 31 additions and 22 deletions
|
|
@ -38,7 +38,7 @@ func Translate(text string) (translatedText string, sourceLanguage string, err e
|
|||
log.Debug().Str("text", text).Msg("Starting translation")
|
||||
req := translateRequest{
|
||||
Text: []string{text},
|
||||
TargetLang: config.BotConfig.TranslateLanguage,
|
||||
TargetLang: config.BotConfig.Translate.Language,
|
||||
}
|
||||
|
||||
body, err := json.Marshal(req)
|
||||
|
|
@ -100,7 +100,7 @@ func getAndValidateLanguages() (err error) {
|
|||
TargetLanguages[l.Language] = l.Name
|
||||
}
|
||||
|
||||
if _, ok := TargetLanguages[config.BotConfig.TranslateLanguage]; !ok {
|
||||
if _, ok := TargetLanguages[config.BotConfig.Translate.Language]; !ok {
|
||||
return fmt.Errorf("Selected language not supported by DeepL")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue