Локализовать интерфейс SHiNE на русский и английский

This commit is contained in:
AidarKC
2026-11-09 16:45:21 +03:00
parent 526941eb33
commit 405b9a91a7
133 changed files with 12464 additions and 3296 deletions
+11 -10
View File
@@ -1,4 +1,5 @@
import { getShowPublicHistoryWarning, setShowPublicHistoryWarning, PUBLIC_HISTORY_REMEMBER_LABEL } from '../services/public-history-consent.js';
import { t } from '../i18n/index.js';
import { getShowPublicHistoryWarning, setShowPublicHistoryWarning, getPublicHistoryRememberLabel } from '../services/public-history-consent.js';
import { openSheet } from './sheet.js';
function safeCount(raw, maximum = Infinity) {
@@ -26,13 +27,13 @@ function openLikeSheet({ liked = false, counts = {}, onViewList = null, readOnly
const body = document.createElement('div');
body.className = 'stack like-consent';
const intro = document.createElement('p');
intro.textContent = 'Лайки этого сообщения (по данным сервера):';
intro.textContent = t('dialogs.modals.like_action_sheet.label_001');
const grid = document.createElement('div');
grid.className = 'like-consent-counters';
const categories = [
{ label: 'Официальные сияющие', count: shining, type: 'shining' },
{ label: 'Все официальные', count: official, type: 'official' },
{ label: 'Все аккаунты', count: all, type: 'all' },
{ label: t('dialogs.remaining.components.like_action_sheet.openlikesheet.ofitsialnye_siyayuschie'), count: shining, type: 'shining' },
{ label: t('dialogs.remaining.components.like_action_sheet.openlikesheet.vse_ofitsialnye'), count: official, type: 'official' },
{ label: t('dialogs.remaining.components.like_action_sheet.openlikesheet.vse_akkaunty'), count: all, type: 'all' },
];
categories.forEach(({ label, count, type }) => {
const item = document.createElement(onViewList ? 'button' : 'div');
@@ -53,30 +54,30 @@ function openLikeSheet({ liked = false, counts = {}, onViewList = null, readOnly
});
const warning = document.createElement('p');
warning.className = 'meta-muted';
warning.textContent = 'Добавление и отмена лайка создают записи в публичной истории блокчейна. Даже отменённый лайк может остаться в истории.';
warning.textContent = t('dialogs.modals.like_action_sheet.label_002');
const rememberLabel = document.createElement('label');
rememberLabel.className = 'confirm-dialog__remember';
const remember = document.createElement('input');
remember.type = 'checkbox';
const rememberText = document.createElement('span');
rememberText.textContent = PUBLIC_HISTORY_REMEMBER_LABEL;
rememberText.textContent = getPublicHistoryRememberLabel();
rememberLabel.append(remember, rememberText);
const actions = document.createElement('div');
actions.className = 'form-actions-grid';
const cancel = document.createElement('button');
cancel.type = 'button';
cancel.className = 'secondary-btn';
cancel.textContent = readOnly ? 'Закрыть' : 'Не менять';
cancel.textContent = readOnly ? t('dialogs.modals.like_action_sheet.label_003') : t('dialogs.remaining.components.like_action_sheet.openlikesheet.ne_menyat');
const confirm = document.createElement('button');
confirm.type = 'button';
confirm.className = 'primary-btn';
confirm.textContent = liked ? 'Убрать мой лайк' : 'Добавить мой лайк';
confirm.textContent = liked ? t('dialogs.modals.like_action_sheet.label_004') : t('dialogs.remaining.components.like_action_sheet.openlikesheet.dobavit_moy_layk');
if (readOnly) actions.append(cancel);
else actions.append(cancel, confirm);
body.append(intro, grid);
if (!readOnly) body.append(warning, rememberLabel);
body.append(actions);
const sheet = openSheet({ title: 'Лайки', className: 'like-consent-sheet', content: body, onClose: () => resolve(accepted) });
const sheet = openSheet({ title: t('dialogs.modals.like_action_sheet.label_005'), className: 'like-consent-sheet', content: body, onClose: () => resolve(accepted) });
cancel.addEventListener('click', () => sheet.close());
confirm.addEventListener('click', () => { if (remember.checked) setShowPublicHistoryWarning(false); accepted = true; sheet.close(); });
});