Skip to content

Commit

Permalink
Refresh translation text in About window when locale is changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
zwpwjwtz committed Sep 22, 2018
1 parent 69a4eb9 commit 8897d10
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 54 deletions.
4 changes: 2 additions & 2 deletions SuperPanda.pro
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ TARGET = SuperPanda
TEMPLATE = app

VER_MAJ = 1
VER_MIN = 0
VER_MIN = 1
VER_PAT = 0
VERSION = 1.0.0
VERSION = 1.1.0

# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked as deprecated (the exact warnings
Expand Down
30 changes: 17 additions & 13 deletions Translations/SuperPanda_fr_FR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@
<translation>Auteur</translation>
</message>
<message>
<location filename="../aboutwindow.ui" line="126"/>
<source>Ver</source>
<translation>Ver</translation>
<translation type="vanished">Ver</translation>
</message>
<message>
<location filename="../aboutwindow.cpp" line="12"/>
<location filename="../aboutwindow.cpp" line="23"/>
<source>Ver: %1</source>
<translation>Ver: %1</translation>
</message>
<message>
<location filename="../aboutwindow.cpp" line="24"/>
<source>Super Panda - Toolkit for tweaking Linux system

This program is a free software.
Expand All @@ -43,7 +47,7 @@ Vous pouvez le redistribuer ou le modifier suivant les termes de la GNU General
Ce programme est distribué dans l’espoir qu’il sera utile, mais SANS AUCUNE GARANTIE : sans même la garantie implicite de COMMERCIALISABILITÉ, ni d’ADÉQUATION À UN OBJECTIF PARTICULIER. Consultez la GNU General Public License pour plus de détail.</translation>
</message>
<message>
<location filename="../aboutwindow.cpp" line="22"/>
<location filename="../aboutwindow.cpp" line="34"/>
<source>&lt;p&gt;Project Home: &lt;a href=&quot;https://github.com/zwpwjwtz/SuperPanda&quot;&gt;Github&lt;/a&gt;&lt;p align=&quot;center&quot;&gt;Feel free to report bugs and give suggestions!&lt;/p&gt;</source>
<translation>&lt;p&gt;Page d&apos;accueil du projet : &lt;a href=&quot;https://github.com/zwpwjwtz/SuperPanda&quot;&gt;Github&lt;/a&gt;&lt;p align=&quot;center&quot;&gt;N&apos;hésitez pas à signaler les bugs et à donner des suggestions!&lt;/p&gt;</translation>
</message>
Expand Down Expand Up @@ -340,7 +344,7 @@ Assurez-vous que vous avez le droit de l&apos;accéder.</translation>
<message>
<location filename="../Components/magickonfug.ui" line="619"/>
<source>Set screen scaling factors:</source>
<translation type="unfinished">Facteur de mise à l&apos;échelle :</translation>
<translation>Facteur de mise à l&apos;échelle :</translation>
</message>
<message>
<location filename="../Components/magickonfug.ui" line="635"/>
Expand All @@ -350,7 +354,7 @@ Assurez-vous que vous avez le droit de l&apos;accéder.</translation>
<message>
<location filename="../Components/magickonfug.ui" line="689"/>
<source>Window text:</source>
<translation type="unfinished">Texte :</translation>
<translation>Texte :</translation>
</message>
<message>
<location filename="../Components/magickonfug.ui" line="708"/>
Expand Down Expand Up @@ -386,37 +390,37 @@ See About page of SuperPanda for more details.</source>
Consultez le page « À propos de SuperPanda » pour plus de détails.</translation>
</message>
<message>
<location filename="../Components/magickonfug.cpp" line="527"/>
<location filename="../Components/magickonfug.cpp" line="530"/>
<source>Not supported on your system.</source>
<translation>Non supporté par le système.</translation>
</message>
<message>
<location filename="../Components/magickonfug.cpp" line="538"/>
<location filename="../Components/magickonfug.cpp" line="541"/>
<source>Environment Variable Editor</source>
<translation>Éditeur de l&apos;Environnement</translation>
</message>
<message>
<location filename="../Components/magickonfug.cpp" line="547"/>
<location filename="../Components/magickonfug.cpp" line="550"/>
<source>System Environment</source>
<translation>l&apos;environnement du système</translation>
</message>
<message>
<location filename="../Components/magickonfug.cpp" line="552"/>
<location filename="../Components/magickonfug.cpp" line="555"/>
<source>User Environment</source>
<translation>l&apos;environnement de l&apos;utilisateur</translation>
</message>
<message>
<location filename="../Components/magickonfug.cpp" line="569"/>
<location filename="../Components/magickonfug.cpp" line="572"/>
<source>Processing configuration, please wait...</source>
<translation>Configuration du traitement, veuillez patienter ...</translation>
</message>
<message>
<location filename="../Components/magickonfug.cpp" line="717"/>
<location filename="../Components/magickonfug.cpp" line="729"/>
<source>Configuration(s) applied</source>
<translation>Configuration(s) appliquée(s)</translation>
</message>
<message>
<location filename="../Components/magickonfug.cpp" line="718"/>
<location filename="../Components/magickonfug.cpp" line="730"/>
<source>Finish applying configuration. You may need to reboot to have them take effect.</source>
<translation>Nous avons finis les configurations. Veuillez redémarrer pour les activer.</translation>
</message>
Expand Down
26 changes: 15 additions & 11 deletions Translations/SuperPanda_zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@
<translation>作者</translation>
</message>
<message>
<location filename="../aboutwindow.ui" line="126"/>
<source>Ver</source>
<translation>版本</translation>
<translation type="vanished">版本</translation>
</message>
<message>
<location filename="../aboutwindow.cpp" line="12"/>
<location filename="../aboutwindow.cpp" line="23"/>
<source>Ver: %1</source>
<translation type="unfinished">版本: %1</translation>
</message>
<message>
<location filename="../aboutwindow.cpp" line="24"/>
<source>Super Panda - Toolkit for tweaking Linux system

