Skip to content
8 changes: 6 additions & 2 deletions src/core/webview/webviewMessageHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import { checkoutDiffPayloadSchema, checkoutRestorePayloadSchema, WebviewMessage
import { checkExistKey } from "../../shared/checkExistApiConfig"
import { experimentDefault } from "../../shared/experiments"
import { Terminal } from "../../integrations/terminal/Terminal"
import { openFile, openImage } from "../../integrations/misc/open-file"
import { openFile } from "../../integrations/misc/open-file"
import { openImage, saveImage } from "../../integrations/misc/image-handler"
import { selectImages } from "../../integrations/misc/process-images"
import { getTheme } from "../../integrations/theme/getTheme"
import { discoverChromeHostUrl, tryChromeHostUrl } from "../../services/browser/browserDiscovery"
Expand Down Expand Up @@ -423,7 +424,10 @@ export const webviewMessageHandler = async (
provider.postMessageToWebview({ type: "vsCodeLmModels", vsCodeLmModels })
break
case "openImage":
openImage(message.text!)
openImage(message.text!, { values: message.values })
break
case "saveImage":
saveImage(message.dataUri!)
break
case "openFile":
openFile(message.text!, message.values as { create?: boolean; content?: string; line?: number })
Expand Down
9 changes: 8 additions & 1 deletion src/i18n/locales/ca/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
},
"errors": {
"invalid_data_uri": "Format d'URI de dades no vàlid",
"error_copying_image": "Error copiant la imatge: {{errorMessage}}",
"error_saving_image": "Error desant la imatge: {{errorMessage}}",
"error_opening_image": "Error obrint la imatge: {{error}}",
"could_not_open_file": "No s'ha pogut obrir el fitxer: {{errorMessage}}",
"could_not_open_file_generic": "No s'ha pogut obrir el fitxer!",
"checkpoint_timeout": "S'ha esgotat el temps en intentar restaurar el punt de control.",
"checkpoint_failed": "Ha fallat la restauració del punt de control.",
"no_workspace": "Si us plau, obre primer una carpeta de projecte",
Expand Down Expand Up @@ -71,7 +76,9 @@
"custom_storage_path_set": "Ruta d'emmagatzematge personalitzada establerta: {{path}}",
"default_storage_path": "S'ha reprès l'ús de la ruta d'emmagatzematge predeterminada",
"settings_imported": "Configuració importada correctament.",
"share_link_copied": "Enllaç de compartició copiat al portapapers"
"share_link_copied": "Enllaç de compartició copiat al portapapers",
"image_copied_to_clipboard": "URI de dades de la imatge copiada al portapapers",
"image_saved": "Imatge desada a {{path}}"
},
"answers": {
"yes": "Sí",
Expand Down
9 changes: 8 additions & 1 deletion src/i18n/locales/de/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
},
"errors": {
"invalid_data_uri": "Ungültiges Daten-URI-Format",
"error_copying_image": "Fehler beim Kopieren des Bildes: {{errorMessage}}",
"error_saving_image": "Fehler beim Speichern des Bildes: {{errorMessage}}",
"error_opening_image": "Fehler beim Öffnen des Bildes: {{error}}",
"could_not_open_file": "Datei konnte nicht geöffnet werden: {{errorMessage}}",
"could_not_open_file_generic": "Datei konnte nicht geöffnet werden!",
"checkpoint_timeout": "Zeitüberschreitung beim Versuch, den Checkpoint wiederherzustellen.",
"checkpoint_failed": "Fehler beim Wiederherstellen des Checkpoints.",
"no_workspace": "Bitte öffne zuerst einen Projektordner",
Expand Down Expand Up @@ -67,7 +72,9 @@
"custom_storage_path_set": "Benutzerdefinierter Speicherpfad festgelegt: {{path}}",
"default_storage_path": "Auf Standardspeicherpfad zurückgesetzt",
"settings_imported": "Einstellungen erfolgreich importiert.",
"share_link_copied": "Share-Link in die Zwischenablage kopiert"
"share_link_copied": "Share-Link in die Zwischenablage kopiert",
"image_copied_to_clipboard": "Bild-Daten-URI in die Zwischenablage kopiert",
"image_saved": "Bild gespeichert unter {{path}}"
},
"answers": {
"yes": "Ja",
Expand Down
9 changes: 8 additions & 1 deletion src/i18n/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
},
"errors": {
"invalid_data_uri": "Invalid data URI format",
"error_copying_image": "Error copying image: {{errorMessage}}",
"error_opening_image": "Error opening image: {{error}}",
"error_saving_image": "Error saving image: {{errorMessage}}",
"could_not_open_file": "Could not open file: {{errorMessage}}",
"could_not_open_file_generic": "Could not open file!",
"checkpoint_timeout": "Timed out when attempting to restore checkpoint.",
"checkpoint_failed": "Failed to restore checkpoint.",
"no_workspace": "Please open a project folder first",
Expand Down Expand Up @@ -67,7 +72,9 @@
"custom_storage_path_set": "Custom storage path set: {{path}}",
"default_storage_path": "Reverted to using default storage path",
"settings_imported": "Settings imported successfully.",
"share_link_copied": "Share link copied to clipboard"
"share_link_copied": "Share link copied to clipboard",
"image_copied_to_clipboard": "Image data URI copied to clipboard",
"image_saved": "Image saved to {{path}}"
},
"answers": {
"yes": "Yes",
Expand Down
9 changes: 8 additions & 1 deletion src/i18n/locales/es/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
},
"errors": {
"invalid_data_uri": "Formato de URI de datos no válido",
"error_copying_image": "Error copiando la imagen: {{errorMessage}}",
"error_saving_image": "Error guardando la imagen: {{errorMessage}}",
"error_opening_image": "Error abriendo la imagen: {{error}}",
"could_not_open_file": "No se pudo abrir el archivo: {{errorMessage}}",
"could_not_open_file_generic": "¡No se pudo abrir el archivo!",
"checkpoint_timeout": "Se agotó el tiempo al intentar restaurar el punto de control.",
"checkpoint_failed": "Error al restaurar el punto de control.",
"no_workspace": "Por favor, abre primero una carpeta de proyecto",
Expand Down Expand Up @@ -67,7 +72,9 @@
"custom_storage_path_set": "Ruta de almacenamiento personalizada establecida: {{path}}",
"default_storage_path": "Se ha vuelto a usar la ruta de almacenamiento predeterminada",
"settings_imported": "Configuración importada correctamente.",
"share_link_copied": "Enlace de compartir copiado al portapapeles"
"share_link_copied": "Enlace de compartir copiado al portapapeles",
"image_copied_to_clipboard": "URI de datos de imagen copiada al portapapeles",
"image_saved": "Imagen guardada en {{path}}"
},
"answers": {
"yes": "Sí",
Expand Down
9 changes: 8 additions & 1 deletion src/i18n/locales/fr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
},
"errors": {
"invalid_data_uri": "Format d'URI de données invalide",
"error_copying_image": "Erreur lors de la copie de l'image : {{errorMessage}}",
"error_saving_image": "Erreur lors de l'enregistrement de l'image : {{errorMessage}}",
"error_opening_image": "Erreur lors de l'ouverture de l'image : {{error}}",
"could_not_open_file": "Impossible d'ouvrir le fichier : {{errorMessage}}",
"could_not_open_file_generic": "Impossible d'ouvrir le fichier !",
"checkpoint_timeout": "Expiration du délai lors de la tentative de rétablissement du checkpoint.",
"checkpoint_failed": "Échec du rétablissement du checkpoint.",
"no_workspace": "Veuillez d'abord ouvrir un espace de travail",
Expand Down Expand Up @@ -67,7 +72,9 @@
"custom_storage_path_set": "Chemin de stockage personnalisé défini : {{path}}",
"default_storage_path": "Retour au chemin de stockage par défaut",
"settings_imported": "Paramètres importés avec succès.",
"share_link_copied": "Lien de partage copié dans le presse-papiers"
"share_link_copied": "Lien de partage copié dans le presse-papiers",
"image_copied_to_clipboard": "URI de données d'image copiée dans le presse-papiers",
"image_saved": "Image enregistrée dans {{path}}"
},
"answers": {
"yes": "Oui",
Expand Down
11 changes: 9 additions & 2 deletions src/i18n/locales/hi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
},
"errors": {
"invalid_data_uri": "अमान्य डेटा URI फॉर्मेट",
"error_copying_image": "छवि कॉपी करने में त्रुटि: {{errorMessage}}",
"error_saving_image": "छवि सहेजने में त्रुटि: {{errorMessage}}",
"error_opening_image": "छवि खोलने में त्रुटि: {{error}}",
"could_not_open_file": "फ़ाइल नहीं खोली जा सकी: {{errorMessage}}",
"could_not_open_file_generic": "फ़ाइल नहीं खोली जा सकी!",
"checkpoint_timeout": "चेकपॉइंट को पुनर्स्थापित करने का प्रयास करते समय टाइमआउट हो गया।",
"checkpoint_failed": "चेकपॉइंट पुनर्स्थापित करने में विफल।",
"no_workspace": "कृपया पहले प्रोजेक्ट फ़ोल्डर खोलें",
Expand Down Expand Up @@ -66,8 +71,10 @@
"history_cleanup": "इतिहास से गायब फाइलों वाले {{count}} टास्क साफ किए गए।",
"custom_storage_path_set": "कस्टम स्टोरेज पाथ सेट किया गया: {{path}}",
"default_storage_path": "डिफ़ॉल्ट स्टोरेज पाथ का उपयोग पुनः शुरू किया गया",
"settings_imported": "सेटिंग्स सफलतापूर्वक इम्पोर्ट की गईं.",
"share_link_copied": "साझा लिंक क्लिपबोर्ड पर कॉपी किया गया"
"settings_imported": "सेटिंग्स सफलतापूर्वक इम्पोर्ट की गईं।",
"share_link_copied": "साझा लिंक क्लिपबोर्ड पर कॉपी किया गया",
"image_copied_to_clipboard": "छवि डेटा URI क्लिपबोर्ड में कॉपी की गई",
"image_saved": "छवि {{path}} में सहेजी गई"
},
"answers": {
"yes": "हां",
Expand Down
9 changes: 8 additions & 1 deletion src/i18n/locales/it/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
},
"errors": {
"invalid_data_uri": "Formato URI dati non valido",
"error_copying_image": "Errore durante la copia dell'immagine: {{errorMessage}}",
"error_saving_image": "Errore durante il salvataggio dell'immagine: {{errorMessage}}",
"error_opening_image": "Errore durante l'apertura dell'immagine: {{error}}",
"could_not_open_file": "Impossibile aprire il file: {{errorMessage}}",
"could_not_open_file_generic": "Impossibile aprire il file!",
"checkpoint_timeout": "Timeout durante il tentativo di ripristinare il checkpoint.",
"checkpoint_failed": "Impossibile ripristinare il checkpoint.",
"no_workspace": "Per favore, apri prima una cartella di progetto",
Expand Down Expand Up @@ -67,7 +72,9 @@
"custom_storage_path_set": "Percorso di archiviazione personalizzato impostato: {{path}}",
"default_storage_path": "Tornato al percorso di archiviazione predefinito",
"settings_imported": "Impostazioni importate con successo.",
"share_link_copied": "Link di condivisione copiato negli appunti"
"share_link_copied": "Link di condivisione copiato negli appunti",
"image_copied_to_clipboard": "URI dati dell'immagine copiato negli appunti",
"image_saved": "Immagine salvata in {{path}}"
},
"answers": {
"yes": "Sì",
Expand Down
9 changes: 8 additions & 1 deletion src/i18n/locales/ja/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
},
"errors": {
"invalid_data_uri": "データURIフォーマットが無効です",
"error_copying_image": "画像のコピー中にエラーが発生しました:{{errorMessage}}",
"error_saving_image": "画像の保存中にエラーが発生しました:{{errorMessage}}",
"error_opening_image": "画像を開く際にエラーが発生しました:{{error}}",
"could_not_open_file": "ファイルを開けませんでした:{{errorMessage}}",
"could_not_open_file_generic": "ファイルを開けませんでした!",
"checkpoint_timeout": "チェックポイントの復元を試みる際にタイムアウトしました。",
"checkpoint_failed": "チェックポイントの復元に失敗しました。",
"no_workspace": "まずプロジェクトフォルダを開いてください",
Expand Down Expand Up @@ -67,7 +72,9 @@
"custom_storage_path_set": "カスタムストレージパスが設定されました:{{path}}",
"default_storage_path": "デフォルトのストレージパスに戻りました",
"settings_imported": "設定が正常にインポートされました。",
"share_link_copied": "共有リンクがクリップボードにコピーされました"
"share_link_copied": "共有リンクがクリップボードにコピーされました",
"image_copied_to_clipboard": "画像データURIがクリップボードにコピーされました",
"image_saved": "画像を{{path}}に保存しました"
},
"answers": {
"yes": "はい",
Expand Down
9 changes: 8 additions & 1 deletion src/i18n/locales/ko/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
},
"errors": {
"invalid_data_uri": "잘못된 데이터 URI 형식",
"error_copying_image": "이미지 복사 중 오류 발생: {{errorMessage}}",
"error_saving_image": "이미지 저장 중 오류 발생: {{errorMessage}}",
"error_opening_image": "이미지 열기 중 오류 발생: {{error}}",
"could_not_open_file": "파일을 열 수 없습니다: {{errorMessage}}",
"could_not_open_file_generic": "파일을 열 수 없습니다!",
"checkpoint_timeout": "체크포인트 복원을 시도하는 중 시간 초과되었습니다.",
"checkpoint_failed": "체크포인트 복원에 실패했습니다.",
"no_workspace": "먼저 프로젝트 폴더를 열어주세요",
Expand Down Expand Up @@ -67,7 +72,9 @@
"custom_storage_path_set": "사용자 지정 저장 경로 설정됨: {{path}}",
"default_storage_path": "기본 저장 경로로 되돌아갔습니다",
"settings_imported": "설정이 성공적으로 가져와졌습니다.",
"share_link_copied": "공유 링크가 클립보드에 복사되었습니다"
"share_link_copied": "공유 링크가 클립보드에 복사되었습니다",
"image_copied_to_clipboard": "이미지 데이터 URI가 클립보드에 복사되었습니다",
"image_saved": "이미지가 {{path}}에 저장되었습니다"
},
"answers": {
"yes": "",
Expand Down
9 changes: 8 additions & 1 deletion src/i18n/locales/nl/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
},
"errors": {
"invalid_data_uri": "Ongeldig data-URI-formaat",
"error_copying_image": "Fout bij kopiëren van afbeelding: {{errorMessage}}",
"error_saving_image": "Fout bij opslaan van afbeelding: {{errorMessage}}",
"error_opening_image": "Fout bij openen van afbeelding: {{error}}",
"could_not_open_file": "Kon bestand niet openen: {{errorMessage}}",
"could_not_open_file_generic": "Kon bestand niet openen!",
"checkpoint_timeout": "Time-out bij het herstellen van checkpoint.",
"checkpoint_failed": "Herstellen van checkpoint mislukt.",
"no_workspace": "Open eerst een projectmap",
Expand Down Expand Up @@ -67,7 +72,9 @@
"custom_storage_path_set": "Aangepast opslagpad ingesteld: {{path}}",
"default_storage_path": "Terug naar standaard opslagpad",
"settings_imported": "Instellingen succesvol geïmporteerd.",
"share_link_copied": "Deellink gekopieerd naar klembord"
"share_link_copied": "Deellink gekopieerd naar klembord",
"image_copied_to_clipboard": "Afbeelding data-URI gekopieerd naar klembord",
"image_saved": "Afbeelding opgeslagen naar {{path}}"
},
"answers": {
"yes": "Ja",
Expand Down
9 changes: 8 additions & 1 deletion src/i18n/locales/pl/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
},
"errors": {
"invalid_data_uri": "Nieprawidłowy format URI danych",
"error_copying_image": "Błąd kopiowania obrazu: {{errorMessage}}",
"error_saving_image": "Błąd zapisywania obrazu: {{errorMessage}}",
"error_opening_image": "Błąd otwierania obrazu: {{error}}",
"could_not_open_file": "Nie można otworzyć pliku: {{errorMessage}}",
"could_not_open_file_generic": "Nie można otworzyć pliku!",
"checkpoint_timeout": "Upłynął limit czasu podczas próby przywrócenia punktu kontrolnego.",
"checkpoint_failed": "Nie udało się przywrócić punktu kontrolnego.",
"no_workspace": "Najpierw otwórz folder projektu",
Expand Down Expand Up @@ -67,7 +72,9 @@
"custom_storage_path_set": "Ustawiono niestandardową ścieżkę przechowywania: {{path}}",
"default_storage_path": "Wznowiono używanie domyślnej ścieżki przechowywania",
"settings_imported": "Ustawienia zaimportowane pomyślnie.",
"share_link_copied": "Link udostępniania skopiowany do schowka"
"share_link_copied": "Link udostępniania skopiowany do schowka",
"image_copied_to_clipboard": "URI danych obrazu skopiowane do schowka",
"image_saved": "Obraz zapisany w {{path}}"
},
"answers": {
"yes": "Tak",
Expand Down
9 changes: 8 additions & 1 deletion src/i18n/locales/pt-BR/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
},
"errors": {
"invalid_data_uri": "Formato de URI de dados inválido",
"error_copying_image": "Erro ao copiar imagem: {{errorMessage}}",
"error_saving_image": "Erro ao salvar imagem: {{errorMessage}}",
"error_opening_image": "Erro ao abrir imagem: {{error}}",
"could_not_open_file": "Não foi possível abrir o arquivo: {{errorMessage}}",
"could_not_open_file_generic": "Não foi possível abrir o arquivo!",
"checkpoint_timeout": "Tempo esgotado ao tentar restaurar o ponto de verificação.",
"checkpoint_failed": "Falha ao restaurar o ponto de verificação.",
"no_workspace": "Por favor, abra primeiro uma pasta de projeto",
Expand Down Expand Up @@ -71,7 +76,9 @@
"custom_storage_path_set": "Caminho de armazenamento personalizado definido: {{path}}",
"default_storage_path": "Retornado ao caminho de armazenamento padrão",
"settings_imported": "Configurações importadas com sucesso.",
"share_link_copied": "Link de compartilhamento copiado para a área de transferência"
"share_link_copied": "Link de compartilhamento copiado para a área de transferência",
"image_copied_to_clipboard": "URI de dados da imagem copiada para a área de transferência",
"image_saved": "Imagem salva em {{path}}"
},
"answers": {
"yes": "Sim",
Expand Down
9 changes: 8 additions & 1 deletion src/i18n/locales/ru/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
},
"errors": {
"invalid_data_uri": "Неверный формат URI данных",
"error_copying_image": "Ошибка копирования изображения: {{errorMessage}}",
"error_saving_image": "Ошибка сохранения изображения: {{errorMessage}}",
"error_opening_image": "Ошибка открытия изображения: {{error}}",
"could_not_open_file": "Не удалось открыть файл: {{errorMessage}}",
"could_not_open_file_generic": "Не удалось открыть файл!",
"checkpoint_timeout": "Превышено время ожидания при попытке восстановления контрольной точки.",
"checkpoint_failed": "Не удалось восстановить контрольную точку.",
"no_workspace": "Пожалуйста, сначала откройте папку проекта",
Expand Down Expand Up @@ -67,7 +72,9 @@
"custom_storage_path_set": "Установлен пользовательский путь хранения: {{path}}",
"default_storage_path": "Возвращено использование пути хранения по умолчанию",
"settings_imported": "Настройки успешно импортированы.",
"share_link_copied": "Ссылка для совместного использования скопирована в буфер обмена"
"share_link_copied": "Ссылка для совместного использования скопирована в буфер обмена",
"image_copied_to_clipboard": "URI данных изображения скопирован в буфер обмена",
"image_saved": "Изображение сохранено в {{path}}"
},
"answers": {
"yes": "Да",
Expand Down
Loading
Loading