Repository navigation
i18N Support for llm provider and ai model description - #171
Merged
iFurySt merged 2 commits intoJun 30, 2025
Merged
Conversation
i18N Support for llm provider and ai model description
Contributor
Reviewer's GuideThis PR adds i18n support for LLM provider and model descriptions by introducing a generic description lookup utility, creating provider- and model-specific helper functions with fallback logic, integrating those into the settings UI, and updating translation files with the new keys. Sequence diagram for provider/model description i18n lookupsequenceDiagram
participant UI as LLMSettings UI
participant Adapter as llm-providers-adapter
participant i18n as i18next
UI->>Adapter: getProviderDescription(providerId, fallback, lng)
Adapter->>i18n: t('llm.providerDescriptions.{providerId}', {lng})
i18n-->>Adapter: translation or key
Adapter-->>UI: translated or fallback
UI->>Adapter: getModelDescription(providerId, modelId, fallback, lng)
Adapter->>i18n: t('llm.modelDescriptions.{providerId}.{modelId}', {lng})
i18n-->>Adapter: translation or key
Adapter->>i18n: t('llm.modelDescriptions.{modelId}', {lng}) (if needed)
i18n-->>Adapter: translation or key
Adapter-->>UI: translated or fallback
Class diagram for i18n description utilitiesclassDiagram
class llm_providers_adapter {
+getProviderDescription(providerId: string, fallback: string, lng?: string): string
+getModelDescription(providerId: string, modelId: string, fallback: string, lng?: string): string
getI18nDescription(key: string, fallback: string, lng?: string): string
}
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey @boston008 - I've reviewed your changes - here's some feedback:
- In llm-settings.tsx you’re calling getI18nModelDescription but the exported helper is named getModelDescription—please update the call/import to match.
- The getI18nDescription helper currently catches all errors silently; consider narrowing the catch to i18next-specific errors or adding a debug log to avoid masking other issues.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In llm-settings.tsx you’re calling getI18nModelDescription but the exported helper is named getModelDescription—please update the call/import to match.
- The getI18nDescription helper currently catches all errors silently; consider narrowing the catch to i18next-specific errors or adding a debug log to avoid masking other issues.
## Individual Comments
### Comment 1
<location> `web/src/pages/llm/llm-settings.tsx:636` </location>
<code_context>
<h1 className="text-xl font-bold">{selectedProvider.name}</h1>
<p className="text-sm text-muted-foreground">
- {selectedProvider.description}
+ {getProviderDescription(
+ selectedProvider.id,
+ selectedProvider.description || selectedProvider.name
</code_context>
<issue_to_address>
getProviderDescription is used, but getI18nModelDescription is used elsewhere.
Consider aligning the naming of i18n helper functions for consistency across the codebase.
Suggested implementation:
```typescript
import { BUILTIN_PROVIDERS, getProviderDefaultConfig, getDefaultBaseURL, buildEndpointURL, getProviderDescription as getI18nProviderDescription, getModelDescription as getI18nModelDescription } from '@/config/llm-providers-adapter';
```
```typescript
{getI18nProviderDescription(
selectedProvider.id,
selectedProvider.description || selectedProvider.name
)}
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
updated to use getI18nProviderDescription
iFurySt
approved these changes
Jun 30, 2025
iFurySt
left a comment
Member
There was a problem hiding this comment.
LGTM! Great improvement, thanks a lot.
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.
i18N Support for llm provider and ai model description
#170
Summary by Sourcery
Add internationalization support for LLM provider and model descriptions and integrate them in the settings UI with fallback logic
New Features:
Enhancements:
Documentation: