diff --git a/frontend/src/components/editor/EditorToolbar.tsx b/frontend/src/components/editor/EditorToolbar.tsx index e1f14c94..51954573 100644 --- a/frontend/src/components/editor/EditorToolbar.tsx +++ b/frontend/src/components/editor/EditorToolbar.tsx @@ -1,4 +1,5 @@ import { useState, useCallback, useRef, useEffect } from 'react'; +import { useTranslation } from 'react-i18next'; import { useEditorStore } from '../../store/useEditorStore'; import { useSimulatorStore } from '../../store/useSimulatorStore'; import type { BoardKind, LanguageMode } from '../../types/board'; @@ -71,6 +72,7 @@ export const EditorToolbar = ({ centerSlot, rightSlot, }: EditorToolbarProps) => { + const { t } = useTranslation(); const { files, codeChangedSinceLastCompile, markCompiled } = useEditorStore(); const { boards, @@ -629,7 +631,7 @@ export const EditorToolbar = ({ if (activeBoardId) setBoardLanguageMode(activeBoardId, e.target.value as LanguageMode); }} - title="Language mode" + title={t('editor.toolbar.languageMode')} style={{ background: '#2d2d2d', color: '#ccc', @@ -655,12 +657,12 @@ export const EditorToolbar = ({ className="tb-btn tb-btn-compile" title={ !activeBoard - ? 'Add a board to compile' + ? t('editor.toolbar.compile.addBoard') : compiling - ? 'Loading…' + ? t('editor.toolbar.compile.loading') : activeBoard?.languageMode === 'micropython' - ? 'Load MicroPython' - : 'Compile (Ctrl+B)' + ? t('editor.toolbar.compile.loadMicropython') + : t('editor.toolbar.compile.compile') } > {compiling ? ( @@ -702,10 +704,10 @@ export const EditorToolbar = ({ className="tb-btn tb-btn-run" title={ !activeBoard - ? 'Add a board to run' + ? t('editor.toolbar.run.addBoard') : activeBoard?.languageMode === 'micropython' - ? 'Run MicroPython' - : 'Run (auto-compiles if needed)' + ? t('editor.toolbar.run.runMicropython') + : t('editor.toolbar.run.run') } > @@ -718,7 +720,7 @@ export const EditorToolbar = ({ onClick={handleStop} disabled={!running} className="tb-btn tb-btn-stop" - title="Stop" + title={t('editor.toolbar.stop')} > @@ -730,7 +732,7 @@ export const EditorToolbar = ({ onClick={handleReset} disabled={!compiledHex && !activeBoard?.compiledProgram} className="tb-btn tb-btn-reset" - title="Reset" + title={t('editor.toolbar.reset')} > @@ -817,7 +819,7 @@ export const EditorToolbar = ({ setLibManagerOpen(true); }} className="tb-btn-libraries" - title="Search and install Arduino libraries" + title={t('editor.toolbar.libraries.title')} > - Libraries + {t('editor.toolbar.libraries.label')} {/* Import zip — was previously hidden in a 3-dot overflow menu; @@ -842,7 +844,7 @@ export const EditorToolbar = ({ diff --git a/frontend/src/i18n/locales/de/common.json b/frontend/src/i18n/locales/de/common.json index 835dcf62..fa66c026 100644 --- a/frontend/src/i18n/locales/de/common.json +++ b/frontend/src/i18n/locales/de/common.json @@ -76,5 +76,38 @@ "ctaSponsors": "GitHub Sponsors", "ctaPaypal": "Über PayPal spenden" } + }, + "editor": { + "toolbar": { + "languageMode": "Sprachmodus", + "compile": { + "addBoard": "Board hinzufügen, um zu kompilieren", + "loading": "Wird geladen…", + "loadMicropython": "MicroPython laden", + "compile": "Kompilieren (Strg+B)" + }, + "run": { + "addBoard": "Board hinzufügen, um auszuführen", + "runMicropython": "MicroPython ausführen", + "run": "Ausführen (kompiliert bei Bedarf automatisch)" + }, + "stop": "Stoppen", + "reset": "Zurücksetzen", + "compileAll": "Alle Boards kompilieren", + "runAll": "Alle Boards ausführen", + "libraries": { + "title": "Arduino-Bibliotheken suchen und installieren", + "label": "Bibliotheken" + }, + "import": "Projekt aus einer .zip-Datei importieren", + "export": "Aktuelles Projekt als .zip exportieren", + "uploadFirmware": "Firmware (.hex, .bin, .elf, .ihex) hochladen und Kompilierung überspringen", + "toggleConsole": "Ausgabekonsole umschalten", + "libHint": { + "message": "Bibliothek fehlt? Installiere sie über den", + "cta": "Bibliotheksmanager", + "dismiss": "Schließen" + } + } } } diff --git a/frontend/src/i18n/locales/en/common.json b/frontend/src/i18n/locales/en/common.json index 10f91069..174c283e 100644 --- a/frontend/src/i18n/locales/en/common.json +++ b/frontend/src/i18n/locales/en/common.json @@ -76,5 +76,38 @@ "ctaSponsors": "GitHub Sponsors", "ctaPaypal": "Donate via PayPal" } + }, + "editor": { + "toolbar": { + "languageMode": "Language mode", + "compile": { + "addBoard": "Add a board to compile", + "loading": "Loading…", + "loadMicropython": "Load MicroPython", + "compile": "Compile (Ctrl+B)" + }, + "run": { + "addBoard": "Add a board to run", + "runMicropython": "Run MicroPython", + "run": "Run (auto-compiles if needed)" + }, + "stop": "Stop", + "reset": "Reset", + "compileAll": "Compile all boards", + "runAll": "Run all boards", + "libraries": { + "title": "Search and install Arduino libraries", + "label": "Libraries" + }, + "import": "Import a project from a .zip file", + "export": "Export the current project as a .zip file", + "uploadFirmware": "Upload firmware (.hex, .bin, .elf, .ihex) to bypass compilation", + "toggleConsole": "Toggle Output Console", + "libHint": { + "message": "Missing library? Install it from the", + "cta": "Library Manager", + "dismiss": "Dismiss" + } + } } } diff --git a/frontend/src/i18n/locales/es/common.json b/frontend/src/i18n/locales/es/common.json index 2059a8af..3fa2678d 100644 --- a/frontend/src/i18n/locales/es/common.json +++ b/frontend/src/i18n/locales/es/common.json @@ -76,5 +76,38 @@ "ctaSponsors": "GitHub Sponsors", "ctaPaypal": "Donar con PayPal" } + }, + "editor": { + "toolbar": { + "languageMode": "Modo de lenguaje", + "compile": { + "addBoard": "Añade una placa para compilar", + "loading": "Cargando…", + "loadMicropython": "Cargar MicroPython", + "compile": "Compilar (Ctrl+B)" + }, + "run": { + "addBoard": "Añade una placa para ejecutar", + "runMicropython": "Ejecutar MicroPython", + "run": "Ejecutar (compila automáticamente si hace falta)" + }, + "stop": "Detener", + "reset": "Reiniciar", + "compileAll": "Compilar todas las placas", + "runAll": "Ejecutar todas las placas", + "libraries": { + "title": "Buscar e instalar librerías de Arduino", + "label": "Librerías" + }, + "import": "Importar un proyecto desde un archivo .zip", + "export": "Exportar el proyecto actual como archivo .zip", + "uploadFirmware": "Subir firmware (.hex, .bin, .elf, .ihex) para saltar la compilación", + "toggleConsole": "Mostrar/ocultar consola de salida", + "libHint": { + "message": "¿Falta una librería? Instálala desde el", + "cta": "Gestor de librerías", + "dismiss": "Descartar" + } + } } } diff --git a/frontend/src/i18n/locales/fr/common.json b/frontend/src/i18n/locales/fr/common.json index c54705ca..990bd9a7 100644 --- a/frontend/src/i18n/locales/fr/common.json +++ b/frontend/src/i18n/locales/fr/common.json @@ -76,5 +76,38 @@ "ctaSponsors": "GitHub Sponsors", "ctaPaypal": "Faire un don via PayPal" } + }, + "editor": { + "toolbar": { + "languageMode": "Mode de langage", + "compile": { + "addBoard": "Ajoutez une carte pour compiler", + "loading": "Chargement…", + "loadMicropython": "Charger MicroPython", + "compile": "Compiler (Ctrl+B)" + }, + "run": { + "addBoard": "Ajoutez une carte pour exécuter", + "runMicropython": "Exécuter MicroPython", + "run": "Exécuter (compile automatiquement si besoin)" + }, + "stop": "Arrêter", + "reset": "Réinitialiser", + "compileAll": "Compiler toutes les cartes", + "runAll": "Exécuter toutes les cartes", + "libraries": { + "title": "Rechercher et installer des bibliothèques Arduino", + "label": "Bibliothèques" + }, + "import": "Importer un projet depuis un fichier .zip", + "export": "Exporter le projet courant en .zip", + "uploadFirmware": "Téléverser un firmware (.hex, .bin, .elf, .ihex) pour contourner la compilation", + "toggleConsole": "Afficher/masquer la console de sortie", + "libHint": { + "message": "Bibliothèque manquante ? Installez-la depuis le", + "cta": "Gestionnaire de bibliothèques", + "dismiss": "Fermer" + } + } } } diff --git a/frontend/src/i18n/locales/it/common.json b/frontend/src/i18n/locales/it/common.json index 5a160d28..729511a2 100644 --- a/frontend/src/i18n/locales/it/common.json +++ b/frontend/src/i18n/locales/it/common.json @@ -76,5 +76,38 @@ "ctaSponsors": "GitHub Sponsors", "ctaPaypal": "Dona con PayPal" } + }, + "editor": { + "toolbar": { + "languageMode": "Modalità linguaggio", + "compile": { + "addBoard": "Aggiungi una scheda per compilare", + "loading": "Caricamento…", + "loadMicropython": "Carica MicroPython", + "compile": "Compila (Ctrl+B)" + }, + "run": { + "addBoard": "Aggiungi una scheda per eseguire", + "runMicropython": "Esegui MicroPython", + "run": "Esegui (compila automaticamente se necessario)" + }, + "stop": "Ferma", + "reset": "Reset", + "compileAll": "Compila tutte le schede", + "runAll": "Esegui tutte le schede", + "libraries": { + "title": "Cerca e installa librerie Arduino", + "label": "Librerie" + }, + "import": "Importa un progetto da un file .zip", + "export": "Esporta il progetto corrente come file .zip", + "uploadFirmware": "Carica firmware (.hex, .bin, .elf, .ihex) per saltare la compilazione", + "toggleConsole": "Mostra/nascondi console di output", + "libHint": { + "message": "Manca una libreria? Installala dal", + "cta": "Gestore Librerie", + "dismiss": "Ignora" + } + } } } diff --git a/frontend/src/i18n/locales/ja/common.json b/frontend/src/i18n/locales/ja/common.json index 717b501a..a8b91d02 100644 --- a/frontend/src/i18n/locales/ja/common.json +++ b/frontend/src/i18n/locales/ja/common.json @@ -76,5 +76,38 @@ "ctaSponsors": "GitHub Sponsors", "ctaPaypal": "PayPal で寄付する" } + }, + "editor": { + "toolbar": { + "languageMode": "言語モード", + "compile": { + "addBoard": "コンパイルするにはボードを追加してください", + "loading": "読み込み中…", + "loadMicropython": "MicroPython を読み込む", + "compile": "コンパイル (Ctrl+B)" + }, + "run": { + "addBoard": "実行するにはボードを追加してください", + "runMicropython": "MicroPython を実行", + "run": "実行(必要に応じて自動コンパイル)" + }, + "stop": "停止", + "reset": "リセット", + "compileAll": "すべてのボードをコンパイル", + "runAll": "すべてのボードを実行", + "libraries": { + "title": "Arduino ライブラリを検索・インストール", + "label": "ライブラリ" + }, + "import": ".zip ファイルからプロジェクトをインポート", + "export": "現在のプロジェクトを .zip としてエクスポート", + "uploadFirmware": "ファームウェア (.hex, .bin, .elf, .ihex) をアップロードしてコンパイルをスキップ", + "toggleConsole": "出力コンソールの表示切り替え", + "libHint": { + "message": "ライブラリが足りませんか?こちらからインストール:", + "cta": "ライブラリマネージャー", + "dismiss": "閉じる" + } + } } } diff --git a/frontend/src/i18n/locales/pt-br/common.json b/frontend/src/i18n/locales/pt-br/common.json index dae4d619..c8ea1238 100644 --- a/frontend/src/i18n/locales/pt-br/common.json +++ b/frontend/src/i18n/locales/pt-br/common.json @@ -76,5 +76,38 @@ "ctaSponsors": "GitHub Sponsors", "ctaPaypal": "Doar via PayPal" } + }, + "editor": { + "toolbar": { + "languageMode": "Modo de linguagem", + "compile": { + "addBoard": "Adicione uma placa para compilar", + "loading": "Carregando…", + "loadMicropython": "Carregar MicroPython", + "compile": "Compilar (Ctrl+B)" + }, + "run": { + "addBoard": "Adicione uma placa para executar", + "runMicropython": "Executar MicroPython", + "run": "Executar (compila automaticamente se necessário)" + }, + "stop": "Parar", + "reset": "Reiniciar", + "compileAll": "Compilar todas as placas", + "runAll": "Executar todas as placas", + "libraries": { + "title": "Buscar e instalar bibliotecas Arduino", + "label": "Bibliotecas" + }, + "import": "Importar um projeto de um arquivo .zip", + "export": "Exportar o projeto atual como arquivo .zip", + "uploadFirmware": "Enviar firmware (.hex, .bin, .elf, .ihex) para pular a compilação", + "toggleConsole": "Alternar console de saída", + "libHint": { + "message": "Faltando uma biblioteca? Instale a partir do", + "cta": "Gerenciador de Bibliotecas", + "dismiss": "Dispensar" + } + } } } diff --git a/frontend/src/i18n/locales/ru/common.json b/frontend/src/i18n/locales/ru/common.json index d0f660c7..ee815f88 100644 --- a/frontend/src/i18n/locales/ru/common.json +++ b/frontend/src/i18n/locales/ru/common.json @@ -76,5 +76,38 @@ "ctaSponsors": "GitHub Sponsors", "ctaPaypal": "Пожертвовать через PayPal" } + }, + "editor": { + "toolbar": { + "languageMode": "Режим языка", + "compile": { + "addBoard": "Добавьте плату, чтобы скомпилировать", + "loading": "Загрузка…", + "loadMicropython": "Загрузить MicroPython", + "compile": "Компилировать (Ctrl+B)" + }, + "run": { + "addBoard": "Добавьте плату, чтобы запустить", + "runMicropython": "Запустить MicroPython", + "run": "Запустить (при необходимости компилируется автоматически)" + }, + "stop": "Остановить", + "reset": "Сбросить", + "compileAll": "Скомпилировать все платы", + "runAll": "Запустить все платы", + "libraries": { + "title": "Поиск и установка библиотек Arduino", + "label": "Библиотеки" + }, + "import": "Импорт проекта из .zip", + "export": "Экспорт текущего проекта в .zip", + "uploadFirmware": "Загрузить прошивку (.hex, .bin, .elf, .ihex) и пропустить компиляцию", + "toggleConsole": "Показать/скрыть консоль вывода", + "libHint": { + "message": "Не хватает библиотеки? Установите её через", + "cta": "Менеджер библиотек", + "dismiss": "Закрыть" + } + } } } diff --git a/frontend/src/i18n/locales/zh-cn/common.json b/frontend/src/i18n/locales/zh-cn/common.json index db15ba29..d54dc954 100644 --- a/frontend/src/i18n/locales/zh-cn/common.json +++ b/frontend/src/i18n/locales/zh-cn/common.json @@ -76,5 +76,38 @@ "ctaSponsors": "GitHub Sponsors", "ctaPaypal": "通过 PayPal 捐赠" } + }, + "editor": { + "toolbar": { + "languageMode": "语言模式", + "compile": { + "addBoard": "请先添加开发板才能编译", + "loading": "加载中…", + "loadMicropython": "加载 MicroPython", + "compile": "编译 (Ctrl+B)" + }, + "run": { + "addBoard": "请先添加开发板才能运行", + "runMicropython": "运行 MicroPython", + "run": "运行(如需要会自动编译)" + }, + "stop": "停止", + "reset": "重置", + "compileAll": "编译所有开发板", + "runAll": "运行所有开发板", + "libraries": { + "title": "搜索并安装 Arduino 库", + "label": "库" + }, + "import": "从 .zip 文件导入项目", + "export": "将当前项目导出为 .zip 文件", + "uploadFirmware": "上传固件(.hex、.bin、.elf、.ihex)以跳过编译", + "toggleConsole": "切换输出控制台", + "libHint": { + "message": "缺少库?从这里安装", + "cta": "库管理器", + "dismiss": "关闭" + } + } } }