diff --git a/.github/workflows/build-arch-aur.yml b/.github/workflows/build-arch-aur.yml index b9af209..fe6351b 100644 --- a/.github/workflows/build-arch-aur.yml +++ b/.github/workflows/build-arch-aur.yml @@ -27,7 +27,8 @@ jobs: run: | pacman -Syu --noconfirm --needed \ git \ - qt6-base + qt6-base \ + qt6-tools - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/build-debian-qt6.yml b/.github/workflows/build-debian-qt6.yml index 1b5c078..bf2341b 100644 --- a/.github/workflows/build-debian-qt6.yml +++ b/.github/workflows/build-debian-qt6.yml @@ -33,6 +33,7 @@ jobs: qmake6 \ qt6-base-dev \ qt6-base-dev-tools \ + qt6-l10n-tools \ libgl1-mesa-dev - name: Checkout diff --git a/.gitignore b/.gitignore index 260907c..bb20a1e 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,10 @@ Makefile .qmake.stash .qmake.cache +# lrelease-generated compiled translations (embedded into the binary at build) +src/.qm/ +*.qm + # Build directories build/ debug/ diff --git a/README.md b/README.md index 52a4b36..9894862 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,16 @@ make -j$(nproc) ./tux-manager ``` +To test a different UI locale without changing the system settings, override +the process locale when launching the application: + +```bash +LC_ALL=zh_CN.UTF-8 ./tux-manager # Simplified Chinese +LC_ALL=C ./tux-manager # Built-in English +``` + +The requested locale may need to be generated or installed on the host system. + ## Core philosophy and goals of this project * KISS - keep it simple stupid diff --git a/debian/control b/debian/control index 0a53a47..147c85f 100644 --- a/debian/control +++ b/debian/control @@ -4,13 +4,15 @@ Priority: optional Maintainer: Petr Bena Build-Depends: debhelper-compat (= 12), pkg-config, - qtbase5-dev | qt6-base-dev + qt6-base-dev | qtbase5-dev, + qt6-l10n-tools | qttools5-dev-tools Standards-Version: 4.6.2 Rules-Requires-Root: no Package: tux-manager Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: qt6-translations-l10n | qttranslations5-l10n Description: Tux Manager - Linux system monitor inspired by Windows Task Manager Tux Manager is a C++/Qt system monitor with tabs for processes, performance, users and services. diff --git a/flake.nix b/flake.nix index 3acc650..2480e97 100644 --- a/flake.nix +++ b/flake.nix @@ -25,7 +25,7 @@ version = "1.0.7"; src = ./.; - nativeBuildInputs = with pkgs.kdePackages; [ qmake wrapQtAppsHook ]; + nativeBuildInputs = with pkgs.kdePackages; [ qmake qttools wrapQtAppsHook ]; buildInputs = with pkgs.kdePackages; [ qtbase ]; configurePhase = "qmake6 $src/src"; diff --git a/packaging/README.md b/packaging/README.md index 590c970..3de5f3a 100644 --- a/packaging/README.md +++ b/packaging/README.md @@ -20,23 +20,23 @@ This directory contains Linux packaging scripts for Tux Manager. Required build tools/packages: ```bash -sudo apt-get install build-essential debhelper dpkg-dev pkg-config qt6-base-dev +sudo apt-get install build-essential debhelper dpkg-dev pkg-config qt6-base-dev qt6-l10n-tools ``` Notes: -- The script accepts either `qmake6` or `qmake`. -- Qt5 can also work if your distro provides it (`qtbase5-dev`). +- On distributions without Qt6, install `qtbase5-dev qttools5-dev-tools` instead. +- The script prefers `qmake6` when both Qt versions are installed. ### Fedora/RHEL family Required build tools/packages: ```bash -sudo dnf install rpm-build rsync git pkgconf-pkg-config qt6-qtbase-devel +sudo dnf install rpm-build rsync git pkgconf-pkg-config qt6-qtbase-devel qt6-linguist ``` Notes: -- The script can also build with Qt5 if only that is available (`qt5-qtbase-devel`). +- The script can also build with Qt5 if `qt5-qtbase-devel` and `qt5-linguist` are installed. - The script uses `rpmbuild` and creates both binary RPM and source RPM. ### Flatpak @@ -66,7 +66,7 @@ Required tools/packages: Download released appimages from all 3, put them into some directory and create symlinks with bare names, then add this folder to PATH variable ```bash -sudo apt-get install build-essential pkg-config qt6-base-dev +sudo apt-get install build-essential pkg-config qt6-base-dev qt6-l10n-tools linuxdeploy --version linuxdeploy-plugin-qt --help linuxdeploy-plugin-appimage --help @@ -82,7 +82,7 @@ Notes: Required build tools/packages: ```bash -sudo pacman -S --needed base-devel git qt6-base +sudo pacman -S --needed base-devel git qt6-base qt6-tools ``` Notes: diff --git a/packaging/package-appimage.sh b/packaging/package-appimage.sh index cdb31c7..5877815 100755 --- a/packaging/package-appimage.sh +++ b/packaging/package-appimage.sh @@ -69,6 +69,16 @@ else fi fi +QT_TOOLS_BIN="$("$QMAKE_CMD" -query QT_HOST_BINS 2>/dev/null || true)" +if [ ! -x "$QT_TOOLS_BIN/lrelease" ]; then + QT_TOOLS_BIN="$("$QMAKE_CMD" -query QT_INSTALL_BINS 2>/dev/null || true)" +fi +if [ ! -x "$QT_TOOLS_BIN/lrelease" ]; then + echo "Error: Qt Linguist lrelease not found for $QMAKE_CMD." + echo "Install the matching Qt Linguist tools package or include it in --qt." + exit 1 +fi + if ! command -v linuxdeploy >/dev/null 2>&1; then echo "Error: linuxdeploy not found in PATH." echo "Install linuxdeploy and re-run." diff --git a/packaging/package-arch.sh b/packaging/package-arch.sh index 1d82c23..0517217 100755 --- a/packaging/package-arch.sh +++ b/packaging/package-arch.sh @@ -44,7 +44,7 @@ if [[ ${EUID:-$(id -u)} -eq 0 ]]; then exit 1 fi -for cmd in makepkg qmake6 tar b2sum; do +for cmd in makepkg qmake6 lrelease6 tar b2sum; do if ! command -v "$cmd" >/dev/null 2>&1; then echo "Error: required command not found: $cmd" exit 1 @@ -87,7 +87,7 @@ arch=('x86_64') url="${APP_HOMEPAGE_URL}" license=('GPL-3.0-or-later') depends=('qt6-base') -makedepends=('qt6-base') +makedepends=('qt6-base' 'qt6-tools') options=('!debug') source=("${APP_NAME}-${APP_VERSION}.tar.gz::file://${SOURCE_TARBALL}") b2sums=('${LOCAL_CHECKSUM}') diff --git a/packaging/package-deb.sh b/packaging/package-deb.sh index 56a8ef9..e2cea75 100755 --- a/packaging/package-deb.sh +++ b/packaging/package-deb.sh @@ -76,7 +76,8 @@ if command -v dpkg-query >/dev/null 2>&1; then require_pkg debhelper require_pkg dpkg-dev require_pkg pkg-config - require_one_of qtbase5-dev qt6-base-dev + require_one_of qt6-base-dev qtbase5-dev + require_one_of qt6-l10n-tools qttools5-dev-tools if [ ${#missing[@]} -gt 0 ] || [ ${#missing_groups[@]} -gt 0 ]; then echo "Missing build dependencies detected." diff --git a/packaging/package-rpm.sh b/packaging/package-rpm.sh index fc79ae8..a8c94cf 100755 --- a/packaging/package-rpm.sh +++ b/packaging/package-rpm.sh @@ -82,8 +82,10 @@ if command -v rpm >/dev/null 2>&1; then if [ "$QT_MAJOR" -eq 5 ]; then require_pkg qt5-qtbase-devel + require_pkg qt5-linguist else require_pkg qt6-qtbase-devel + require_pkg qt6-linguist fi if [ ${#missing[@]} -gt 0 ]; then @@ -186,8 +188,10 @@ Source0: %{name}-%{version}.tar.gz %if 0%{?qt_major} == 5 BuildRequires: qt5-qtbase-devel +BuildRequires: qt5-linguist %else BuildRequires: qt6-qtbase-devel +BuildRequires: qt6-linguist %endif BuildRequires: pkgconf-pkg-config diff --git a/src/TuxManager.pro b/src/TuxManager.pro index 983b55e..c49df9b 100644 --- a/src/TuxManager.pro +++ b/src/TuxManager.pro @@ -13,6 +13,7 @@ SOURCES += \ aboutdialog.cpp \ colorschemedialog.cpp \ colorscheme.cpp \ + i18n.cpp \ main.cpp \ mainwindow.cpp \ metrics.cpp \ @@ -68,6 +69,7 @@ HEADERS += \ colorschemedialog.h \ colorscheme.h \ globals.h \ + i18n.h \ mainwindow.h \ metrics.h \ misc.h \ @@ -138,6 +140,15 @@ FORMS += \ RESOURCES += \ resources.qrc +# ── Translations ────────────────────────────────────────────────────────────── +# Qt Linguist machinery: the .ts files in TRANSLATIONS are compiled into .qm at +# build time (lrelease) and embedded into the binary under :/i18n/. That keeps +# the translations working no matter where the application is installed from. +TRANSLATIONS += \ + translations/tux-manager_zh_CN.ts + +CONFIG += lrelease embed_translations + # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin diff --git a/src/i18n.cpp b/src/i18n.cpp new file mode 100644 index 0000000..1b2cdd7 --- /dev/null +++ b/src/i18n.cpp @@ -0,0 +1,139 @@ +/* + * Tux Manager - Linux system monitor + * Copyright (C) 2026 Petr Bena + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "i18n.h" +#include "logger.h" + +#include +#include +#include +#include +#include +#include +#include + +namespace +{ + // Translators live for the whole application lifetime. + QTranslator *appTranslator() + { + static QTranslator *t = new QTranslator(); + return t; + } + + QTranslator *qtTranslator() + { + static QTranslator *t = new QTranslator(); + return t; + } + + bool isEnglishLanguage(const QString &code) + { + if (code.isEmpty()) + return true; + // "C" / "POSIX" mean the classic unlocalized environment. + const QString base = code.section('_', 0, 0).toLower(); + return base == QStringLiteral("en") + || base == QStringLiteral("c") + || base == QStringLiteral("posix"); + } + + // Load an embedded application catalog. Exact locale match is preferred, + // then the language part only. + bool loadCatalog(QTranslator *translator, const QString &catalog, const QString &language) + { + QStringList candidates; + candidates << language; + const int underscore = language.indexOf(QLatin1Char('_')); + if (underscore > 0) + candidates << language.left(underscore); + + for (const QString &lang : candidates) + { + const QString path = QStringLiteral(":/i18n/") + catalog + QLatin1Char('_') + lang + QStringLiteral(".qm"); + if (translator->load(path)) + { + LOG_DEBUG(QString("I18n: loaded embedded catalog %1").arg(path)); + return true; + } + } + return false; + } + +} + +void I18n::InstallTranslators() +{ + const QString code = QLocale::system().name(); + + // Always drop any previously installed translator first so a restart or + // repeated call can never stack two translations. + if (appTranslator()->isEmpty() == false) + QCoreApplication::removeTranslator(appTranslator()); + if (qtTranslator()->isEmpty() == false) + QCoreApplication::removeTranslator(qtTranslator()); + + if (isEnglishLanguage(code)) + { + LOG_DEBUG("I18n: no translation needed, using built-in English UI"); + return; + } + + const QString matched = loadCatalog(appTranslator(), QStringLiteral("tux-manager"), code) ? code : QString(); + if (matched.isEmpty()) + { + // No translation file for this language, fall back to English UI. + LOG_INFO(QString("I18n: no translation available for '%1', falling back to English").arg(code)); + return; + } + + // Best effort: also localize Qt built-in dialogs (QMessageBox buttons etc.) + // using the matching qtbase catalog from the Qt installation. +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + const QString qtTranslationsDir = QLibraryInfo::path(QLibraryInfo::TranslationsPath); +#else + const QString qtTranslationsDir = QLibraryInfo::location(QLibraryInfo::TranslationsPath); +#endif + if (QFile::exists(qtTranslationsDir)) + { + QStringList candidates; + candidates << matched; + const int underscore = matched.indexOf(QLatin1Char('_')); + if (underscore > 0) + candidates << matched.left(underscore); + + for (const QString &lang : candidates) + { + const QString fileName = QStringLiteral("qtbase_") + lang + QStringLiteral(".qm"); + const QString path = qtTranslationsDir.endsWith(QLatin1Char('/')) ? qtTranslationsDir + fileName + : qtTranslationsDir + QLatin1Char('/') + fileName; + if (QFile::exists(path)) + { + if (qtTranslator()->load(fileName, qtTranslationsDir)) + { + QCoreApplication::installTranslator(qtTranslator()); + LOG_DEBUG(QString("I18n: loaded Qt base translation %1").arg(fileName)); + } + break; + } + } + } + + QCoreApplication::installTranslator(appTranslator()); + LOG_INFO(QString("I18n: using language '%1'").arg(matched)); +} diff --git a/src/i18n.h b/src/i18n.h new file mode 100644 index 0000000..72ddddf --- /dev/null +++ b/src/i18n.h @@ -0,0 +1,30 @@ +/* + * Tux Manager - Linux system monitor + * Copyright (C) 2026 Petr Bena + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef I18N_H +#define I18N_H + +//! Application localization helpers (Qt Linguist / QTranslator). +namespace I18n +{ + /// Install application and Qt translators for the system language. + /// Must be called after QApplication exists and before widgets are created. + void InstallTranslators(); +} + +#endif // I18N_H diff --git a/src/main.cpp b/src/main.cpp index 0e934e6..bcd4e49 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -18,6 +18,7 @@ #include "mainwindow.h" #include "configuration.h" +#include "i18n.h" #include "logger.h" #include "globals.h" @@ -103,6 +104,11 @@ int main(int argc, char *argv[]) // ── Bootstrap ───────────────────────────────────────────────────────────── CFG->Load(); CFG->ForceGpuDrm = parser.isSet(forceDrmOption); + + // Install translations for the system language before any widget is + // created, so all tr() calls already resolve to the right text. + I18n::InstallTranslators(); + LOG_INFO(QString("%1 %2 starting (verbosity=%3)").arg(a.applicationName(), a.applicationVersion()).arg(verbosity)); MainWindow w; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 23bc0c9..f652ac7 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -33,7 +33,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) if (CFG->IsSuperuser) { // Make user aware of this - this->setWindowTitle(this->windowTitle() + " (superuser)"); + this->setWindowTitle(this->windowTitle() + tr(" (superuser)")); } this->ui->processesLayout->addWidget(this->m_processesWidget); diff --git a/src/os/process.cpp b/src/os/process.cpp index 5c11dd3..1ee0f1e 100644 --- a/src/os/process.cpp +++ b/src/os/process.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -61,14 +62,14 @@ QString Process::GetStateString(char state) { switch (state) { - case 'R': return "Running"; - case 'S': return "Sleeping"; - case 'D': return "Disk sleep"; - case 'Z': return "Zombie"; - case 'T': return "Stopped"; - case 't': return "Tracing stop"; - case 'I': return "Idle"; - case 'X': return "Dead"; + case 'R': return QObject::tr("Running"); + case 'S': return QObject::tr("Sleeping"); + case 'D': return QObject::tr("Disk sleep"); + case 'Z': return QObject::tr("Zombie"); + case 'T': return QObject::tr("Stopped"); + case 't': return QObject::tr("Tracing stop"); + case 'I': return QObject::tr("Idle"); + case 'X': return QObject::tr("Dead"); default: return QString(state); } } diff --git a/src/os/processmodel.cpp b/src/os/processmodel.cpp index b2f2b96..174f073 100644 --- a/src/os/processmodel.cpp +++ b/src/os/processmodel.cpp @@ -414,24 +414,24 @@ QString ProcessModel::columnHeader(Column col) { switch (col) { - case ColPid: return "PID"; - case ColName: return "Name"; - case ColUser: return "User"; - case ColState: return "State"; - case ColCpu: return "CPU %"; - case ColMemRss: return "MEM RES"; - case ColMemVirt: return "MEM VIRT"; - case ColMemShared:return "MEM SHR"; - case ColMemText: return "MEM TEXT"; - case ColMemData: return "MEM DATA"; - case ColIoReads: return "IO Reads"; - case ColIoWrites: return "IO Writes"; - case ColIoReadsPerSec: return "IO Read/s"; - case ColIoWritesPerSec:return "IO Write/s"; - case ColThreads: return "Threads"; - case ColPriority: return "Priority"; - case ColNice: return "Nice"; - case ColCmdline: return "Command"; + case ColPid: return tr("PID"); + case ColName: return tr("Name"); + case ColUser: return tr("User"); + case ColState: return tr("State"); + case ColCpu: return tr("CPU %"); + case ColMemRss: return tr("MEM RES"); + case ColMemVirt: return tr("MEM VIRT"); + case ColMemShared:return tr("MEM SHR"); + case ColMemText: return tr("MEM TEXT"); + case ColMemData: return tr("MEM DATA"); + case ColIoReads: return tr("IO Reads"); + case ColIoWrites: return tr("IO Writes"); + case ColIoReadsPerSec: return tr("IO Read/s"); + case ColIoWritesPerSec:return tr("IO Write/s"); + case ColThreads: return tr("Threads"); + case ColPriority: return tr("Priority"); + case ColNice: return tr("Nice"); + case ColCmdline: return tr("Command"); default: return {}; } } diff --git a/src/os/processtreemodel.cpp b/src/os/processtreemodel.cpp index 39c7691..be08875 100644 --- a/src/os/processtreemodel.cpp +++ b/src/os/processtreemodel.cpp @@ -238,24 +238,24 @@ QString ProcessTreeModel::columnHeader(Column col) { switch (col) { - case ColPid: return "PID"; - case ColName: return "Name"; - case ColUser: return "User"; - case ColState: return "State"; - case ColCpu: return "CPU %"; - case ColMemRss: return "MEM RES"; - case ColMemVirt: return "MEM VIRT"; - case ColMemShared:return "MEM SHR"; - case ColMemText: return "MEM TEXT"; - case ColMemData: return "MEM DATA"; - case ColIoReads: return "IO Reads"; - case ColIoWrites: return "IO Writes"; - case ColIoReadsPerSec: return "IO Read/s"; - case ColIoWritesPerSec:return "IO Write/s"; - case ColThreads: return "Threads"; - case ColPriority: return "Priority"; - case ColNice: return "Nice"; - case ColCmdline: return "Command"; + case ColPid: return tr("PID"); + case ColName: return tr("Name"); + case ColUser: return tr("User"); + case ColState: return tr("State"); + case ColCpu: return tr("CPU %"); + case ColMemRss: return tr("MEM RES"); + case ColMemVirt: return tr("MEM VIRT"); + case ColMemShared:return tr("MEM SHR"); + case ColMemText: return tr("MEM TEXT"); + case ColMemData: return tr("MEM DATA"); + case ColIoReads: return tr("IO Reads"); + case ColIoWrites: return tr("IO Writes"); + case ColIoReadsPerSec: return tr("IO Read/s"); + case ColIoWritesPerSec:return tr("IO Write/s"); + case ColThreads: return tr("Threads"); + case ColPriority: return tr("Priority"); + case ColNice: return tr("Nice"); + case ColCmdline: return tr("Command"); default: return {}; } } diff --git a/src/translations/tux-manager_zh_CN.ts b/src/translations/tux-manager_zh_CN.ts new file mode 100644 index 0000000..768577f --- /dev/null +++ b/src/translations/tux-manager_zh_CN.ts @@ -0,0 +1,2209 @@ + + + + AboutDialog + + + About TuxManager + 关于 TuxManager + + + + Close + 关闭 + + + + Tux Manager + Tux Manager + + + + Version + 版本 + + + + <html><head/><body><p>Created by Petr Bena and <a href="https://github.com/benapetr/TuxManager/graphs/contributors"><span style=" text-decoration: underline; color:#8ab4f8;">many other contributors</span></a></p></body></html> + <html><head/><body><p>由 Petr Bena 及 <a href="https://github.com/benapetr/TuxManager/graphs/contributors"><span style=" text-decoration: underline; color:#8ab4f8;">众多其他贡献者</span></a>创建</p></body></html> + + + + A Linux Task Manager alternative built with Qt6, inspired by the Windows Task Manager but designed to go further - providing deep visibility into system processes, performance metrics, users, and services.<br><br><a href="https://github.com/benapetr/TuxManager">https://github.com/benapetr/TuxManager</a><br><br>License - GPL-3.0-or-later + 一款使用 Qt6 构建的 Linux 任务管理器替代品,灵感来自 Windows 任务管理器,但致力于更进一步——深度洞察系统进程、性能指标、用户和服务。<br><br><a href="https://github.com/benapetr/TuxManager">https://github.com/benapetr/TuxManager</a><br><br>许可证 - GPL-3.0-or-later + + + + Version %1 + 版本 %1 + + + + ColorSchemeDialog + + + Customize Colors + 自定义颜色 + + + + Use custom colors + 使用自定义颜色 + + + + When disabled, the default light or dark palette is used automatically. + 禁用后,将自动使用默认的浅色或深色调色板。 + + + + Choose + 选择 + + + + Reset + 重置 + + + + CpuDetailWidget + + + CPU + CPU + + + + font-size: 18pt; font-weight: bold; + font-size: 18pt; font-weight: bold; + + + + + + font-size: 8pt; + font-size: 8pt; + + + + + 0% + 0% + + + + font-size: 18pt; + font-size: 18pt; + + + + 60 seconds + 60 秒 + + + + 0 + 0 + + + + Utilization + 利用率 + + + + Speed + 速度 + + + + + + + + + + — + — + + + + Processes + 进程数 + + + + Threads + 线程 + + + + Uptime + 运行时间 + + + + Logical processors + 逻辑处理器 + + + + Virtual machine + 虚拟机 + + + + Temperature + 温度 + + + + DiskDetailWidget + + + Disk + 磁盘 + + + + font-size: 18pt; font-weight: bold; + font-size: 18pt; font-weight: bold; + + + + font-size: 12pt; + font-size: 12pt; + + + + + Active time + 活动时间 + + + + + + + + + + + font-size: 8pt; + font-size: 8pt; + + + + 100% + 100% + + + + + 60 seconds + 60 秒 + + + + + 0 + 0 + + + + Disk transfer rate + 磁盘传输速率 + + + + + + 0 KB/s + 0 KB/s + + + + 0% + 0% + + + + Capacity + 容量 + + + + + + + + + — + — + + + + Read speed + 读取速度 + + + + Formatted + 已格式化 + + + + Write speed + 写入速度 + + + + System disk + 系统磁盘 + + + + Device + 设备 + + + + Page file + 页面文件 + + + + Type + 类型 + + + + GpuDetailWidget + + + font-size: 18pt; font-weight: bold; + font-size: 18pt; font-weight: bold; + + + + GPU + GPU + + + + font-size: 11pt; + font-size: 11pt; + + + + Dedicated GPU memory usage + 专用 GPU 显存使用量 + + + + + 0 GB + 0 GB + + + + + + 60 seconds + 60 秒 + + + + + + 0 + 0 + + + + Shared GPU memory usage + 共享 GPU 显存使用量 + + + + Copy bandwidth + 复制带宽 + + + + Light: TX Dark: RX + 浅色:TX 深色:RX + + + + 0 KB/s + 0 KB/s + + + + Utilization + 利用率 + + + + 0% + 0% + + + + Dedicated GPU memory + 专用 GPU 显存 + + + + + + 0 / 0 GB + 0 / 0 GB + + + + GPU Memory + GPU 显存 + + + + Shared GPU memory + 共享 GPU 显存 + + + + Temperature + 温度 + + + + + + + + — + — + + + + Driver version + 驱动程序版本 + + + + Backend + 后端 + + + + Core clock + 核心频率 + + + + Power usage + 功耗 + + + + MainWindow + + + Tux Manager + Tux Manager + + + + Processes + 进程 + + + + Performance + 性能 + + + + Users + 用户 + + + + Services + 服务 + + + + (superuser) + (超级用户) + + + + MemoryDetailWidget + + + font-size: 18pt; font-weight: bold; + font-size: 18pt; font-weight: bold; + + + + Memory + 内存 + + + + font-size: 18pt; + font-size: 18pt; + + + + — GB + — GB + + + + + + + + + + + + + + + + font-size: 8pt; + font-size: 8pt; + + + + 60 seconds + 60 秒 + + + + 0 + 0 + + + + Memory composition + 内存构成 + + + + + + + + ■ + ■ + + + + + In use + 使用中 + + + + + Compressed + 已压缩 + + + + + Dirty + 脏页 + + + + Free (Cached) + 空闲(已缓存) + + + + + Free + 空闲 + + + + + + + + + + + + — + — + + + + Available + 可用 + + + + Cached + 已缓存 + + + + Buffers + 缓冲区 + + + + DIMM slots used + 已用 DIMM 插槽 + + + + Speed + 速度 + + + + NetworkDetailWidget + + + font-size: 18pt; font-weight: bold; + font-size: 18pt; font-weight: bold; + + + + Ethernet + 以太网 + + + + + + + font-size: 8pt; + font-size: 8pt; + + + + Throughput + 吞吐量 + + + + + + 0 KB/s + 0 KB/s + + + + 60 seconds + 60 秒 + + + + 0 + 0 + + + + Send + 发送 + + + + Adapter + 适配器 + + + + + + + + — + — + + + + Receive + 接收 + + + + Connection type + 连接类型 + + + + Link speed + 链接速度 + + + + IPv4 address + IPv4 地址 + + + + IPv6 addresses + IPv6 地址 + + + + OS::ProcessModel + + + + measuring... + 正在测量… + + + + PID + PID + + + + Name + 名称 + + + + User + 用户 + + + + State + 状态 + + + + CPU % + CPU % + + + + MEM RES + 常驻内存 + + + + MEM VIRT + 虚拟内存 + + + + MEM SHR + 共享内存 + + + + MEM TEXT + 代码内存 + + + + MEM DATA + 数据内存 + + + + IO Reads + I/O 读取 + + + + IO Writes + I/O 写入 + + + + IO Read/s + I/O 读取/秒 + + + + IO Write/s + I/O 写入/秒 + + + + Threads + 线程 + + + + Priority + 优先级 + + + + Nice + Nice + + + + Command + 命令行 + + + + OS::ProcessTreeModel + + + + measuring... + 正在测量… + + + + PID + PID + + + + Name + 名称 + + + + User + 用户 + + + + State + 状态 + + + + CPU % + CPU % + + + + MEM RES + 常驻内存 + + + + MEM VIRT + 虚拟内存 + + + + MEM SHR + 共享内存 + + + + MEM TEXT + 代码内存 + + + + MEM DATA + 数据内存 + + + + IO Reads + I/O 读取 + + + + IO Writes + I/O 写入 + + + + IO Read/s + I/O 读取/秒 + + + + IO Write/s + I/O 写入/秒 + + + + Threads + 线程 + + + + Priority + 优先级 + + + + Nice + Nice + + + + Command + 命令行 + + + + OS::ServiceModel + + + Service + 服务 + + + + Load + 加载 + + + + Active + 活动 + + + + SubState + 子状态 + + + + Description + 描述 + + + + Perf::CpuDetailWidget + + + %1 GHz + %1 GHz + + + + + — + — + + + + %1 C + %1 C + + + + %1d %2:%3:%4 + %1天 %2:%3:%4 + + + + %1:%2:%3 + %1:%2:%3 + + + + Yes + 是 + + + + Yes (%1) + 是 (%1) + + + + No + 否 + + + + CPU graph options + CPU 图形选项 + + + + Change graph to + 切换图形为 + + + + Overall utilization + 总体利用率 + + + + Logical processors + 逻辑处理器 + + + + Show kernel times + 显示内核时间 + + + + Perf::CpuGraphArea + + + CPU + CPU + + + + + Kernel + 内核 + + + + %1 GHz + %1 GHz + + + + + CPU %1 + CPU %1 + + + + Perf::DiskDetailWidget + + + Active time + 活动时间 + + + + Read + 读取 + + + + Write + 写入 + + + + 100% + 100% + + + + Disk (%1) + 磁盘 (%1) + + + + - + - + + + + + Yes + 是 + + + + + No + 否 + + + + Perf::GpuDetailWidget + + + Dedicated memory usage + 专用显存使用量 + + + + Shared memory usage + 共享显存使用量 + + + + TX + TX + + + + RX + RX + + + + Copy bandwidth: light trace = TX, dark trace = RX + 复制带宽:浅色轨迹 = TX,深色轨迹 = RX + + + + %1 C + %1 C + + + + — + — + + + + + + %1 / %2 + %1 / %2 + + + + %1 MHz + %1 MHz + + + + %1 W + %1 W + + + + + GB + GB + + + + GPU %1 + GPU %1 + + + + Value + 数值 + + + + Perf::GraphWidget + + + + %1: %2 + %1:%2 + + + + +%1 s ago + +%1 秒前 + + + + + % + % + + + + %1 (%2 %3) + %1=percent text %2=absolute value %3=absolute unit + %1 (%2 %3) + + + + Value + 数值 + + + + Secondary + 次要 + + + + Perf::MemoryBar + + + Used + 已用 + + + + Used (compressed) + 已用(压缩) + + + + Dirty + 脏页 + + + + Free (cached) + 空闲(缓存) + + + + Free + 空闲 + + + + %1: %2 (%3%) + %1: %2 (%3%) + + + + Perf::MemoryDetailWidget + + + Used memory + 已用内存 + + + + GB + GB + + + + %1 / %2 + %1 / %2 + + + + + + — + — + + + + %1 MT/s + %1 MT/s + + + + %1 (using %2 RAM) + %1(使用 %2 内存) + + + + Perf::NetworkDetailWidget + + + Receive + 接收 + + + + Send + 发送 + + + + NIC (%1) + 网卡 (%1) + + + + Mbps + Mbps + + + + Unknown + 未知 + + + + + — + — + + + + Network graph options + 网络图形选项 + + + + Show speeds in bits + 以比特显示速度 + + + + Show speeds in bytes + 以字节显示速度 + + + + Perf::SwapDetailWidget + + + Swap in + 换入 + + + + Swap out + 换出 + + + + Swap in: disk -> RAM (pages read back into memory) +Swap out: RAM -> disk (pages written to swap storage) + 换入:磁盘 -> 内存(将页面读回内存) +换出:内存 -> 磁盘(将页面写入交换存储) + + + + Swap graph options + 交换图形选项 + + + + Change graph to + 切换图形为 + + + + Overall usage + 总体使用量 + + + + Swap devices + 交换设备 + + + + Perf::SwapGraphArea + + + Swap usage + 交换空间使用量 + + + + + + GB + GB + + + + PerformanceWidget + + + CPU + CPU + + + + Memory + 内存 + + + + Swap + 交换空间 + + + + Disk (%1) + 磁盘 (%1) + + + + GPU %1 + GPU %1 + + + + NIC (%1) + 网卡 (%1) + + + + %1%2 %3C + %1=value %2=percent sign %3=temperature in Celsius + %1%2 %3C + + + + Off + 关闭 + + + + %1 %2 + %1=disk type %2=active percentage + %1 %2 + + + + %1%2 + %1=GPU utilization value %2=percent sign + %1%2 + + + + %1 %2C + %1=GPU utilization %2=temperature in Celsius + %1 %2C + + + + U:%1 D:%2 + %1=upload rate %2=download rate + ↑%1 ↓%2 + + + + Settings + 设置 + + + + Customize order... + 自定义顺序… + + + + Customize colors... + 自定义颜色… + + + + Show grid in side panel + 在侧面板中显示网格 + + + + ProcessesWidget + + + Search: + 搜索: + + + + Filter processes… + 筛选进程… + + + + Run new task + 运行新任务 + + + + Open terminal + 打开终端 + + + + Tasks: 0 + 任务:0 + + + + Copy + 复制 + + + + Entire row + 整行 + + + + Selected cell + 所选单元格 + + + + PIDs + PID + + + + PID + PID + + + + + View + 视图 + + + + + Kernel tasks + 内核任务 + + + + + Processes of other users + 其他用户的进程 + + + + + Table view + 表格视图 + + + + + Tree view + 树形视图 + + + + Send signal + 发送信号 + + + + Custom signal... + 自定义信号… + + + + + Terminate (SIGTERM) + 终止 (SIGTERM) + + + + + Kill (SIGKILL) + 强制结束 (SIGKILL) + + + + + Change priority (renice)... + 更改优先级 (renice)… + + + + Tasks: %1 Threads: %2 + 任务:%1 线程:%2 + + + + Send custom signal + 发送自定义信号 + + + + Signal number: + 信号编号: + + + + + Open terminal failed + 打开终端失败 + + + + No supported terminal emulator was found on this system. + 系统上未找到受支持的终端模拟器。 + + + + Failed to start terminal: %1 + 启动终端失败:%1 + + + + You are about to send signal %1 to process PID %2. + +Do you want to continue? + 即将向进程 PID %2 发送信号 %1。 + +是否继续? + + + + You are about to send signal %1 to %2 selected processes. +This will affect all selected processes. + +PIDs: %3 + +Do you want to continue? + 即将向选中的 %2 个进程发送信号 %1。 +这将影响所有选中的进程。 + +PID:%3 + +是否继续? + + + + +Target owners: %1 + +目标所有者:%1 + + + + + +Warning: one or more selected processes are owned by another user. This application is running without superuser privileges, so this signal will most likely be rejected and nothing will happen. + + +警告:一个或多个选中的进程归其他用户所有。此应用程序未以超级用户权限运行,因此该信号很可能会被拒绝且不会生效。 + + + + Confirm Signal + 确认信号 + + + + Signal failed + 信号发送失败 + + + + Change priority + 更改优先级 + + + + Nice value (-20 = highest priority, 19 = lowest): + Nice 值(-20 = 最高优先级,19 = 最低): + + + + Renice failed + renice 失败 + + + + QObject + + + GB/s + GB/s + + + + MB/s + MB/s + + + + KB/s + KB/s + + + + B/s + B/s + + + + Gb/s + Gb/s + + + + Mb/s + Mb/s + + + + Kb/s + Kb/s + + + + b/s + b/s + + + + Running + 运行中 + + + + Sleeping + 睡眠中 + + + + Disk sleep + 磁盘睡眠 + + + + Zombie + 僵尸 + + + + Stopped + 已停止 + + + + Tracing stop + 跟踪停止 + + + + Idle + 空闲 + + + + Dead + 已结束 + + + + Unable to query services via sd-bus or systemctl + 无法通过 sd-bus 或 systemctl 查询服务 + + + + libsystemd not found + 未找到 libsystemd + + + + libsystemd missing sd-bus symbols + libsystemd 缺少 sd-bus 符号 + + + + + systemctl not found + 未找到 systemctl + + + + systemd runtime directory not present + systemd 运行时目录不存在 + + + + Failed to start systemctl + 启动 systemctl 失败 + + + + systemctl timed out + systemctl 超时 + + + + + sd-bus open system failed (%1) + sd-bus 打开系统总线失败 (%1) + + + + sd-bus ListUnits call failed (%1) + sd-bus ListUnits 调用失败 (%1) + + + + sd-bus decode failed (%1) + sd-bus 解码失败 (%1) + + + + sd-bus read row failed (%1/%2) + sd-bus 读取行失败 (%1/%2) + + + + sd-bus iteration failed (%1) + sd-bus 迭代失败 (%1) + + + + Invalid service action + 无效的服务操作 + + + + libsystemd missing interactive sd-bus symbols + libsystemd 缺少交互式 sd-bus 符号 + + + + systemd D-Bus call %1 for %2 failed (%3) + systemd D-Bus 调用 %1(针对 %2)失败 (%3) + + + + systemctl %1 %2 failed + systemctl %1 %2 失败 + + + + CPU + CPU + + + + Memory + 内存 + + + + Swap + 交换空间 + + + + Disks + 磁盘 + + + + NICs + 网卡 + + + + GPUs + GPU + + + + Network + 网络 + + + + Unknown device + 未知设备 + + + + Unknown + 未知 + + + + About TuxManager + 关于 TuxManager + + + + Copy + 复制 + + + + + Copy graph + 复制图形 + + + + Refresh interval + 刷新间隔 + + + + Paused + 已暂停 + + + + Graph time + 图形时间 + + + + %1 (%2) + %1(%2) + + + + %1 (pid %2) + %1(pid %2) + + + + RunTaskDialog + + + Run new task + 运行新任务 + + + + Open: + 打开: + + + + ... + ... + + + + Enter an executable name or path, with optional arguments + 输入可执行文件名称或路径,可附带参数 + + + + Run new task failed + 运行新任务失败 + + + + Failed to start command. + +%1 + 启动命令失败。 + +%1 + + + + Select executable + 选择可执行文件 + + + + All files (*) + 所有文件 (*) + + + + + Command is empty + 命令为空 + + + + Executable was not found: %1 + 找不到可执行文件:%1 + + + + Executable does not exist: %1 + 可执行文件不存在:%1 + + + + File is not executable: %1 + 文件不可执行:%1 + + + + Failed to start executable: %1 + 启动可执行文件失败:%1 + + + + ServicesWidget + + + Search: + 搜索: + + + + Filter services… + 筛选服务… + + + + systemd required + 需要 systemd + + + + Services: 0 + 服务:0 + + + + systemd required (%1) + 需要 systemd (%1) + + + + + Services unavailable + 服务不可用 + + + + Failed to query services: %1 + 查询服务失败:%1 + + + + Services: %1 + 服务:%1 + + + + Copy + 复制 + + + + Entire row + 整行 + + + + Selected cell + 所选单元格 + + + + Start + 启动 + + + + start + 启动 + + + + Stop + 停止 + + + + stop + 停止 + + + + Restart + 重启 + + + + restart + 重启 + + + + Reload + 重新加载 + + + + reload + 重新加载 + + + + Try Restart + 尝试重启 + + + + try restart + 尝试重启 + + + + Reload Or Restart + 重新加载或重启 + + + + reload or restart + 重新加载或重启 + + + + Service action failed + 服务操作失败 + + + + Failed to %1 service %2. + +%3 + 对服务 %2 执行“%1”操作失败。 + +%3 + + + + SidePanelOrderDialog + + + Side Panel Order + 侧面板顺序 + + + + Change the order of item groups in the Performance side panel. + 更改“性能”侧面板中项目组的排列顺序。 + + + + Move Up + 上移 + + + + Move Down + 下移 + + + + SwapDetailWidget + + + font-size: 18pt; font-weight: bold; + font-size: 18pt; font-weight: bold; + + + + Swap + 交换空间 + + + + font-size: 11pt; + font-size: 11pt; + + + + + + 0 GB + 0 GB + + + + Swap usage + 交换空间使用量 + + + + 0% + 0% + + + + + 60 seconds + 60 秒 + + + + + 0 + 0 + + + + Swap activity + 交换活动 + + + + + + 0 KB/s + 0 KB/s + + + + In use + 使用中 + + + + Free + 空闲 + + + + + Swap in direction: disk -> RAM + 换入方向:磁盘 -> 内存 + + + + Swap in + 换入 + + + + + Swap out direction: RAM -> disk + 换出方向:内存 -> 磁盘 + + + + Swap out + 换出 + + + + UsersWidget + + + + User / Process + 用户 / 进程 + + + + + CPU + CPU + + + + + Memory + 内存 + + + + Logged in users: 0 + 已登录用户:0 + + + + Go to process + 转到进程 + + + + Logged in users: %1 + 已登录用户:%1 + + + diff --git a/src/ui/uihelper.cpp b/src/ui/uihelper.cpp index f649e45..5b86512 100644 --- a/src/ui/uihelper.cpp +++ b/src/ui/uihelper.cpp @@ -296,4 +296,4 @@ void UIHelper::EnableGraphContextMenu(QWidget *widget) AddGraphContextMenuItems(&menu, widget); menu.exec(widget->mapToGlobal(pos)); }); -} \ No newline at end of file +}