Changeset 27 in tspsg-svn for trunk/src/main.cpp


Ignore:
Timestamp:
Jun 23, 2009, 7:56:29 PM (16 years ago)
Author:
laleppa
Message:

+ Language is automatically loaded at application startup (based on user's locale name).
+ Full Ukrainian and Russian translation.

  • English is now default language.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/main.cpp

    r21 r27  
    3333        app.setOrganizationDomain("www.leppsville.com");
    3434        app.setApplicationName("TSPSG");
    35 /*/ i18n
    36 // TODO: Make English as program's "native" language
     35// i18n
     36// TODO: Language selection in application.
     37// TODO: Saving and restoring selected language.
    3738QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8"));
    3839QString locale = QLocale::languageToString(QLocale::system().language());
    3940QTranslator translator;
    40         // Getting current locale languge name and trying to load it
    41         if (translator.load(locale,"i18n"))
     41        // Getting current locale language name and trying to load it, if it's not English
     42        if (locale.compare("English") && translator.load(locale,"i18n"))
    4243                app.installTranslator(&translator);
    43         // If language loading failed and locale language is not
    44         // application's "native" we're trying to load English
    45         else if (locale.compare("Russian") && translator.load("English","i18n"))
    46                 app.installTranslator(&translator);
    47 //*/
    4844MainWindow mainwindow;
    4945        mainwindow.show();
Note: See TracChangeset for help on using the changeset viewer.