Internationalization Polish#2002
Merged
ksylvan merged 2 commits intodanielmiessler:mainfrom Feb 14, 2026
Merged
Conversation
…tify modules - Add i18n translation keys for Ollama `num_ctx` validation error messages - Add i18n strings for Ollama server chat endpoint and SSE streaming errors - Add i18n strings for extension registry, executor, and manager operations - Add i18n strings for LM Studio client error messages and response handling - Add i18n strings for Spotify API client error messages - Add OpenAI image generation model compatibility warning translations - Replace hardcoded English strings with `i18n.T()` calls across all modules - Add translations for all new keys in de, en, es, fa, fr, it, ja, pt-BR, pt-PT, and zh locales
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Internationalization Polish
Summary
This PR introduces comprehensive internationalization (i18n) support across multiple modules of the Fabric project by replacing hardcoded English string literals with localized message keys via
i18n.T()calls. The changes span four major subsystems: the Ollama server, the OpenAI client, the LM Studio client, the extension system, and the Spotify integration. Corresponding translation strings have been added to all 10 supported locale files.Files Changed
Locale Files (10 files)
internal/i18n/locales/en.jsoninternal/i18n/locales/de.jsoninternal/i18n/locales/es.jsoninternal/i18n/locales/fa.jsoninternal/i18n/locales/fr.jsoninternal/i18n/locales/it.jsoninternal/i18n/locales/ja.jsoninternal/i18n/locales/pt-BR.jsoninternal/i18n/locales/pt-PT.jsoninternal/i18n/locales/zh.jsonEach locale file received the same set of ~117 new keys covering five domains:
openai_*— Image generation model compatibility warningsollama_*—num_ctxvalidation, request/response errors, SSE streaming errors, address validationextension_*— Registry management, execution, validation, hash verificationlmstudio_*— Request lifecycle errors, response parsingspotify_*— Token management, API requests, metadata parsingGo Source Files (6 files)
internal/server/ollama.goi18n.T()callsinternal/plugins/ai/openai/openai.gointernal/plugins/ai/lmstudio/lmstudio.gointernal/plugins/template/extension_executor.gointernal/plugins/template/extension_manager.gointernal/plugins/template/extension_registry.gointernal/tools/spotify/spotify.goCode Changes
Pattern: Direct format string replacement
Most changes follow this pattern where a hardcoded
fmt.Errorfformat string is replaced with ani18n.T()lookup:Pattern: Static error messages (no format verbs)
For error messages without format parameters, the
%swrapper pattern is used to avoidgo vetcomplaints about non-constant format strings:Pattern: Composed format strings
Some messages require an intermediate
fmt.Sprintfbefore being passed tofmt.Errorf:OpenAI image generation warning
Reason for Changes
Previously, all user-facing error messages, log output, and CLI feedback were hardcoded in English. This made the application inaccessible to non-English-speaking users. This PR extends the existing i18n framework (already in use for other parts of the codebase) to cover five additional subsystems:
num_ctx, handles upstream communication, and manages SSE streamingImpact of Changes
module_action_detail), making them easy to discover and maintainTest Plan
ollama.go,lmstudio.go,openai.go, the extension system, andspotify.goshouldcontinue to passFABRIC_LANG=de(or any supported locale) produces German error messages in the affected subsystems%d,%s,%v,%wplaceholders in translation values match the arguments passed in Go codego vet— Confirm noprintfformat string warnings from the newfmt.Errorf("%s", i18n.T(...))patternsAdditional Notes
%dvs%s, or a missing%w) would cause runtime panics or incorrect error wrapping. This should be validated with automated tooling or careful review of each locale file.fmt.Errorfpatterns — Some messages usefmt.Errorf(i18n.T("key"), args...)directly (when the translation contains%w), while others usefmt.Errorf("%s", fmt.Sprintf(i18n.T("key"), args...)). The latter pattern loses Go's error wrapping semantics when the translation contains%w. This inconsistency should be reviewed to ensure error wrapping (errors.Is/errors.As) works as expected.