Add English and Russian ChatGUI interface translations
This commit is contained in:
1 parent
972c6b7f0a
commit
27d93ecaf9
50 files changed
+4978
-491
No files matched your search
@@ -1,3 +1,4 @@
|
||||
#include <QCoreApplication>
|
||||
#include "mainwindow.h"
|
||||
#include "channellist.h"
|
||||
#include "messagelist.h"
|
||||
@@ -437,7 +438,7 @@ void MainWindow::setupBridgeCallbacks() {
|
||||
uint64_t from; memcpy(&from, data + 1 + chLen, 8);
|
||||
s_mainWindow->m_trayIcon->showMessage(
|
||||
"vibechat",
|
||||
QStringLiteral("You are now a channel co-owner.\nReceived admin key for channel %1 from 0x%2")
|
||||
QCoreApplication::translate("ChatGui", "You are now a channel co-owner.\nReceived admin key for channel %1 from 0x%2")
|
||||
.arg(chId).arg(QString::number(from, 16)),
|
||||
QSystemTrayIcon::Information, 5000);
|
||||
if (s_mainWindow->m_currentChannelId == chId)
|
||||
@@ -604,7 +605,7 @@ void MainWindow::onCallIncoming(const QString& chId, quint64 caller, quint64 cal
|
||||
|
||||
SoundManager::instance()->playLoop("call_incoming");
|
||||
if (!isVisible() || isMinimized()) {
|
||||
m_trayIcon->showMessage("vibechat", QStringLiteral("Incoming call from %1").arg(name),
|
||||
m_trayIcon->showMessage("vibechat", QCoreApplication::translate("ChatGui", "Incoming call from %1").arg(name),
|
||||
QSystemTrayIcon::Information, 5000);
|
||||
}
|
||||
|
||||
@@ -687,7 +688,9 @@ void MainWindow::onDmConvUpdated(const QString& convId) {
|
||||
void MainWindow::onInviteToPmRequested(const QString& source, quint64 peer, const QString& name) {
|
||||
if (!m_db || !m_db->isOpen() || !m_node || !m_node->isRunning()) {
|
||||
GUI_ERROR("invite PM: node unavailable");
|
||||
QMessageBox::warning(this, QStringLiteral("Приглашение"), QStringLiteral("Ядро не запущено.")); return;
|
||||
QMessageBox::warning(this, QCoreApplication::translate("ChatGui",
|
||||
"Invitation"), QCoreApplication::translate("ChatGui",
|
||||
"The core is not running.")); return;
|
||||
}
|
||||
if (!peer || peer == m_db->myNodeId()) { GUI_ERROR("invite PM: invalid recipient"); return; }
|
||||
DmInviteDialog dialog(m_db, peer, name, source, this);
|
||||
@@ -702,11 +705,15 @@ void MainWindow::onMessageLinkActivated(const QString& link) {
|
||||
const QUrl url(link, QUrl::StrictMode);
|
||||
if (!url.isValid() || url.host().isEmpty() || (url.scheme() != "http" && url.scheme() != "https")) {
|
||||
GUI_ERROR("message link: invalid web address bytes=%d", (int)link.size());
|
||||
QMessageBox::warning(this, tr("Ссылка"), tr("Некорректная ссылка.")); return;
|
||||
QMessageBox::warning(this, QCoreApplication::translate("ChatGui",
|
||||
"Link"), QCoreApplication::translate("ChatGui",
|
||||
"Invalid link.")); return;
|
||||
}
|
||||
if (!QDesktopServices::openUrl(url)) {
|
||||
GUI_ERROR("message link: external open failed scheme=%s host=%s", qPrintable(url.scheme()), qPrintable(url.host()));
|
||||
QMessageBox::warning(this, tr("Ссылка"), tr("Не удалось открыть ссылку. Проверьте наличие браузера.")); return;
|
||||
QMessageBox::warning(this, QCoreApplication::translate("ChatGui",
|
||||
"Link"), QCoreApplication::translate("ChatGui",
|
||||
"Failed to open the link. Check that a browser is installed.")); return;
|
||||
}
|
||||
GUI_INFO("message link: external open requested scheme=%s host=%s", qPrintable(url.scheme()), qPrintable(url.host()));
|
||||
return;
|
||||
@@ -714,11 +721,15 @@ void MainWindow::onMessageLinkActivated(const QString& link) {
|
||||
const auto invite = decodeInviteLink(link);
|
||||
if (!invite.error.isEmpty()) {
|
||||
GUI_ERROR("invite link: invalid error=%s", qPrintable(invite.error));
|
||||
QMessageBox::warning(this, QStringLiteral("Приглашение"), QStringLiteral("Некорректная ссылка: ") + invite.error); return;
|
||||
QMessageBox::warning(this, QCoreApplication::translate("ChatGui",
|
||||
"Invitation"), QCoreApplication::translate("ChatGui",
|
||||
"Invalid link: ") + invite.error); return;
|
||||
}
|
||||
if (!m_db || !m_db->isOpen() || !m_node || !m_node->isRunning()) {
|
||||
GUI_ERROR("invite link: node unavailable");
|
||||
QMessageBox::warning(this, QStringLiteral("Приглашение"), QStringLiteral("Ядро не запущено.")); return;
|
||||
QMessageBox::warning(this, QCoreApplication::translate("ChatGui",
|
||||
"Invitation"), QCoreApplication::translate("ChatGui",
|
||||
"The core is not running.")); return;
|
||||
}
|
||||
const QString channelId = QString::number(invite.channelId);
|
||||
for (const auto& channel : m_db->getChannels()) {
|
||||
@@ -751,19 +762,19 @@ void MainWindow::setupTray() {
|
||||
m_trayIcon->setToolTip("vibechat");
|
||||
|
||||
m_trayMenu = new QMenu(this);
|
||||
QAction *settingsAction = m_trayMenu->addAction("Settings");
|
||||
QAction *settingsAction = m_trayMenu->addAction(QCoreApplication::translate("ChatGui", "Settings"));
|
||||
connect(settingsAction, &QAction::triggered, this, &MainWindow::showSettings);
|
||||
|
||||
m_trayMenu->addSeparator();
|
||||
|
||||
QAction *showAction = m_trayMenu->addAction("Show");
|
||||
QAction *showAction = m_trayMenu->addAction(QCoreApplication::translate("ChatGui", "Show"));
|
||||
connect(showAction, &QAction::triggered, this, [this]() {
|
||||
show();
|
||||
raise();
|
||||
activateWindow();
|
||||
});
|
||||
|
||||
QAction *quitAction = m_trayMenu->addAction("Quit");
|
||||
QAction *quitAction = m_trayMenu->addAction(QCoreApplication::translate("ChatGui", "Quit"));
|
||||
connect(quitAction, &QAction::triggered, this, &MainWindow::requestShutdown);
|
||||
|
||||
m_trayIcon->setContextMenu(m_trayMenu);
|
||||
@@ -778,7 +789,7 @@ void MainWindow::closeEvent(QCloseEvent *event) {
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_GENERAL, "MainWindow: closeEvent — hiding to tray");
|
||||
saveWindowGeometry();
|
||||
hide();
|
||||
m_trayIcon->showMessage("vibechat", "Application minimized to tray.",
|
||||
m_trayIcon->showMessage("vibechat", QCoreApplication::translate("ChatGui", "Application minimized to tray."),
|
||||
QSystemTrayIcon::Information, 2000);
|
||||
event->ignore();
|
||||
}
|
||||
@@ -814,7 +825,7 @@ void MainWindow::showShareInviteDialog(const QString& channelId) {
|
||||
|
||||
void MainWindow::showInviteByLinkDialog(const QString& channelId) {
|
||||
if (!m_node || !m_node->isRunning()) {
|
||||
QMessageBox::warning(this, "Error", "Node is not running.");
|
||||
QMessageBox::warning(this, QCoreApplication::translate("ChatGui", "Error"), QCoreApplication::translate("ChatGui", "Node is not running."));
|
||||
return;
|
||||
}
|
||||
InviteByLinkDialog dlg(channelId, m_node, this);
|
||||
@@ -823,7 +834,7 @@ void MainWindow::showInviteByLinkDialog(const QString& channelId) {
|
||||
|
||||
void MainWindow::showJoinDialog() {
|
||||
if (!m_node || !m_node->isRunning()) {
|
||||
QMessageBox::warning(this, "Error", "Node is not running.");
|
||||
QMessageBox::warning(this, QCoreApplication::translate("ChatGui", "Error"), QCoreApplication::translate("ChatGui", "Node is not running."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -953,11 +964,13 @@ void MainWindow::reloadChannels() {
|
||||
|
||||
void MainWindow::onCreateGroupRequested() {
|
||||
if (!m_node || !m_node->isRunning()) {
|
||||
QMessageBox::warning(this, "Error", "Node is not running.");
|
||||
QMessageBox::warning(this, QCoreApplication::translate("ChatGui", "Error"), QCoreApplication::translate("ChatGui", "Node is not running."));
|
||||
return;
|
||||
}
|
||||
if (!gui_bridge_is_uasync_ready()) {
|
||||
QMessageBox::warning(this, "Error", "uTun thread is not ready yet. Please wait and try again.");
|
||||
QMessageBox::warning(this, QCoreApplication::translate("ChatGui",
|
||||
"Error"), QCoreApplication::translate("ChatGui",
|
||||
"uTun thread is not ready yet. Please wait and try again."));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user