Fix switching profiles to ensure only the selected profile is switche… (#2119)

Fix switching profiles to ensure only the selected profile is switched for all modes, and optimize certain i18n keys.

Signed-off-by: feifei <liuyansheng1121@gmail.com>
This commit is contained in:
feifei 2025-03-31 02:15:27 +08:00 committed by GitHub
parent b74e1e89da
commit d3df954797
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 34 additions and 28 deletions

View file

@ -2,7 +2,7 @@ import { ExtensionContext } from "vscode"
import { z } from "zod"
import { providerSettingsSchema, ApiConfigMeta } from "../../schemas"
import { Mode } from "../../shared/modes"
import { Mode, modes } from "../../shared/modes"
const providerSettingsWithIdSchema = providerSettingsSchema.extend({ id: z.string().optional() })
@ -18,10 +18,16 @@ export type ProviderProfiles = z.infer<typeof providerProfilesSchema>
export class ProviderSettingsManager {
private static readonly SCOPE_PREFIX = "roo_cline_config_"
private readonly defaultConfigId = this.generateId()
private readonly defaultModeApiConfigs: Record<string, string> = Object.fromEntries(
modes.map((mode) => [mode.slug, this.defaultConfigId]),
)
private readonly defaultProviderProfiles: ProviderProfiles = {
currentApiConfigName: "default",
apiConfigs: { default: { id: this.generateId() } },
apiConfigs: { default: { id: this.defaultConfigId } },
modeApiConfigs: this.defaultModeApiConfigs,
}
private readonly context: ExtensionContext

View file

@ -12,8 +12,8 @@
"export": "Exportar historial de tasques",
"delete": "Eliminar tasca (Shift + Clic per ometre confirmació)"
},
"unpin": "desancorar",
"pin": "ancorar",
"unpin": "Desfixar",
"pin": "Fixar",
"tokenProgress": {
"availableSpace": "Espai disponible: {{amount}} tokens",
"tokensUsed": "Tokens utilitzats: {{used}} de {{total}}",

View file

@ -12,8 +12,8 @@
"export": "Aufgabenverlauf exportieren",
"delete": "Aufgabe löschen (Shift + Klick zum Überspringen der Bestätigung)"
},
"unpin": "lösen",
"pin": "anheften",
"unpin": "Lösen von oben",
"pin": "Anheften",
"tokenProgress": {
"availableSpace": "Verfügbarer Speicher: {{amount}} Tokens",
"tokensUsed": "Verwendete Tokens: {{used}} von {{total}}",

View file

@ -12,8 +12,8 @@
"export": "Export task history",
"delete": "Delete Task (Shift + Click to skip confirmation)"
},
"unpin": "unpin",
"pin": "pin",
"unpin": "Unpin",
"pin": "Pin",
"retry": {
"title": "Retry",
"tooltip": "Try the operation again"

View file

@ -12,8 +12,8 @@
"export": "Exportar historial de tareas",
"delete": "Eliminar tarea (Shift + Clic para omitir confirmación)"
},
"unpin": "desanclar",
"pin": "anclar",
"unpin": "Desfijar",
"pin": "Fijar",
"retry": {
"title": "Reintentar",
"tooltip": "Intenta la operación de nuevo"

View file

@ -12,8 +12,8 @@
"export": "Exporter l'historique des tâches",
"delete": "Supprimer la tâche (Shift + Clic pour ignorer la confirmation)"
},
"unpin": "détacher",
"pin": "épingler",
"unpin": "Désépingler",
"pin": "Épingler",
"tokenProgress": {
"availableSpace": "Espace disponible : {{amount}} tokens",
"tokensUsed": "Tokens utilisés : {{used}} sur {{total}}",

View file

@ -12,8 +12,8 @@
"export": "कार्य इतिहास निर्यात करें",
"delete": "कार्य हटाएं (पुष्टि को छोड़ने के लिए Shift + क्लिक)"
},
"unpin": "पिन हटाएं",
"pin": "पिन करें",
"unpin": "पिन करें",
"pin": "अवपिन करें",
"tokenProgress": {
"availableSpace": "उपलब्ध स्थान: {{amount}} tokens",
"tokensUsed": "प्रयुक्त tokens: {{used}} / {{total}}",

View file

@ -12,8 +12,8 @@
"export": "Esporta cronologia attività",
"delete": "Elimina attività (Shift + Clic per saltare la conferma)"
},
"unpin": "sblocca",
"pin": "blocca",
"unpin": "Rilascia",
"pin": "Fissa",
"tokenProgress": {
"availableSpace": "Spazio disponibile: {{amount}} tokens",
"tokensUsed": "Tokens utilizzati: {{used}} di {{total}}",

View file

@ -12,8 +12,8 @@
"export": "タスク履歴をエクスポート",
"delete": "タスクを削除Shift + クリックで確認をスキップ)"
},
"unpin": "固定解除",
"pin": "固定",
"unpin": "ピン留めを解除",
"pin": "ピン留め",
"tokenProgress": {
"availableSpace": "利用可能な空き容量: {{amount}} トークン",
"tokensUsed": "使用トークン: {{used}} / {{total}}",

View file

@ -12,8 +12,8 @@
"export": "작업 기록 내보내기",
"delete": "작업 삭제 (Shift + 클릭으로 확인 생략)"
},
"unpin": "고정 해제",
"pin": "고정",
"unpin": "고정 해제하기",
"pin": "고정하기",
"tokenProgress": {
"availableSpace": "사용 가능한 공간: {{amount}} 토큰",
"tokensUsed": "사용된 토큰: {{used}} / {{total}}",

View file

@ -12,8 +12,8 @@
"export": "Eksportuj historię zadań",
"delete": "Usuń zadanie (Shift + Kliknięcie, aby pominąć potwierdzenie)"
},
"unpin": "odepnij",
"pin": "przypnij",
"unpin": "Odepnij",
"pin": "Przypnij",
"tokenProgress": {
"availableSpace": "Dostępne miejsce: {{amount}} tokenów",
"tokensUsed": "Wykorzystane tokeny: {{used}} z {{total}}",

View file

@ -12,8 +12,8 @@
"export": "Exportar histórico de tarefas",
"delete": "Excluir tarefa (Shift + Clique para pular confirmação)"
},
"unpin": "desafixar",
"pin": "fixar",
"unpin": "Desfixar",
"pin": "Fixar",
"tokenProgress": {
"availableSpace": "Espaço disponível: {{amount}} tokens",
"tokensUsed": "Tokens usados: {{used}} de {{total}}",

View file

@ -12,8 +12,8 @@
"export": "Görev geçmişini dışa aktar",
"delete": "Görevi sil (Onayı atlamak için Shift + Tıkla)"
},
"unpin": "sabitlemeyi kaldır",
"pin": "sabitle",
"unpin": "Sabitlemeyi iptal et",
"pin": "Sabitle",
"tokenProgress": {
"availableSpace": "Kullanılabilir alan: {{amount}} token",
"tokensUsed": "Kullanılan tokenlar: {{used}} / {{total}}",

View file

@ -12,8 +12,8 @@
"export": "Xuất lịch sử nhiệm vụ",
"delete": "Xóa nhiệm vụ (Shift + Click để bỏ qua xác nhận)"
},
"unpin": "bỏ ghim",
"pin": "ghim",
"unpin": "Bỏ ghim khỏi đầu",
"pin": "Ghim lên đầu",
"tokenProgress": {
"availableSpace": "Không gian khả dụng: {{amount}} tokens",
"tokensUsed": "Tokens đã sử dụng: {{used}} trong {{total}}",