From 74383d0e31fee5aebec002971ebd2cbddad32ac7 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 2 Apr 2026 21:59:36 +0300 Subject: 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 --- internal/config/provider.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 internal/config/provider.go (limited to 'internal/config') diff --git a/internal/config/provider.go b/internal/config/provider.go new file mode 100644 index 0000000..7044964 --- /dev/null +++ b/internal/config/provider.go @@ -0,0 +1,24 @@ +package config + +import "strings" + +const ( + // ProviderGemini is the canonical name for the Google Gemini provider. + // It is the default across all subsystems (audio, translation, phonetic). + ProviderGemini = "gemini" + + // ProviderOpenAI is the canonical name for the OpenAI provider. + ProviderOpenAI = "openai" +) + +// NormalizeProvider returns a canonical, lowercase provider name. +// An empty input resolves to ProviderGemini (the default). The function is +// shared by the audio, translation, and phonetic packages so the same +// normalization rule has a single authoritative home. +func NormalizeProvider(provider string) string { + normalized := strings.ToLower(strings.TrimSpace(provider)) + if normalized == "" { + return ProviderGemini + } + return normalized +} -- cgit v1.2.3