tolerate old version of hlohmann::json

This commit is contained in:
leca 2025-03-21 21:50:08 +03:00
parent 89afe836be
commit 1fa69c3a69
3 changed files with 23 additions and 21 deletions

View File

@ -50,11 +50,13 @@ int main(int argc, char *argv[]) {
QTranslator translator; QTranslator translator;
QString lang = "en_US"; QString lang = "en_US";
#if NLOHMANN_JSON_VERSION_MAJOR < 3 && NLOHMANN_JSON_VERSION_MINOR < 6 && NLOHMANN_JSON_VERSION_PATCH bool languageSettingPresent = false;
//TODO: implement #if NLOHMANN_JSON_VERSION_MAJOR < 3 && NLOHMANN_JSON_VERSION_MINOR < 6 && NLOHMANN_JSON_VERSION_PATCH < 0
languageSettingPresent = s.get_all_settings().find("language") != s.get_all_settings().end();
#else #else
if (s.get_all_settings().contains("language")) { languageSettingPresent = s.get_all_settings().contains("language");
#endif #endif
if (languageSettingPresent) {
lang = QString::fromStdString(s.get_all_settings()["language"]); lang = QString::fromStdString(s.get_all_settings()["language"]);
} else if (translator.load(":/translation/"+QLocale::system().name()+".qm")) { } else if (translator.load(":/translation/"+QLocale::system().name()+".qm")) {
lang = QLocale::system().name(); lang = QLocale::system().name();

View File

@ -382,47 +382,47 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../ofdscene.cpp" line="129"/> <location filename="../ofdscene.cpp" line="128"/>
<source>Please, select a picture where QR code that contains info about check is present</source> <source>Please, select a picture where QR code that contains info about check is present</source>
<translation>Please, select a picture where QR code that contains info about check is present</translation> <translation>Please, select a picture where QR code that contains info about check is present</translation>
</message> </message>
<message> <message>
<location filename="../ofdscene.cpp" line="131"/> <location filename="../ofdscene.cpp" line="130"/>
<source>Picture was not selected</source> <source>Picture was not selected</source>
<translation>Picture was not selected</translation> <translation>Picture was not selected</translation>
</message> </message>
<message> <message>
<location filename="../ofdscene.cpp" line="136"/> <location filename="../ofdscene.cpp" line="135"/>
<source>Selected image: </source> <source>Selected image: </source>
<translation>Selected image: </translation> <translation>Selected image: </translation>
</message> </message>
<message> <message>
<location filename="../ofdscene.cpp" line="196"/> <location filename="../ofdscene.cpp" line="195"/>
<source>Captcha was not solved correctly!</source> <source>Captcha was not solved correctly!</source>
<translation>Captcha was not solved correctly!</translation> <translation>Captcha was not solved correctly!</translation>
</message> </message>
<message> <message>
<location filename="../ofdscene.cpp" line="198"/> <location filename="../ofdscene.cpp" line="197"/>
<source>Captcha is incorrect</source> <source>Captcha is incorrect</source>
<translation>Captcha is incorrect</translation> <translation>Captcha is incorrect</translation>
</message> </message>
<message> <message>
<location filename="../ofdscene.cpp" line="203"/> <location filename="../ofdscene.cpp" line="202"/>
<source>Internal server error. Please, try again later.</source> <source>Internal server error. Please, try again later.</source>
<translation>Internal server error. Please, try again later.</translation> <translation>Internal server error. Please, try again later.</translation>
</message> </message>
<message> <message>
<location filename="../ofdscene.cpp" line="205"/> <location filename="../ofdscene.cpp" line="204"/>
<source>Internal server error</source> <source>Internal server error</source>
<translation>Internal server error</translation> <translation>Internal server error</translation>
</message> </message>
<message> <message>
<location filename="../ofdscene.cpp" line="210"/> <location filename="../ofdscene.cpp" line="209"/>
<source>Check not found. Please, ensure correctness of entered data.</source> <source>Check not found. Please, ensure correctness of entered data.</source>
<translation>Check not found. Please, ensure correctness of entered data.</translation> <translation>Check not found. Please, ensure correctness of entered data.</translation>
</message> </message>
<message> <message>
<location filename="../ofdscene.cpp" line="212"/> <location filename="../ofdscene.cpp" line="211"/>
<source>Check was not found</source> <source>Check was not found</source>
<translation>Check was not found</translation> <translation>Check was not found</translation>
</message> </message>

View File

@ -382,47 +382,47 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../ofdscene.cpp" line="129"/> <location filename="../ofdscene.cpp" line="128"/>
<source>Please, select a picture where QR code that contains info about check is present</source> <source>Please, select a picture where QR code that contains info about check is present</source>
<translation>Пожалуйста, выберете изображение, содержащее QR код с информацией о чеке</translation> <translation>Пожалуйста, выберете изображение, содержащее QR код с информацией о чеке</translation>
</message> </message>
<message> <message>
<location filename="../ofdscene.cpp" line="131"/> <location filename="../ofdscene.cpp" line="130"/>
<source>Picture was not selected</source> <source>Picture was not selected</source>
<translation>Изображение не было выбрано</translation> <translation>Изображение не было выбрано</translation>
</message> </message>
<message> <message>
<location filename="../ofdscene.cpp" line="136"/> <location filename="../ofdscene.cpp" line="135"/>
<source>Selected image: </source> <source>Selected image: </source>
<translation>Выбранное изображение: </translation> <translation>Выбранное изображение: </translation>
</message> </message>
<message> <message>
<location filename="../ofdscene.cpp" line="196"/> <location filename="../ofdscene.cpp" line="195"/>
<source>Captcha was not solved correctly!</source> <source>Captcha was not solved correctly!</source>
<translation>Капча была решена неверно!</translation> <translation>Капча была решена неверно!</translation>
</message> </message>
<message> <message>
<location filename="../ofdscene.cpp" line="198"/> <location filename="../ofdscene.cpp" line="197"/>
<source>Captcha is incorrect</source> <source>Captcha is incorrect</source>
<translation>Капча введена неверно</translation> <translation>Капча введена неверно</translation>
</message> </message>
<message> <message>
<location filename="../ofdscene.cpp" line="203"/> <location filename="../ofdscene.cpp" line="202"/>
<source>Internal server error. Please, try again later.</source> <source>Internal server error. Please, try again later.</source>
<translation>Внутренняя ошибка сервера. Пожалуйста, попробуйте снова позже.</translation> <translation>Внутренняя ошибка сервера. Пожалуйста, попробуйте снова позже.</translation>
</message> </message>
<message> <message>
<location filename="../ofdscene.cpp" line="205"/> <location filename="../ofdscene.cpp" line="204"/>
<source>Internal server error</source> <source>Internal server error</source>
<translation>Внутренняя ошибка сервера</translation> <translation>Внутренняя ошибка сервера</translation>
</message> </message>
<message> <message>
<location filename="../ofdscene.cpp" line="210"/> <location filename="../ofdscene.cpp" line="209"/>
<source>Check not found. Please, ensure correctness of entered data.</source> <source>Check not found. Please, ensure correctness of entered data.</source>
<translation>Чек не найден. Пожалуйста, убедитесь в правильности введённых данных.</translation> <translation>Чек не найден. Пожалуйста, убедитесь в правильности введённых данных.</translation>
</message> </message>
<message> <message>
<location filename="../ofdscene.cpp" line="212"/> <location filename="../ofdscene.cpp" line="211"/>
<source>Check was not found</source> <source>Check was not found</source>
<translation>Чек не найден</translation> <translation>Чек не найден</translation>
</message> </message>