Gitlab@AEI Hannover will go down for maintenance on 2020-09-21 at 4:00 UTC. The service will be unavailable for up to 24 hours. If you have questions about this please contact atlas_admin@aei.mpg.de

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

Added automatic internationalization

* Supported languages: en de
parent 2d6fc521
# patterns
*~
*.qm
# files
.project
......
......@@ -31,6 +31,7 @@ SOURCES += src/pulsaranimationwidget.cpp \
src/main.cpp
FORMS += src/pulsatingscience.ui
RESOURCES += src/pulsatingscience.qrc
TRANSLATIONS = src/resources/pulsatingscience_de.ts
UI_DIR = src/.ui
RCC_DIR = src/.rcc
MOC_DIR = src/.moc
......
......@@ -25,8 +25,18 @@
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
PulsatingScience w;
w.show();
return a.exec();
QApplication app(argc, argv);
QTranslator qtTranslator;
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)
QAction* animControl = ui.dockAnimControl->toggleViewAction();
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);
// inital status (based on GUI)
......
......@@ -9,6 +9,9 @@
<file>resources/help-website.png</file>
<file>resources/aei-icon48.png</file>
</qresource>
<qresource prefix="i18ns" >
<file>resources/pulsatingscience_de.qm</file>
</qresource>
<qresource prefix="textures" >
<file>resources/texture_background_carina.jpg</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