fix(i18n): add i18n support for custom model feature in ModelSelector (#172)
* feat(models): add custom model name input with provider selector - Add custom model input field at bottom of model selector modal - Add provider dropdown to specify target provider for custom model - Track custom models in app store and display with CUSTOM badge - Merge custom model into provider group list - Fix custom provider models being overwritten by API response (keep both) * Upload screenshot * fix(i18n): add i18n support for custom model feature in ModelSelector Replace hardcoded English strings (CUSTOM badge, placeholder, hint) with vue-i18n t() calls and add corresponding translation keys to all 8 locales (en, zh, ja, ko, fr, es, de, pt). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: toller892 <892@users.noreply.github.com> Co-authored-by: Tony <125938283+toller892@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,7 @@ export const useAppStore = defineStore('app', () => {
|
||||
const modelGroups = ref<AvailableModelGroup[]>([])
|
||||
const selectedModel = ref('')
|
||||
const selectedProvider = ref('')
|
||||
const customModels = ref<Record<string, string[]>>({})
|
||||
const healthPollTimer = ref<ReturnType<typeof setInterval>>()
|
||||
const nodeVersion = ref('')
|
||||
|
||||
@@ -73,6 +74,13 @@ export const useAppStore = defineStore('app', () => {
|
||||
await updateDefaultModel({ default: modelId, provider })
|
||||
selectedModel.value = modelId
|
||||
selectedProvider.value = provider || ''
|
||||
// Track as custom if not already in the server-fetched list
|
||||
if (provider && !modelGroups.value.find(g => g.provider === provider)?.models.includes(modelId)) {
|
||||
if (!customModels.value[provider]) customModels.value[provider] = []
|
||||
if (!customModels.value[provider].includes(modelId)) {
|
||||
customModels.value[provider] = [...customModels.value[provider], modelId]
|
||||
}
|
||||
}
|
||||
} catch (err: any) {
|
||||
console.error('Failed to switch model:', err)
|
||||
}
|
||||
@@ -122,6 +130,7 @@ export const useAppStore = defineStore('app', () => {
|
||||
updating,
|
||||
doUpdate,
|
||||
modelGroups,
|
||||
customModels,
|
||||
selectedModel,
|
||||
selectedProvider,
|
||||
streamEnabled,
|
||||
|
||||
Reference in New Issue
Block a user