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 "radio_audio_engine.h"
|
||||
#include "sound_manager.h"
|
||||
#include "../transport/audio_diagnostics.h"
|
||||
@@ -82,7 +83,7 @@ void RadioAudioEngine::loadSettings(const QString& configPath) {
|
||||
/* Проверяем значения и атомарно сохраняем INI до отправки команды в ядро. */
|
||||
bool RadioAudioEngine::applySettings(const QMap<QString, int>& values) {
|
||||
if (!m_settingsReady || m_settingsBusy || !gui_bridge_is_uasync_ready() || !gui_bridge_get_inst()) {
|
||||
m_settingsError = QStringLiteral("Настройки рации ещё не готовы");
|
||||
m_settingsError = QCoreApplication::translate("ChatGui", "Radio settings are not ready yet");
|
||||
DEBUG_WARN(DEBUG_CATEGORY_RADIO, "RadioAudio: cannot apply settings ready=%d busy=%d", m_settingsReady, m_settingsBusy);
|
||||
emit stateChanged();
|
||||
return false;
|
||||
@@ -92,7 +93,7 @@ bool RadioAudioEngine::applySettings(const QMap<QString, int>& values) {
|
||||
size_t index = 0;
|
||||
while (index < next.size() && it.key() != QLatin1String(settingKeys[index])) ++index;
|
||||
if (index == next.size() || it.value() < settingMin[index] || it.value() > settingMax[index]) {
|
||||
m_settingsError = QStringLiteral("Некорректная настройка рации: %1").arg(it.key());
|
||||
m_settingsError = QCoreApplication::translate("ChatGui", "Invalid radio setting: %1").arg(it.key());
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_RADIO, "RadioAudio: invalid setting %s=%d", qPrintable(it.key()), it.value());
|
||||
emit stateChanged();
|
||||
return false;
|
||||
@@ -103,7 +104,7 @@ bool RadioAudioEngine::applySettings(const QMap<QString, int>& values) {
|
||||
if (next != m_settings && !m_configPath.isEmpty()) {
|
||||
QFile input(m_configPath);
|
||||
if (!input.open(QIODevice::ReadOnly)) {
|
||||
m_settingsError = QStringLiteral("Не удалось прочитать конфигурацию: %1").arg(input.errorString());
|
||||
m_settingsError = QCoreApplication::translate("ChatGui", "Failed to read configuration: %1").arg(input.errorString());
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_RADIO, "RadioAudio: read config failed: %s", qPrintable(input.errorString()));
|
||||
emit stateChanged();
|
||||
return false;
|
||||
@@ -116,7 +117,7 @@ bool RadioAudioEngine::applySettings(const QMap<QString, int>& values) {
|
||||
if (!data.endsWith('\n')) data.append('\n');
|
||||
QSaveFile output(m_configPath);
|
||||
if (!output.open(QIODevice::WriteOnly) || output.write(data) != data.size() || !output.commit()) {
|
||||
m_settingsError = QStringLiteral("Не удалось сохранить конфигурацию: %1").arg(output.errorString());
|
||||
m_settingsError = QCoreApplication::translate("ChatGui", "Failed to save configuration: %1").arg(output.errorString());
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_RADIO, "RadioAudio: save config failed: %s", qPrintable(output.errorString()));
|
||||
emit stateChanged();
|
||||
return false;
|
||||
@@ -131,7 +132,7 @@ void RadioAudioEngine::postSettings(const std::array<int, 6>& values, bool apply
|
||||
auto* inst = gui_bridge_get_inst();
|
||||
void* memory = inst && gui_bridge_is_uasync_ready() ? u_malloc(sizeof(SettingsRequest)) : nullptr;
|
||||
if (!memory) {
|
||||
m_settingsError = QStringLiteral("Не удалось отправить настройки рации в ядро");
|
||||
m_settingsError = QCoreApplication::translate("ChatGui", "Failed to send radio settings to the core");
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_RADIO, "RadioAudio: settings request unavailable inst=%d uasync=%d",
|
||||
inst != nullptr, gui_bridge_is_uasync_ready());
|
||||
emit stateChanged();
|
||||
@@ -164,7 +165,7 @@ void RadioAudioEngine::postSettings(const std::array<int, 6>& values, bool apply
|
||||
engine->m_settings = snapshot;
|
||||
engine->m_settingsReady = true;
|
||||
engine->m_settingsBusy = false;
|
||||
if (!success) engine->m_settingsError = QStringLiteral("Ядро отклонило настройки рации");
|
||||
if (!success) engine->m_settingsError = QCoreApplication::translate("ChatGui", "The core rejected radio settings");
|
||||
DEBUG_INFO(DEBUG_CATEGORY_RADIO, "RadioAudio: settings applied=%d vad=%d threshold=%d hangover=%dms TX_AGC=%d "
|
||||
"TX_gain=%ddB VAD_gain=%ddB", success, snapshot[0], snapshot[1], snapshot[2], snapshot[3], snapshot[4], snapshot[5]);
|
||||
if ((changed || apply) && engine->m_active) engine->reconfigureCapture();
|
||||
|
||||
Reference in new issue
Block a user