#include <QCoreApplication>
#include <QLocale>
#include <QTranslator>
#include "DataManager.h"
#include <QCommandLineParser>
#include <QCommandLineOption>
#include "Config.h"
int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    QTranslator translator;
    const QStringList uiLanguages = QLocale::system().uiLanguages();
    for (const QString &locale : uiLanguages) {
        const QString baseName = "DataManager_" + QLocale(locale).name();
        if (translator.load(":/i18n/" + baseName)) {
            a.installTranslator(&translator);
            break;
        }
    }
    QCommandLineOption op1("config","config file path", "config/config.json");
    QCommandLineParser parser;
    parser.addOption(op1);
    parser.addHelpOption();

    parser.process(a);
    Config config(parser.value("config"));

    DataManager dataMgr;
    dataMgr.Startup(config);

    return a.exec();
}
