Add some error messages about wrong parameters
This commit is contained in:
parent
698c9e4e70
commit
63876a3215
@ -638,12 +638,32 @@ Check for updates to silence this warning</source>
|
||||
Проверьте обновления, чтобы отключить это сообщение</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/manager.cpp" line="189"/>
|
||||
<location filename="../../src/manager.cpp" line="127"/>
|
||||
<source>No recognition languages available. Install some via Settings->Updates</source>
|
||||
<translation>Нет доступных языков распознавания. Установите нужные через Настройки->Обновление</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/manager.cpp" line="132"/>
|
||||
<source>Recognition language not set. Go to Settings->Recognition and set it</source>
|
||||
<translation>Язык распознавания не задан. Задайте его в Настройки->Распознавание</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/manager.cpp" line="136"/>
|
||||
<source>No translators enabled. Go to Settings->Translation and select some</source>
|
||||
<translation>Не выбран ни один переводчик. Активируйте хотя бы один в Настройки->Перевод</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/manager.cpp" line="141"/>
|
||||
<source>Translation language not set. Go to Settings->Translation and set it</source>
|
||||
<translation>Язык перевода не задан. Задайте его в Настройки->Перевод</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/manager.cpp" line="209"/>
|
||||
<source>Failed to set log file: %1</source>
|
||||
<translation>Ошибка установки лог-файла: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/manager.cpp" line="195"/>
|
||||
<location filename="../../src/manager.cpp" line="215"/>
|
||||
<source>Started logging to file: %1</source>
|
||||
<translation>Начата запись в лог-файл: %1</translation>
|
||||
</message>
|
||||
@ -1149,12 +1169,7 @@ Then set default recognition and translation languages, enable some (or all) tra
|
||||
<translation>Адрес:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/translate/translator.cpp" line="132"/>
|
||||
<source>No translators selected. Check settings</source>
|
||||
<translation>Нет выбранных переводчиков. Проверьте настройки</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/translate/translator.cpp" line="140"/>
|
||||
<location filename="../../src/translate/translator.cpp" line="138"/>
|
||||
<source>No translators loaded from
|
||||
%1
|
||||
(%2)</source>
|
||||
@ -1163,7 +1178,7 @@ Then set default recognition and translation languages, enable some (or all) tra
|
||||
(%2)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../src/translate/translator.cpp" line="272"/>
|
||||
<location filename="../../src/translate/translator.cpp" line="270"/>
|
||||
<source>All translators failed
|
||||
%1</source>
|
||||
<translation>Не удалось перевести текст
|
||||
|
@ -121,6 +121,26 @@ void Manager::updateSettings()
|
||||
representer_->updateSettings();
|
||||
|
||||
tray_->setCaptureLockedEnabled(capturer_->canCaptureLocked());
|
||||
|
||||
if (models_->sourceLanguageModel()->rowCount() == 0) {
|
||||
fatalError(
|
||||
QObject::tr("No recognition languages available. Install some via "
|
||||
"Settings->Updates"));
|
||||
}
|
||||
if (settings_->sourceLanguage.isEmpty()) {
|
||||
fatalError(
|
||||
QObject::tr("Recognition language not set. Go to Settings->Recognition "
|
||||
"and set it"));
|
||||
}
|
||||
if (settings_->doTranslation && settings_->translators.isEmpty()) {
|
||||
fatalError(QObject::tr(
|
||||
"No translators enabled. Go to Settings->Translation and select some"));
|
||||
}
|
||||
if (settings_->doTranslation && settings_->targetLanguage.isEmpty()) {
|
||||
fatalError(
|
||||
QObject::tr("Translation language not set. Go to Settings->Translation "
|
||||
"and set it"));
|
||||
}
|
||||
}
|
||||
|
||||
void Manager::setupProxy(const Settings &settings)
|
||||
|
@ -128,10 +128,8 @@ void Translator::updateSettings()
|
||||
}
|
||||
tabs_->blockSignals(false);
|
||||
|
||||
if (settings_.translators.empty()) {
|
||||
manager_.fatalError(tr("No translators selected. Check settings"));
|
||||
if (settings_.translators.empty())
|
||||
return;
|
||||
}
|
||||
|
||||
const auto loaded =
|
||||
loadScripts(settings_.translatorsDir, settings_.translators);
|
||||
|
Loading…
Reference in New Issue
Block a user