This program is a free software.
Expand All @@ -43,7 +47,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
发布这一程序的目的是希望它能有用,但作者对此不做任何保证。作者也不保证本程序的经济价值,或特定场景下的适用性。请参见GNU通用公共许可证(GPL)的文本以便详细了解相关条款。</translation>
</message>
<message>
<location filename="../aboutwindow.cpp" line="22"/>
<location filename="../aboutwindow.cpp" line="34"/>
<source>&lt;p&gt;Project Home: &lt;a href=&quot;https://github.com/zwpwjwtz/SuperPanda&quot;&gt;Github&lt;/a&gt;&lt;p align=&quot;center&quot;&gt;Feel free to report bugs and give suggestions!&lt;/p&gt;</source>
<translation>&lt;p&gt;项目主页:&lt;a href=&quot;https://github.com/zwpwjwtz/SuperPanda&quot;&gt;Github&lt;/a&gt;&lt;p align=&quot;center&quot;&gt;欢迎报告软件错误、反馈意见/建议!&lt;/p&gt;</translation>
</message>
Expand Down Expand Up @@ -387,37 +391,37 @@ See About page of SuperPanda for more details.</source>
请查看 SuperPanda 的“关于”页面以了解更多信息。</translation>
</message>
<message>
<location filename="../Components/magickonfug.cpp" line="527"/>
<location filename="../Components/magickonfug.cpp" line="530"/>
<source>Not supported on your system.</source>
<translation>抱歉,您的系统不支持此功能。</translation>
</message>
<message>
<location filename="../Components/magickonfug.cpp" line="538"/>
<location filename="../Components/magickonfug.cpp" line="541"/>
<source>Environment Variable Editor</source>
<translation>环境变量编辑器</translation>
</message>
<message>
<location filename="../Components/magickonfug.cpp" line="547"/>
<location filename="../Components/magickonfug.cpp" line="550"/>
<source>System Environment</source>
<translation>系统环境变量</translation>
</message>
<message>
<location filename="../Components/magickonfug.cpp" line="552"/>
<location filename="../Components/magickonfug.cpp" line="555"/>
<source>User Environment</source>
<translation>用户环境变量</translation>
</message>
<message>
<location filename="../Components/magickonfug.cpp" line="569"/>
<location filename="../Components/magickonfug.cpp" line="572"/>
<source>Processing configuration, please wait...</source>
<translation>正在应用配置,请稍后……</translation>
</message>
<message>
<location filename="../Components/magickonfug.cpp" line="717"/>
<location filename="../Components/magickonfug.cpp" line="729"/>
<source>Configuration(s) applied</source>
<translation>您的更改已保存</translation>
</message>
<message>
<location filename="../Components/magickonfug.cpp" line="718"/>
<location filename="../Components/magickonfug.cpp" line="730"/>
<source>Finish applying configuration. You may need to reboot to have them take effect.</source>
<translation>已保存配置。您可能需要重启电脑以使更改生效。</translation>
</message>
Expand Down
26 changes: 15 additions & 11 deletions Translations/SuperPanda_zh_TW.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@
<translation>作者</translation>
</message>
<message>
<location filename="../aboutwindow.ui" line="126"/>
<source>Ver</source>
<translation>版本</translation>
<translation type="vanished">版本</translation>
</message>
<message>
<location filename="../aboutwindow.cpp" line="12"/>
<location filename="../aboutwindow.cpp" line="23"/>
<source>Ver: %1</source>
<translation type="unfinished">版本: %1</translation>
</message>
<message>
<location filename="../aboutwindow.cpp" line="24"/>
<source>Super Panda - Toolkit for tweaking Linux system

