Add English and Russian ChatGUI interface translations

This commit is contained in:
evgeny committed 2026-10-05 16:55:43 +02:00
1 parent 972c6b7f0a
commit 27d93ecaf9
50 files changed
+4978 -491

No files matched your search

+12 -10
View File
@@ -1,3 +1,4 @@
#include <QCoreApplication>
#include "invitedialog.h"
#include "qrcode_utils.h"
#include "../db/db_manager.h"
@@ -26,17 +27,18 @@ ShareInviteDialog::ShareInviteDialog(const QString& channelId, DbManager* db, QW
, m_channelId(channelId)
, m_db(db)
{
setWindowTitle(QString::fromUtf8("Пригласительная ссылка"));
setWindowTitle(QCoreApplication::translate("ChatGui", "Invite link"));
setMinimumSize(420, 560);
setModal(true);
auto *layout = new QVBoxLayout(this);
layout->setSpacing(12);
auto* expiry = new QLabel(QStringLiteral("Ссылка действует %1 минут с момента создания.").arg(JOIN_KEY_TTL_SECONDS / 60), this);
auto* expiry = new QLabel(QCoreApplication::translate("ChatGui",
"The link expires %1 minutes after creation.").arg(JOIN_KEY_TTL_SECONDS / 60), this);
expiry->setWordWrap(true);
layout->addWidget(expiry);
auto *nodeLabel = new QLabel(QString::fromUtf8("Узел входа:"), this);
auto *nodeLabel = new QLabel(QCoreApplication::translate("ChatGui", "Entry node:"), this);
nodeLabel->setStyleSheet("font-size: 12px; color: palette(window-text);");
m_nodeCombo = new QComboBox(this);
@@ -52,10 +54,10 @@ ShareInviteDialog::ShareInviteDialog(const QString& channelId, DbManager* db, QW
m_linkEdit = new QLineEdit(this);
m_linkEdit->setReadOnly(true);
m_linkEdit->setPlaceholderText(QString::fromUtf8("Генерация ссылки..."));
m_linkEdit->setPlaceholderText(QCoreApplication::translate("ChatGui", "Generating link..."));
m_linkEdit->setStyleSheet("padding: 6px; font-family: monospace;");
auto *copyBtn = new QPushButton(QString::fromUtf8("Копировать"), this);
auto *copyBtn = new QPushButton(QCoreApplication::translate("ChatGui", "Copy"), this);
connect(copyBtn, &QPushButton::clicked, this, [this]() {
QClipboard* cb = QApplication::clipboard();
cb->setText(m_linkEdit->text(), QClipboard::Clipboard);
@@ -125,7 +127,7 @@ void ShareInviteDialog::requestLink(uint64_t targetNodeId) {
req->request_id = m_requestId = ++nextRequestId;
req->target_node_id = targetNodeId;
m_linkEdit->setText(QString());
m_linkEdit->setPlaceholderText(QString::fromUtf8("Генерация ссылки..."));
m_linkEdit->setPlaceholderText(QCoreApplication::translate("ChatGui", "Generating link..."));
m_qrLabel->clear();
gui_bridge_post_uasync_fn(chat_invite_build_link_trampoline, req);
}
@@ -151,7 +153,7 @@ void ShareInviteDialog::onCandidates(const char* chId, int chIdLen, const uint8_
if (autoId == 0) {
m_linkEdit->setText(QString());
m_linkEdit->setPlaceholderText(QString::fromUtf8("Не удалось определить узел (см. лог)"));
m_linkEdit->setPlaceholderText(QCoreApplication::translate("ChatGui", "Failed to identify the node (see log)"));
return;
}
@@ -167,7 +169,7 @@ void ShareInviteDialog::onCandidates(const char* chId, int chIdLen, const uint8_
m_nodeCombo->clear();
/* пункт 0 — узел, найденный авто-выбором */
m_nodeCombo->addItem(nodeLabel(autoId) + QString::fromUtf8(" (auto)"),
m_nodeCombo->addItem(nodeLabel(autoId) + QCoreApplication::translate("ChatGui", " (auto)"),
QVariant::fromValue((qulonglong)autoId));
/* остальные узлы (пропуская авто), свой помечаем (self) */
@@ -179,7 +181,7 @@ void ShareInviteDialog::onCandidates(const char* chId, int chIdLen, const uint8_
if (nid == autoId) continue;
QString label = nodeLabel(nid);
if (m_db && nid == m_db->myNodeId())
label += QString::fromUtf8(" (self)");
label += QCoreApplication::translate("ChatGui", " (self)");
m_nodeCombo->addItem(label, QVariant::fromValue((qulonglong)nid));
}
@@ -193,7 +195,7 @@ void ShareInviteDialog::onLinkReady(const char* chId, int chIdLen, uint64_t requ
if (cid != m_channelId) return;
if (!link || link[0] == '\0') {
m_linkEdit->setText(QString());
m_linkEdit->setPlaceholderText(QString::fromUtf8("Не удалось собрать ссылку (см. лог)"));
m_linkEdit->setPlaceholderText(QCoreApplication::translate("ChatGui", "Failed to build the link (see log)"));
m_qrLabel->clear();
return;
}