Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/aboutdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDia
{
this->ui->setupUi(this);
this->ui->labelTitle->setText(QString::fromLatin1(TUX_MANAGER_PRODUCT_NAME));
this->ui->labelVersion->setText(tr("Version %1").arg(QString::fromLatin1(TUX_MANAGER_VERSION_STRING)));
this->ui->labelVersion->setText(tr("版本 %1").arg(QString::fromLatin1(TUX_MANAGER_VERSION_STRING)));
this->setFixedSize(this->size());
}

Expand Down
10 changes: 5 additions & 5 deletions src/aboutdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>About TuxManager</string>
<string>关于 TuxManager</string>
</property>
<widget class="QPushButton" name="closeButton">
<property name="geometry">
Expand All @@ -23,7 +23,7 @@
</rect>
</property>
<property name="text">
<string>Close</string>
<string>关闭</string>
</property>
<property name="icon">
<iconset theme="QIcon::ThemeIcon::WindowClose"/>
Expand Down Expand Up @@ -105,7 +105,7 @@
</font>
</property>
<property name="text">
<string>Version</string>
<string>版本</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
Expand All @@ -124,7 +124,7 @@
</rect>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Created by Petr Bena and &lt;a href=&quot;https://github.com/benapetr/TuxManager/graphs/contributors&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#8ab4f8;&quot;&gt;many other contributors&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;由 Petr Bena 和&lt;a href=&quot;https://github.com/benapetr/TuxManager/graphs/contributors&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#8ab4f8;&quot;&gt;许多其他贡献者&lt;/span&gt;&lt;/a&gt;共同创建&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::TextFormat::RichText</enum>
Expand Down Expand Up @@ -162,7 +162,7 @@
</font>
</property>
<property name="text">
<string>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.&lt;br&gt;&lt;br&gt;&lt;a href=&quot;https://github.com/benapetr/TuxManager&quot;&gt;https://github.com/benapetr/TuxManager&lt;/a&gt;&lt;br&gt;&lt;br&gt;License - GPL-3.0-or-later</string>
<string>基于 Qt6 构建的 Linux 任务管理器替代品,灵感来自 Windows 任务管理器,但功能更进一步——深入展示系统进程、性能指标、用户与服务。&lt;br&gt;&lt;br&gt;&lt;a href=&quot;https://github.com/benapetr/TuxManager&quot;&gt;https://github.com/benapetr/TuxManager&lt;/a&gt;&lt;br&gt;&lt;br&gt;许可证 - GPL-3.0-or-later</string>
</property>
<property name="textFormat">
<enum>Qt::TextFormat::RichText</enum>
Expand Down
4 changes: 2 additions & 2 deletions src/colorschemedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ ColorSchemeDialog::ColorSchemeDialog(QWidget *parent) : QDialog(parent), ui(new
preview->setFrameShape(QFrame::StyledPanel);
preview->setFixedSize(36, 20);

auto *pick = new QPushButton(tr("Choose"), rowHost);
auto *reset = new QPushButton(tr("Reset"), rowHost);
auto *pick = new QPushButton(tr("选择"), rowHost);
auto *reset = new QPushButton(tr("重置"), rowHost);

rowLayout->addWidget(preview);
rowLayout->addWidget(pick);
Expand Down
6 changes: 3 additions & 3 deletions src/colorschemedialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Customize Colors</string>
<string>自定义颜色</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
Expand All @@ -29,14 +29,14 @@
<item>
<widget class="QCheckBox" name="customCheck">
<property name="text">
<string>Use custom colors</string>
<string>使用自定义颜色</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="hintLabel">
<property name="text">
<string>When disabled, the default light or dark palette is used automatically.</string>
<string>禁用时将自动使用默认的浅色或深色配色方案。</string>
</property>
<property name="wordWrap">
<bool>true</bool>
Expand Down
2 changes: 1 addition & 1 deletion src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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("(超级用户)"));
}

this->ui->processesLayout->addWidget(this->m_processesWidget);
Expand Down
8 changes: 4 additions & 4 deletions src/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</property>
<widget class="QWidget" name="processesTab">
<attribute name="title">
<string>Processes</string>
<string>进程</string>
</attribute>
<layout class="QVBoxLayout" name="processesLayout">
<property name="leftMargin">
Expand All @@ -53,7 +53,7 @@
</widget>
<widget class="QWidget" name="performanceTab">
<attribute name="title">
<string>Performance</string>
<string>性能</string>
</attribute>
<layout class="QVBoxLayout" name="performanceLayout">
<property name="leftMargin">
Expand All @@ -72,7 +72,7 @@
</widget>
<widget class="QWidget" name="usersTab">
<attribute name="title">
<string>Users</string>
<string>用户</string>
</attribute>
<layout class="QVBoxLayout" name="usersLayout">
<property name="leftMargin">
Expand All @@ -91,7 +91,7 @@
</widget>
<widget class="QWidget" name="servicesTab">
<attribute name="title">
<string>Services</string>
<string>服务</string>
</attribute>
<layout class="QVBoxLayout" name="servicesLayout">
<property name="leftMargin">
Expand Down
10 changes: 5 additions & 5 deletions src/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ QString Misc::SimplifyTime(int secs)
if (secs > 0 && (secs % 3600) == 0)
{
const int hours = secs / 3600;
return QString::number(hours) + ((hours == 1) ? " hour" : " hours");
return QString::number(hours) + QObject::tr(" 小时");
}

