From 3d88f2b9ec8531ac807653a197df8ef9f2ae4aaf Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Wed, 12 Feb 2020 00:06:01 -0700 Subject: [PATCH] add language reselect message --- extensions/translatewrapper.cpp | 2 ++ text.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/extensions/translatewrapper.cpp b/extensions/translatewrapper.cpp index 05fc8ff..5a2e174 100644 --- a/extensions/translatewrapper.cpp +++ b/extensions/translatewrapper.cpp @@ -7,6 +7,7 @@ extern const char* SELECT_LANGUAGE; extern const char* SELECT_LANGUAGE_MESSAGE; +extern const char* LANGUAGE_SAVED; extern const wchar_t* TOO_MANY_TRANS_REQUESTS; extern const char* TRANSLATION_PROVIDER; @@ -52,6 +53,7 @@ BOOL WINAPI DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ); translateTo->assign(S(language.split(": ")[1])); settings.setValue(LANGUAGE, S(translateTo->c_str())); + QMessageBox::information(nullptr, SELECT_LANGUAGE, QString(LANGUAGE_SAVED).arg(CONFIG_FILE)); }); QStringList savedCache = QString(QTextFile(CACHE_FILE, QIODevice::ReadOnly).readAll()).split("|T|\n", QString::SkipEmptyParts); diff --git a/text.cpp b/text.cpp index 4182128..e08b35f 100644 --- a/text.cpp +++ b/text.cpp @@ -116,6 +116,7 @@ const char* HIJACK_ERROR = u8"Textractor: Hijack ERROR"; const char* COULD_NOT_FIND = u8"Textractor: could not find text"; const char* SELECT_LANGUAGE = u8"Select language"; const char* SELECT_LANGUAGE_MESSAGE = u8"What language should %1 translate to?"; +const char* LANGUAGE_SAVED = u8"Translation language saved (you can delete it in the config file %1 then reopen Textractor to reselect)"; const wchar_t* TOO_MANY_TRANS_REQUESTS = L"Too many translation requests: refuse to make more"; const wchar_t* TRANSLATION_ERROR = L"Error while translating"; const char* EXTRA_WINDOW_INFO = u8R"(Right click to change settings