summaryrefslogtreecommitdiff
path: root/internal/phonetic
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-02 21:59:36 +0300
committerPaul Buetow <paul@buetow.org>2026-04-02 21:59:36 +0300
commit74383d0e31fee5aebec002971ebd2cbddad32ac7 (patch)
tree06663e2fa2d515b1ee1e26840417f5d193a71430 /internal/phonetic
parentd94fdaf92d7c66c012e819c73632be16f346b66f (diff)
task 009/00i: remove internal translation from image clients; consolidate provider normalization
- task 009: remove translateBulgarianToEnglish from OpenAIClient and NanoBananaClient. Image clients no longer make internal translation API calls; callers must supply SearchOptions.Translation (processor and GUI already do). When translation is absent, opts.Query (the Bulgarian word) is used as fallback subject so image generation still proceeds. Update tests to pass translation via SearchOptions rather than relying on the removed fallback. - task 00i: consolidate duplicate ProviderGemini/ProviderOpenAI constants and normalizeProvider() functions from internal/translation and internal/phonetic into a shared config.NormalizeProvider(string) string in internal/config/provider.go. Both packages now delegate to the shared function so the normalization rule (lowercase, trim, default "gemini") has one authoritative home. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/phonetic')
-rw-r--r--internal/phonetic/fetcher.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/internal/phonetic/fetcher.go b/internal/phonetic/fetcher.go
index 0346213..d10d6c1 100644
--- a/internal/phonetic/fetcher.go
+++ b/internal/phonetic/fetcher.go
@@ -12,6 +12,8 @@ import (
"github.com/sashabaranov/go-openai"
"google.golang.org/genai"
+
+ appconfig "codeberg.org/snonux/totalrecall/internal/config"
)
const (
@@ -265,11 +267,8 @@ func normalizeConfig(config *Config) Config {
return normalized
}
+// normalizeProvider delegates to the shared config.NormalizeProvider so the
+// normalization rule (lowercase, trim, default to "gemini") has one home.
func normalizeProvider(provider Provider) Provider {
- normalized := Provider(strings.ToLower(strings.TrimSpace(string(provider))))
- if normalized == "" {
- return ProviderGemini
- }
-
- return normalized
+ return Provider(appconfig.NormalizeProvider(string(provider)))
}