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 "ptt_portal.h"
|
||||
#include "../../lib/debug_config.h"
|
||||
|
||||
@@ -50,7 +51,7 @@ void PttPortal::setStatus(const QString& text) { m_status = text; emit statusCha
|
||||
void PttPortal::initialize() {
|
||||
if (busy() || m_state == State::Ready || m_state == State::Unbound) return;
|
||||
m_state = State::Checking;
|
||||
setStatus("Подключение глобальных хоткеев…");
|
||||
setStatus(QCoreApplication::translate("ChatGui", "Connecting global shortcuts…"));
|
||||
auto message = QDBusMessage::createMethodCall(kService, kPath, "org.freedesktop.DBus.Properties", "Get");
|
||||
message.setArguments({kInterface, "version"});
|
||||
auto* watcher = new QDBusPendingCallWatcher(QDBusConnection::sessionBus().asyncCall(message), this);
|
||||
@@ -108,7 +109,7 @@ void PttPortal::response(uint code, const QVariantMap& results, const QDBusMessa
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_RADIO, "PTT portal: response state=%d code=%u", int(state), code);
|
||||
if (code != 0) {
|
||||
fail(QString("request %1: response=%2%3").arg(int(state)).arg(code).arg(code == 1 ? " (cancelled)" : ""));
|
||||
if (code == 1) setStatus("Назначение отменено. Нажмите кнопку, чтобы повторить.");
|
||||
if (code == 1) setStatus(QCoreApplication::translate("ChatGui", "Assignment cancelled. Click the button to try again."));
|
||||
return;
|
||||
}
|
||||
if (state == State::Creating) {
|
||||
@@ -127,11 +128,11 @@ void PttPortal::response(uint code, const QVariantMap& results, const QDBusMessa
|
||||
m_configureAfterBind = known.size() == 3 && m_configureRequested;
|
||||
m_state = State::Unbound;
|
||||
if (!known.isEmpty() || m_configureRequested) bind();
|
||||
else setStatus("Назначьте сочетание в системных настройках.");
|
||||
else setStatus(QCoreApplication::translate("ChatGui", "Assign a shortcut in system settings."));
|
||||
} else if (state == State::Binding) {
|
||||
m_state = State::Ready;
|
||||
updateDescriptions(qdbus_cast<PttPortalShortcuts>(results.value("shortcuts")));
|
||||
setStatus("Глобальные хоткеи подключены.");
|
||||
setStatus(QCoreApplication::translate("ChatGui", "Global shortcuts connected."));
|
||||
DEBUG_INFO(DEBUG_CATEGORY_RADIO, "PTT portal: bindings ready session=%s", qPrintable(m_session));
|
||||
// Первое BindShortcuts само открывает окно назначения, повторное Configure — отдельный вызов.
|
||||
m_configureRequested = false;
|
||||
@@ -143,9 +144,10 @@ bool PttPortal::isPttId(const QString& id) { return id == "ptt1" || id == "ptt2"
|
||||
|
||||
void PttPortal::bind() {
|
||||
PttPortalShortcuts shortcuts;
|
||||
for (int i = 1; i <= 3; i++) shortcuts << PttPortalShortcut{QString("ptt%1").arg(i), {{"description", QString("Рация: передача %1").arg(i)}}};
|
||||
for (int i = 1; i <= 3; i++) shortcuts << PttPortalShortcut{QString("ptt%1").arg(i), {{"description", QCoreApplication::translate("ChatGui",
|
||||
"Radio: transmit %1").arg(i)}}};
|
||||
m_state = State::Binding;
|
||||
setStatus("Назначение глобальных хоткеев…");
|
||||
setStatus(QCoreApplication::translate("ChatGui", "Assigning global shortcuts…"));
|
||||
request("BindShortcuts", {QVariant::fromValue(QDBusObjectPath(m_session)), QVariant::fromValue(shortcuts), m_parentWindow}, {});
|
||||
}
|
||||
|
||||
@@ -230,6 +232,6 @@ void PttPortal::fail(const QString& detail) {
|
||||
m_configureRequested = m_configureAfterBind = false;
|
||||
m_state = State::Failed;
|
||||
m_descriptions = {"", "", ""}; emit descriptionsChanged();
|
||||
setStatus("Глобальные хоткеи недоступны. Повторите назначение; подробности в логе radio.");
|
||||
setStatus(QCoreApplication::translate("ChatGui", "Global shortcuts unavailable. Try assigning again; see the radio log for details."));
|
||||
}
|
||||
void PttPortal::sessionClosed() { fail("portal session closed"); }
|
||||
Reference in new issue
Block a user