From 2699f267db7d57b38bcdb1fea8a5fbe1b85801d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D1=82=D0=BE=D0=BD=20=D0=A2=D1=80=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Sun, 9 Aug 2026 16:36:25 +0300 Subject: [PATCH] =?UTF-8?q?i18n:=20translate=20card=20reader=20connected?= =?UTF-8?q?=20state=20=E2=80=94=2030=20new=20keys=20for=20buttons,=20pills?= =?UTF-8?q?,=20labels,=20status=20messages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 105 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 68 insertions(+), 37 deletions(-) diff --git a/index.html b/index.html index 2638e83..5e6457c 100644 --- a/index.html +++ b/index.html @@ -885,10 +885,10 @@ pysim
- - - - + + + +
@@ -896,10 +896,10 @@
@@ -928,11 +928,11 @@
@@ -957,7 +957,7 @@ @@ -968,13 +968,13 @@
- +
@@ -2571,7 +2571,7 @@ async function pysimRefresh() { return true; } catch (e) { pysimSetConnected(false); - statusEl.textContent = 'Connection failed: ' + e.message; + statusEl.textContent = t('Connection failed: ') + ' ' + e.message; return false; } } @@ -2581,9 +2581,9 @@ async function pysimConnect() { pysimBase = urlInput.value.replace(/\/+$/, ''); const btn = document.getElementById('pysim-connect-btn'); btn.disabled = true; - btn.textContent = 'Connecting...'; + btn.textContent = t('Connecting...'); const statusEl = document.getElementById('pysim-status'); - statusEl.innerHTML = 'Checking card...'; + statusEl.innerHTML = '' + t('Checking card...') + ''; pysimSetConnected('spin'); try { // Version check @@ -2606,9 +2606,9 @@ async function pysimConnect() { const cmd = await pysimFetch('/api/command', { cmd: 'status' }); if (cmd.output && (cmd.output.includes('Exception') || cmd.output.includes('ProtocolError'))) { pysimSetConnected(false); - statusEl.innerHTML = 'No card detected. Insert card and click Equip card button'; + statusEl.innerHTML = '' + t('No card detected. Insert card and click Equip card button') + ''; pysimShowConnected(true); - btn.textContent = 'Connected'; + btn.textContent = t('Connected'); btn.disabled = false; return; } @@ -2617,11 +2617,11 @@ async function pysimConnect() { await pysimRefresh(); pysimLoadCommands(); pysimFsRefresh(); - btn.textContent = 'Connected'; + btn.textContent = t('Connected'); stkCheckMenu(); } catch (e) { pysimSetConnected(false); - statusEl.innerHTML = 'Connection failed: ' + esc(e.message) + ''; + statusEl.innerHTML = '' + t('Connection failed: ') + ' ' + esc(e.message) + ''; btn.textContent = 'Connect'; } btn.disabled = false; @@ -2639,20 +2639,20 @@ async function pysimRunCmd(cmd) { const result = await pysimFetch('/api/command', { cmd }); if (result.output && (result.output.includes('Exception') || result.output.includes('ProtocolError') || result.output.includes('SwMatchError'))) { pysimSetConnected(false); - statusEl.innerHTML = 'No card detected. Insert card and click Equip card button'; + statusEl.innerHTML = '' + t('No card detected. Insert card and click Equip card button') + ''; return null; } return result; } catch (e) { pysimSetConnected(false); - statusEl.innerHTML = 'No card detected. Insert card and click Equip card button'; + statusEl.innerHTML = '' + t('No card detected. Insert card and click Equip card button') + ''; return null; } } async function pysimStatusCmd() { const statusEl = document.getElementById('pysim-status'); - statusEl.innerHTML = 'Checking...'; + statusEl.innerHTML = '' + t('Checking...') + ''; pysimSetConnected('spin'); const result = await pysimRunCmd('status'); if (result) await pysimRefresh(); @@ -2660,7 +2660,7 @@ async function pysimStatusCmd() { async function pysimResetCmd() { const statusEl = document.getElementById('pysim-status'); - statusEl.innerHTML = 'Resetting...'; + statusEl.innerHTML = '' + t('Resetting...') + ''; pysimSetConnected('spin'); const result = await pysimRunCmd('reset'); if (result) { @@ -2671,7 +2671,7 @@ async function pysimResetCmd() { async function pysimEquipCmd() { const statusEl = document.getElementById('pysim-status'); - statusEl.innerHTML = 'Equipping...'; + statusEl.innerHTML = '' + t('Equipping...') + ''; pysimSetConnected('spin'); const result = await pysimRunCmd('equip'); if (result) { @@ -2732,7 +2732,7 @@ async function pysimVerifySp() { const resultEl = document.getElementById('sp-verify-result'); if (!sp) { alert('No secured packet to verify. Generate a secure packet first.'); return; } resultEl.classList.remove('hidden'); - resultEl.textContent = 'Verifying against pySim reference...'; + resultEl.textContent = t('Verifying against pySim reference...'); try { const data = await pysimFetch('/api/sp-verify', { sp, ...spParams() }); if (data.match) { @@ -2763,7 +2763,7 @@ async function pysimSendOta() { const sp = document.getElementById('sp-result').value.replace(/[^0-9a-fA-F]/g, '').toUpperCase(); if (!sp) { alert('No secured packet to send. Generate a secure packet first.'); return; } const statusEl = document.getElementById('pysim-status'); - statusEl.innerHTML = 'Sending OTA...'; + statusEl.innerHTML = '' + t('Sending OTA...') + ''; try { const data = await pysimFetch('/api/send-ota', { sp, ...spParams() }); if (data.success) { @@ -3731,6 +3731,37 @@ const LANG_RU = { 'and start it.': 'и запустите его.', 'Refer to pysim-otaman-server README files for details.': 'Подробности — в README файлах pysim-otaman-server.', 'once pysim-otaman-server is ready.': 'Нажмите кнопку Подключиться когда pysim-otaman-server будет готов.', + 'Equip card': 'Подключить карту', + 'Check status': 'Проверить статус', + 'Reset card': 'Сброс карты', + 'Disconnect from pySim': 'Отключиться от pySim', + 'File manager': 'Файловый менеджер', + 'Custom files': 'Пользовательские файлы', + 'pySim command line': 'Командная строка pySim', + 'Raw APDU': 'Отправка APDU', + 'Read': 'Прочитать', + 'Save': 'Сохранить', + 'Raw': 'Данные как на карте', + 'Decoded': 'Декодированные данные', + 'Edit': 'Редактировать', + 'Execute': 'Выполнить', + 'Send': 'Отправить', + 'Add known file paths and aliases to the file tree.': 'Добавьте пути и псевдонимы файлов в дерево файлов.', + 'File:': 'Файл:', + 'Cancel': 'Отмена', + 'Timeout': 'Таймаут', + 'OK': 'OK', + 'Exit': 'Выход', + 'Connecting...': 'Подключение...', + 'Checking card...': 'Проверка карты...', + 'Connected': 'Подключено', + 'Connection failed:': 'Ошибка подключения:', + 'No card detected. Insert card and click Equip card button': 'Карта не обнаружена. Вставьте карту и нажмите Подключить карту', + 'Checking...': 'Проверка...', + 'Resetting...': 'Сброс...', + 'Equipping...': 'Подключение...', + 'Sending OTA...': 'Отправка OTA...', + 'Verifying against pySim reference...': 'Сверка с эталоном pySim...', }; let currentLang = 'en';