Commit 55a5feab authored by Oliver Bock's avatar Oliver Bock
Browse files

Added automatic internationalization

* Supported languages: en de
parent 2d6fc521
# patterns # patterns
*~ *~
*.qm
# files # files
.project .project
......
...@@ -31,6 +31,7 @@ SOURCES += src/pulsaranimationwidget.cpp \ ...@@ -31,6 +31,7 @@ SOURCES += src/pulsaranimationwidget.cpp \
src/main.cpp src/main.cpp
FORMS += src/pulsatingscience.ui FORMS += src/pulsatingscience.ui
RESOURCES += src/pulsatingscience.qrc RESOURCES += src/pulsatingscience.qrc
TRANSLATIONS = src/resources/pulsatingscience_de.ts
UI_DIR = src/.ui UI_DIR = src/.ui
RCC_DIR = src/.rcc RCC_DIR = src/.rcc
MOC_DIR = src/.moc MOC_DIR = src/.moc
......
...@@ -25,8 +25,18 @@ ...@@ -25,8 +25,18 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QApplication a(argc, argv); QApplication app(argc, argv);
PulsatingScience w;
w.show(); QTranslator qtTranslator;
return a.exec(); qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
app.installTranslator(&qtTranslator);
QTranslator appTranslator;
appTranslator.load(":/i18ns/resources/pulsatingscience_" + QLocale::system().name());
app.installTranslator(&appTranslator);
PulsatingScience window;
window.show();
return app.exec();
} }
...@@ -26,7 +26,7 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent) ...@@ -26,7 +26,7 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
QAction* animControl = ui.dockAnimControl->toggleViewAction(); QAction* animControl = ui.dockAnimControl->toggleViewAction();
animControl->setStatusTip(tr("Toggle the animation control visibility")); animControl->setStatusTip(tr("Toggle the animation control visibility"));
animControl->setShortcut(QKeySequence(Qt::ALT + Qt::Key_A)); animControl->setShortcut(QKeySequence(tr("Alt+A")));
ui.menuView->addAction(animControl); ui.menuView->addAction(animControl);
// inital status (based on GUI) // inital status (based on GUI)
......
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
<file>resources/help-website.png</file> <file>resources/help-website.png</file>
<file>resources/aei-icon48.png</file> <file>resources/aei-icon48.png</file>
</qresource> </qresource>
<qresource prefix="i18ns" >
<file>resources/pulsatingscience_de.qm</file>
</qresource>
<qresource prefix="textures" > <qresource prefix="textures" >
<file>resources/texture_background_carina.jpg</file> <file>resources/texture_background_carina.jpg</file>
<file>resources/texture_pulsar.png</file> <file>resources/texture_pulsar.png</file>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment