Полностью поддерживает английский язык

This commit is contained in:
AidarKC
2026-11-10 14:02:34 +03:00
parent 405b9a91a7
commit 9c30b33b39
71 changed files with 2658 additions and 1445 deletions
@@ -1,3 +1,4 @@
import { t } from '../i18n/index.js';
const SNAPSHOT_STORAGE_KEY = 'shine-ui-blockchain-snapshot-v1';
function normalizeLogin(login) {
@@ -69,11 +70,11 @@ export async function buildBlockchainSnapshotFile({
const cleanLogin = normalizeLogin(login);
const cleanBlockchainName = String(blockchainName || '').trim();
const maxBlockNumber = Number(lastBlockNumber);
if (!authService?.ws?.request) throw new Error('Сервис сервера недоступен.');
if (!cleanLogin) throw new Error('Не указан логин.');
if (!cleanBlockchainName) throw new Error('Не указано имя блокчейна.');
if (!authService?.ws?.request) throw new Error(t('remaining.blockchain_snapshot.server_service_unavailable'));
if (!cleanLogin) throw new Error(t('remaining.blockchain_snapshot.login_missing'));
if (!cleanBlockchainName) throw new Error(t('remaining.blockchain_snapshot.blockchain_name_missing'));
if (!Number.isFinite(maxBlockNumber) || maxBlockNumber < 0) {
throw new Error('На сервере нет блоков для слепка.');
throw new Error(t('remaining.blockchain_snapshot.no_blocks_available_on_the_server_for_a_snapshot'));
}
const parts = [];
@@ -84,7 +85,7 @@ export async function buildBlockchainSnapshotFile({
blockNumber,
});
if (response?.status !== 200) {
const message = String(response?.payload?.message || response?.message || 'Не удалось получить блок.');
const message = String(response?.payload?.message || response?.message || t('remaining.blockchain_snapshot.could_not_retrieve_block'));
throw new Error(`Не удалось скачать блок ${blockNumber}: ${message}`);
}
const blockBytes = decodeBase64ToBytes(response?.payload?.blockBytesB64 || '');