Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Qt:llä

...

voi

...

Linguist

...

softalla

...

tuottaa

...

eri

...

kieliversioita.

...

Projektitiedostoon

...

tehdään

...

esimerkiksi

...

seuraavat

...

asetukset:

{
Code Block
}

TRANSLATIONS = senderi_en.ts

CODECFORSRC = UTF-8
CODECFORTR = UTF-8

{code}

Pääohjelmaan

...

laitetaan

...

kielitiedostojen

...

lataus.

{
Code Block
}
#include <QApplication>
#include <QTranslator>
#include <QLocale>

#include "sender.h"

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    bool englishLanguageSelected=false;
    // if there is command line parameter that sets the language, show UI in that language
    QTranslator translator;
    QStringList params = QCoreApplication::arguments();
    QString currentparam;
    for (int i = 0; i < params.size(); ++i){
        currentparam=params.at(i).toLower();
        if( currentparam=="--lang=en"){
            translator.load(QString("senderi_") + "en");
            app.installTranslator(&translator);
            englishLanguageSelected=true;
        }
    }
    if(!englishLanguageSelected){
        QLocale::setDefault(QLocale(QLocale::Finnish,QLocale::Finland));
    }
    Sender sender;
    sender.show();
    return sender.exec();
}


{code}