#include "GammaSmith.h"

#include <QApplication>
#include <QLocale>
#include <QTranslator>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

QTranslator translator ;
bool english = false ;
int i = 0 ;

   for (i=1; i<argc; i++)
   if ((argv[i][0] == '-') && ((argv[i][1] == 'e') || (argv[i][1] == 'E'))) english = true ;
   if (english)
   { /* english language selected */
      const QStringList uiLanguages = QLocale::system().uiLanguages();
      for (const QString &locale : uiLanguages) {
         const QString baseName = "GammaSmith_" + QLocale(locale).name();
         if (translator.load(":/i18n/" + baseName)) {
            a.installTranslator(&translator);
            break;
         }
      }
   }

    MainWindow w;
    w.show();
    return a.exec();
}
