diff --git a/main.cpp b/main.cpp
index 3549a9b..69ab8b6 100644
--- a/main.cpp
+++ b/main.cpp
@@ -33,9 +33,32 @@ static QWidget *loadUI(QWidget *parent, std::string filename) {
}
int main(int argc, char *argv[]) {
- QUiLoader loader;
+
QApplication app(argc, argv);
+ std::string settings_file_path =
+ get_path_relative_to_home(".local/share/checks_parser/settings.json");
+
+ Settings s(settings_file_path);
+
+ QTranslator translator;
+ QString lang = "en_US";
+
+ if (s.get_all_settings().contains("language")) {
+ lang = QString::fromStdString(s.get_all_settings()["language"]);
+ } else if (translator.load(":/translation/"+QLocale::system().name()+".qm")) {
+ lang = QLocale::system().name();
+ } else {
+ lang = QString::fromStdString("en_US");
+ }
+
+ std::cout << "Using locale: " << lang.toStdString() << std::endl;
+
+ translator.load(":/translation/" + lang + ".qm");
+ app.installTranslator(&translator);
+
+ QUiLoader loader;
+
QWidget *window = new QWidget();
QStackedLayout *sceneLayout = new QStackedLayout;
@@ -69,7 +92,7 @@ int main(int argc, char *argv[]) {
OCRScene *ocrscene = new OCRScene();
OFDScene *ofdscene = new OFDScene();
- ofdscene->startHttpServer();
+ // ofdscene->startHttpServer();
// get_local_ip_address();
@@ -90,6 +113,8 @@ int main(int argc, char *argv[]) {
});
}
+
+
window->setLayout(sceneLayout);
window->show();
@@ -139,10 +164,10 @@ int main(int argc, char *argv[]) {
std::string program_data_path = get_path_relative_to_home(".local/share/checks_parser");
create_directories(program_data_path);
- std::string settings_file_path =
- get_path_relative_to_home(".local/share/checks_parser/settings.json");
+ // std::string settings_file_path =
+ // get_path_relative_to_home(".local/share/checks_parser/settings.json");
- Settings s(settings_file_path);
+ // Settings s(settings_file_path);
Net n;
Parser p;
@@ -161,22 +186,22 @@ int main(int argc, char *argv[]) {
QApplication a(argc, argv);
- QTranslator translator;
- QString lang = "en_US";
+ // QTranslator translator;
+ // QString lang = "en_US";
- if (s.get_all_settings().contains("language")) {
- lang = QString::fromStdString(s.get_all_settings()["language"]);
- } else if (translator.load(":/translation/"+QLocale::system().name()+".qm")) {
- lang = QLocale::system().name();
- } else {
- lang = QString::fromStdString("en_US");
- }
+ // if (s.get_all_settings().contains("language")) {
+ // lang = QString::fromStdString(s.get_all_settings()["language"]);
+ // } else if (translator.load(":/translation/"+QLocale::system().name()+".qm")) {
+ // lang = QLocale::system().name();
+ // } else {
+ // lang = QString::fromStdString("en_US");
+ // }
- std::cout << "Using locale: " << lang.toStdString() << std::endl;
+ // std::cout << "Using locale: " << lang.toStdString() << std::endl;
- translator.load(":/translation/" + lang + ".qm");
+ // translator.load(":/translation/" + lang + ".qm");
- a.installTranslator(&translator);
+ // a.installTranslator(&translator);
MainWindow w;
w.update();
w.show();
diff --git a/translations/en_US.ts b/translations/en_US.ts
index bd82b03..49b8dfd 100644
--- a/translations/en_US.ts
+++ b/translations/en_US.ts
@@ -29,7 +29,7 @@
Form
-
+ FormStore type
@@ -38,32 +38,32 @@
Check content
- Check content
+ Check contentParse
- Parse
+ ParseStore:
-
+ Store:Back
-
+ BackAn error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer.
- An error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer.
+ An error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer.Error in parsing
- Error in parsing
+ Error in parsing
@@ -208,17 +208,17 @@
Form
-
+ FormOptical Character Recognition
-
+ Optical Character RecognitionText from E-Mail
-
+ Text from E-Mail
@@ -226,62 +226,62 @@
Form
-
+ FormChoose
- Choose
+ ChoosePath to image:
-
+ Path to image:Store:
-
+ Store:Recognized text will be shown below as soon as image will be processed. Please, edit it
-
+ Recognized text will be shown below as soon as image will be processed. Please, edit itBack
-
+ BackParse
- Parse
+ ParseAn error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer.
- An error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer.
+ An error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer.Error in parsing
- Error in parsing
+ Error in parsingPlease, select a picture to scan
- Please, select a picture to scan
+ Please, select a picture to scanPicture was not selected
- Picture was not selected
+ Picture was not selectedPath to image:
- Path to image:
+ Path to image:
@@ -289,127 +289,127 @@
Form
-
+ FormTotal
- Total
+ TotalBack
-
+ Backor
-
+ orFD (Fiscal Document)
- FD (Fiscal Document)
+ FD (Fiscal Document)Date and time of purchase
-
+ Date and time of purchaseFunds income
- Funds income
+ Funds incomeFunds return
- Funds return
+ Funds returnFunds spend
- Funds spend
+ Funds spendSpends return
- Spends return
+ Spends returnUse your phone as a QR code scanner
-
+ Use your phone as a QR code scannerFN (Fiscal Number)
- FN (Fiscal Number)
+ FN (Fiscal Number)FI (Fiscal Identifier)
- FI (Fiscal Identifier)
+ FI (Fiscal Identifier)Choose image on your PC
-
+ Choose image on your PCOperation type
-
+ Operation typeParse
- Parse
+ Parse
-
+ Please, select a picture where QR code that contains info about check is present
- Please, select a picture where QR code that contains info about check is present
+ Please, select a picture where QR code that contains info about check is present
-
+ Picture was not selected
- Picture was not selected
+ Picture was not selected
-
+ Selected image:
-
+ Selected image:
-
+ Captcha was not solved correctly!
- Captcha was not solved correctly!
+ Captcha was not solved correctly!
-
+ Captcha is incorrect
- Captcha is incorrect
+ Captcha is incorrect
-
+ Internal server error. Please, try again later.
- Internal server error. Please, try again later.
+ Internal server error. Please, try again later.
-
+ Internal server error
- Internal server error
+ Internal server error
-
+ Check not found. Please, ensure correctness of entered data.
- Check not found. Please, ensure correctness of entered data.
+ Check not found. Please, ensure correctness of entered data.
-
+ Check was not found
-
+ Check was not found
diff --git a/translations/ru_RU.ts b/translations/ru_RU.ts
index e12d8d7..de475ae 100644
--- a/translations/ru_RU.ts
+++ b/translations/ru_RU.ts
@@ -29,7 +29,7 @@
Form
-
+ ФормаStore type
@@ -38,32 +38,32 @@
Check content
- Контент чека
+ Контент чекаParse
- Парсить
+ ПарситьStore:
-
+ Магазин:Back
-
+ НазадAn error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer.
- Произошла ошибка. Чек был прочитан неверно. Размеры векторов различаются. Пожалуйста, сообщите об этом разработчику.
+ Произошла ошибка. Чек был прочитан неверно. Размеры векторов различаются. Пожалуйста, сообщите об этом разработчику.Error in parsing
- Ошибка в парсинге
+ Ошибка в парсинге
@@ -208,17 +208,17 @@
Form
-
+ ФормаOptical Character Recognition
-
+ Оптическое распознавание символовText from E-Mail
-
+ Текст из электронного письма
@@ -226,62 +226,62 @@
Form
-
+ ФормаChoose
- Выбрать
+ ВыбратьPath to image:
-
+ Путь к изображению:Store:
-
+ Магазин:Recognized text will be shown below as soon as image will be processed. Please, edit it
-
+ Распознанный текст будет показан ниже как только изображение обработается. Пожалуйста, отредактируйтеBack
-
+ НазадParse
- Парсить
+ ПарситьAn error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer.
- Произошла ошибка. Чек был прочитан неверно. Размеры векторов различаются. Пожалуйста, сообщите об этом разработчику.
+ Произошла ошибка. Чек был прочитан неверно. Размеры векторов различаются. Пожалуйста, сообщите об этом разработчику.Error in parsing
- Ошибка в парсинге
+ Ошибка в парсингеPlease, select a picture to scan
- Пожалуйста, выберете изображение для сканирования
+ Пожалуйста, выберете изображение для сканированияPicture was not selected
- Изображение не было выбрано
+ Изображение не было выбраноPath to image:
- Путь к изображению:
+ Путь к изображению:
@@ -289,127 +289,127 @@
Form
-
+ ФормаTotal
- Итого
+ ИтогоBack
-
+ Назадor
-
+ илиFD (Fiscal Document)
- ФД
+ ФДDate and time of purchase
-
+ Дата и время покупкиFunds income
- Приход средств
+ Приход средствFunds return
- Возврат средств
+ Возврат средствFunds spend
- Расход средств
+ Расход средствSpends return
- Возврат расхода
+ Возврат расходаUse your phone as a QR code scanner
-
+ Использовать телефон как сканнер QRFN (Fiscal Number)
- ФН
+ ФНFI (Fiscal Identifier)
- ФП
+ ФПChoose image on your PC
-
+ Выбрать изображение на компьютереOperation type
-
+ Тип операцииParse
- Парсить
+ Парсить
-
+ Please, select a picture where QR code that contains info about check is present
- Пожалуйста, выберете изображение, содержащее QR код с информацией о чеке
+ Пожалуйста, выберете изображение, содержащее QR код с информацией о чеке
-
+ Picture was not selected
- Изображение не было выбрано
+ Изображение не было выбрано
-
+ Selected image:
-
+ Выбранное изображение:
-
+ Captcha was not solved correctly!
- Капча была решена неверно!
+ Капча была решена неверно!
-
+ Captcha is incorrect
- Капча введена неверно
+ Капча введена неверно
-
+ Internal server error. Please, try again later.
- Внутренняя ошибка сервера. Пожалуйста, попробуйте снова позже.
+ Внутренняя ошибка сервера. Пожалуйста, попробуйте снова позже.
-
+ Internal server error
- Внутренняя ошибка сервера
+ Внутренняя ошибка сервера
-
+ Check not found. Please, ensure correctness of entered data.
- Чек не найден. Пожалуйста, убедитесь в правильности введённых данных.
+ Чек не найден. Пожалуйста, убедитесь в правильности введённых данных.
-
+ Check was not found
- Чек не найден
+ Чек не найден