This program is a free software.
Expand All @@ -43,7 +47,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
我們希望發佈的這款程式有用,但不保證,甚至不保證它有經濟價值和適合特定用途。詳情參見GNU通用公共授權合約。</translation>
</message>
<message>
<location filename="../aboutwindow.cpp" line="22"/>
<location filename="../aboutwindow.cpp" line="34"/>
<source>&lt;p&gt;Project Home: &lt;a href=&quot;https://github.com/zwpwjwtz/SuperPanda&quot;&gt;Github&lt;/a&gt;&lt;p align=&quot;center&quot;&gt;Feel free to report bugs and give suggestions!&lt;/p&gt;</source>
<translation>&lt;p&gt;項目主頁:&lt;a href=&quot;https://github.com/zwpwjwtz/SuperPanda&quot;&gt;Github&lt;/a&gt;&lt;p align=&quot;center&quot;&gt;歡迎舉報錯誤並提出建議!&lt;/p&gt;</translation>
</message>
Expand Down Expand Up @@ -387,37 +391,37 @@ See About page of SuperPanda for more details.</source>
更多詳細信息,請參閱“超級熊貓”的關於頁面。</translation>
</message>
<message>
<location filename="../Components/magickonfug.cpp" line="527"/>
<location filename="../Components/magickonfug.cpp" line="530"/>
<source>Not supported on your system.</source>
<translation>此功能在您的系統上不受支持。</translation>
</message>
<message>
<location filename="../Components/magickonfug.cpp" line="538"/>
<location filename="../Components/magickonfug.cpp" line="541"/>
<source>Environment Variable Editor</source>
<translation>環境變數編輯器</translation>
</message>
<message>
<location filename="../Components/magickonfug.cpp" line="547"/>
<location filename="../Components/magickonfug.cpp" line="550"/>
<source>System Environment</source>
<translation>系統環境變數</translation>
</message>
<message>
<location filename="../Components/magickonfug.cpp" line="552"/>
<location filename="../Components/magickonfug.cpp" line="555"/>
<source>User Environment</source>
<translation>用戶環境變數</translation>
</message>
<message>
<location filename="../Components/magickonfug.cpp" line="569"/>
<location filename="../Components/magickonfug.cpp" line="572"/>
<source>Processing configuration, please wait...</source>
<translation>正在應用配置,請稍後......</translation>
</message>
<message>
<location filename="../Components/magickonfug.cpp" line="717"/>
<location filename="../Components/magickonfug.cpp" line="729"/>
<source>Configuration(s) applied</source>
<translation>配置已應用</translation>
</message>
<message>
<location filename="../Components/magickonfug.cpp" line="718"/>
<location filename="../Components/magickonfug.cpp" line="730"/>
<source>Finish applying configuration. You may need to reboot to have them take effect.</source>
<translation>已應用配置。您可能需要重新啟動以使其生效。</translation>
</message>
Expand Down
25 changes: 13 additions & 12 deletions aboutwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,19 @@ AboutWindow::AboutWindow(QWidget *parent) :
{
ui->setupUi(this);
setFixedSize(width(), height());
ui->labelVersion->setText(QString("Ver: ").append(APP_VERSION));
}

AboutWindow::~AboutWindow()
{
delete ui;
}

void AboutWindow::changeEvent(QEvent* event)
{
if (event->type() == QEvent::LanguageChange)
ui->retranslateUi(this);

ui->labelVersion->setText(QString(tr("Ver: %1")).arg(APP_VERSION));
ui->textAbout->setText(tr("Super Panda - Toolkit for tweaking Linux system\n\n"
"This program is a free software.\n\n"
"You can redistribute it and/or modify it under the terms of "
Expand All @@ -22,14 +34,3 @@ AboutWindow::AboutWindow(QWidget *parent) :
ui->labelContact->setText(tr("<p>Project Home: <a href=\"https://github.com/zwpwjwtz/SuperPanda\">Github</a>"
"<p align=\"center\">Feel free to report bugs and give suggestions!</p>"));
}

AboutWindow::~AboutWindow()
{
delete ui;
}

void AboutWindow::changeEvent(QEvent* event)
{
if (event->type() == QEvent::LanguageChange)
ui->retranslateUi(this);
}
13 changes: 8 additions & 5 deletions aboutwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<rect>
<x>60</x>
<y>0</y>
<width>241</width>
<width>231</width>
<height>51</height>
</rect>
</property>
Expand All @@ -68,7 +68,7 @@
</rect>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
Expand Down Expand Up @@ -116,14 +116,17 @@
<widget class="QLabel" name="labelVersion">
<property name="geometry">
<rect>
<x>300</x>
<x>290</x>
<y>20</y>
<width>91</width>
<width>101</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Ver</string>
<string/>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</widget>
Expand Down

0 comments on commit 8897d10

Please sign in to comment.