if (secs > 0 && (secs % 60) == 0)
{
const int minutes = secs / 60;
return QString::number(minutes) + ((minutes == 1) ? " minute" : " minutes");
return QString::number(minutes) + QObject::tr(" 分钟");
}

return QString::number(secs) + ((secs == 1) ? " second" : " seconds");
return QString::number(secs) + QObject::tr(" 秒");
}

QString Misc::SimplifyTimeMS(int ms)
Expand All @@ -51,9 +51,9 @@ QString Misc::SimplifyTimeMS(int ms)
ms = 0;

if (ms > 0 && (ms % 1000) == 0)
return QString::number(ms / 1000) + " s";
return QString::number(ms / 1000) + QObject::tr(" 秒");

return QString::number(ms) + " ms";
return QString::number(ms) + QObject::tr(" 毫秒");
}

QString Misc::FormatBytesPerSecond(double bytesPerSec)
Expand Down
16 changes: 8 additions & 8 deletions src/os/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,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 "运行中";
case 'S': return "睡眠中";
case 'D': return "磁盘睡眠";
case 'Z': return "僵尸";
case 'T': return "已停止";
case 't': return "跟踪停止";
case 'I': return "空闲";
case 'X': return "已结束";
default: return QString(state);
}
}
Expand Down
28 changes: 14 additions & 14 deletions src/os/processmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ QVariant ProcessModel::data(const QModelIndex &index, int role) const
case ColIoReadsPerSec:
if (proc.IOPermissionDenied)
return QString("?");
return proc.IORatesAvailable ? Misc::FormatBytesPerSecond(proc.IOReadBps) : tr("measuring...");
return proc.IORatesAvailable ? Misc::FormatBytesPerSecond(proc.IOReadBps) : tr("测量中...");
case ColIoWritesPerSec:
if (proc.IOPermissionDenied)
return QString("?");
return proc.IORatesAvailable ? Misc::FormatBytesPerSecond(proc.IOWriteBps) : tr("measuring...");
return proc.IORatesAvailable ? Misc::FormatBytesPerSecond(proc.IOWriteBps) : tr("测量中...");
case ColThreads: return proc.Threads;
case ColPriority: return proc.Priority;
case ColNice: return proc.Nice;
Expand Down Expand Up @@ -403,20 +403,20 @@ QString ProcessModel::columnHeader(Column col)
switch (col)
{
case ColPid: return "PID";
case ColName: return "Name";
case ColUser: return "User";
case ColState: return "State";
case ColName: return "名称";
case ColUser: return "用户";
case ColState: return "状态";
case ColCpu: return "CPU %";
case ColMemRss: return "MEM RES";
case ColMemVirt: return "MEM VIRT";
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 ColMemRss: return "常驻内存";
case ColMemVirt: return "虚拟内存";
case ColIoReads: return "IO 读取";
case ColIoWrites: return "IO 写入";
case ColIoReadsPerSec: return "IO 读取/秒";
case ColIoWritesPerSec:return "IO 写入/秒";
case ColThreads: return "线程";
case ColPriority: return "优先级";
case ColNice: return "Nice";
case ColCmdline: return "Command";
case ColCmdline: return "命令";
default: return {};
}
}
28 changes: 14 additions & 14 deletions src/os/processtreemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ QVariant ProcessTreeModel::data(const QModelIndex &index, int role) const
case ColIoReadsPerSec:
if (proc.IOPermissionDenied)
return QString("?");
return proc.IORatesAvailable ? Misc::FormatBytesPerSecond(proc.IOReadBps) : tr("measuring...");
return proc.IORatesAvailable ? Misc::FormatBytesPerSecond(proc.IOReadBps) : tr("测量中...");
case ColIoWritesPerSec:
if (proc.IOPermissionDenied)
return QString("?");
return proc.IORatesAvailable ? Misc::FormatBytesPerSecond(proc.IOWriteBps) : tr("measuring...");
return proc.IORatesAvailable ? Misc::FormatBytesPerSecond(proc.IOWriteBps) : tr("测量中...");
case ColThreads: return proc.Threads;
case ColPriority: return proc.Priority;
case ColNice: return proc.Nice;
Expand Down Expand Up @@ -230,20 +230,20 @@ QString ProcessTreeModel::columnHeader(Column col)
switch (col)
{
case ColPid: return "PID";
case ColName: return "Name";
case ColUser: return "User";
case ColState: return "State";
case ColName: return "名称";
case ColUser: return "用户";
case ColState: return "状态";
case ColCpu: return "CPU %";
case ColMemRss: return "MEM RES";
case ColMemVirt: return "MEM VIRT";
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 ColMemRss: return "常驻内存";
case ColMemVirt: return "虚拟内存";
case ColIoReads: return "IO 读取";
case ColIoWrites: return "IO 写入";
case ColIoReadsPerSec: return "IO 读取/秒";
case ColIoWritesPerSec:return "IO 写入/秒";
case ColThreads: return "线程";
case ColPriority: return "优先级";
case ColNice: return "Nice";
case ColCmdline: return "Command";
case ColCmdline: return "命令";
default: return {};
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/os/service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ QList<Service> Service::LoadAll(QString *error)
{
if (error)
*error = stderrText.isEmpty()
? QObject::tr("Unable to query services via sd-bus or systemctl")
? QObject::tr("无法通过 sd-bus 或 systemctl 查询服务")
: stderrText;
return out;
}
Expand Down
Loading