1. Add below lines in your finnish.pro
TRANSLATIONS = PublicTransport_fi.ts
2. Run lupdate finnish.pro
3. You will see a new file named PublicTransport_fi.ts created
4. Open the ts file QtLinguist and select strings and add translations
5. Mark them as finished by clicking the tick mark on string
6. Validate them and save
7. Add below lines in your main
QString locale = QLocale::system().name();
QTranslator translator;
translator.load(QString("PublicTransport_") + locale);
app.installTranslator(&translator);
8. Note your last part of name ( _fi ) should match with your locale name
9. Do not forget to deploy your file to your app folder :
Add this lines :
myFiles.sources = PublicTransport_fi.qm
DEPLOYMENT += myFiles
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment