From 229547553af68dc8aab29ec01d6a9131e5a5b03c Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 5 Nov 2016 13:39:38 +0100 Subject: gui: make program name translatable --- gui/main-window.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gui/main-window.cpp b/gui/main-window.cpp index 8e04d1e5..4d0075f1 100644 --- a/gui/main-window.cpp +++ b/gui/main-window.cpp @@ -165,10 +165,13 @@ void MainWindow::init_tray_menu() tray_menu.clear(); QString display_name(opentrack_version); + qDebug() << display_name; if (display_name.startsWith("opentrack-")) - display_name.replace(sizeof("opentrack") - 1, 1, QChar(' ')); + { + display_name = tr("opentrack") + " " + display_name.mid(sizeof("opentrack-") - 1); + } if (display_name.endsWith("-DEBUG")) - display_name.replace(display_name.size() - int(sizeof("DEBUG")), display_name.size(), " (debug)"); + display_name.replace(display_name.size() - int(sizeof("DEBUG")), display_name.size(), tr(" (debug)")); menu_action_header.setEnabled(false); menu_action_header.setText(display_name); @@ -543,9 +546,11 @@ void MainWindow::set_title(const QString& game_title_) { QString game_title; if (game_title_ != "") - game_title = " :: " + game_title_; + game_title = tr(" :: ") + game_title_; QString current = group::ini_filename(); - setWindowTitle(opentrack_version + QStringLiteral(" :: ") + current + game_title); + QString version(opentrack_version); + version = tr("opentrack") + " " + version.mid(sizeof("opentrack-") - 1); + setWindowTitle(version + tr(" :: ") + current + game_title); } void MainWindow::showHeadPose() -- cgit v1.2.3