Translation suport
This commit is contained in:
@@ -4,5 +4,6 @@
|
||||
<file>icons/login_64.png</file>
|
||||
<file>style.css</file>
|
||||
<file>icons/settings.svg</file>
|
||||
<file>translations/prodejna_cs_CZ.qm</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -56,3 +56,7 @@ INCLUDEPATH += $$PWD/../qdecimal/decnumber
|
||||
|
||||
RESOURCES += \
|
||||
appRc.qrc
|
||||
|
||||
TRANSLATIONS = translations/prodejna_cz.ts
|
||||
|
||||
DISTFILES +=
|
||||
|
||||
+12
-2
@@ -1,12 +1,22 @@
|
||||
#include "mainwindow.h"
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
|
||||
#include <QStringList>
|
||||
#include <QTranslator>
|
||||
#include <QLibraryInfo>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
|
||||
QTranslator qtTranslator;
|
||||
qtTranslator.load("qt_" + QLocale::system().name(),
|
||||
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||
a.installTranslator(&qtTranslator);
|
||||
|
||||
QTranslator myappTranslator;
|
||||
myappTranslator.load(":/translations/prodejna_" + QLocale::system().name());
|
||||
a.installTranslator(&myappTranslator);
|
||||
|
||||
MainWindow w;
|
||||
w.move(QApplication::desktop()->screen()->rect().center() - w.rect().center());
|
||||
w.show();
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="cs_CZ">
|
||||
<context>
|
||||
<name>LoginDialog</name>
|
||||
<message>
|
||||
<location filename="../logindialog.ui" line="14"/>
|
||||
<location filename="../logindialog.ui" line="70"/>
|
||||
<source>Login</source>
|
||||
<translation>Login</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../logindialog.ui" line="80"/>
|
||||
<source>Password</source>
|
||||
<translation>Heslo</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MainWindow</name>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="14"/>
|
||||
<source>MainWindow</source>
|
||||
<translation>Nastaveni</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="64"/>
|
||||
<source>File</source>
|
||||
<translation>Soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="86"/>
|
||||
<source>Exit</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="91"/>
|
||||
<source>Open database...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="100"/>
|
||||
<source>Login...</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.ui" line="105"/>
|
||||
<location filename="../mainwindow.ui" line="108"/>
|
||||
<source>Settings</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
Reference in New Issue
Block a user