diff options
Diffstat (limited to 'internal/processor/processor.go')
| -rw-r--r-- | internal/processor/processor.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/processor/processor.go b/internal/processor/processor.go index d52ca53..94b0448 100644 --- a/internal/processor/processor.go +++ b/internal/processor/processor.go @@ -32,12 +32,13 @@ type Processor struct { // NewProcessor creates a new word processor func NewProcessor(flags *cli.Flags) *Processor { - apiKey := cli.GetOpenAIKey() + openAIKey := cli.GetOpenAIKey() + translationProvider := translation.Provider(viper.GetString("translation.provider")) return &Processor{ flags: flags, - translator: translation.NewTranslator(apiKey), + translator: translation.NewTranslator(&translation.Config{Provider: translationProvider, OpenAIKey: openAIKey, GoogleAPIKey: cli.GetGoogleAPIKey()}), translationCache: translation.NewTranslationCache(), - phoneticFetcher: phonetic.NewFetcher(apiKey), + phoneticFetcher: phonetic.NewFetcher(openAIKey), } } |
