diff --git a/lang/en_US.ts b/lang/en_US.ts
index 363baba..a4224b7 100644
--- a/lang/en_US.ts
+++ b/lang/en_US.ts
@@ -270,6 +270,7 @@
+
@@ -280,6 +281,7 @@
+
@@ -306,6 +308,21 @@ It could make the whole sector blocked irreversibly!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
MainWindow
diff --git a/lang/zh_CN.qm b/lang/zh_CN.qm
index 38b9a62..bf66fd3 100644
Binary files a/lang/zh_CN.qm and b/lang/zh_CN.qm differ
diff --git a/lang/zh_CN.ts b/lang/zh_CN.ts
index 072af7f..ebe5e59 100644
--- a/lang/zh_CN.ts
+++ b/lang/zh_CN.ts
@@ -271,6 +271,7 @@
+
密钥A
@@ -281,6 +282,7 @@
+
密钥B
@@ -310,6 +312,21 @@ It could make the whole sector blocked irreversibly!
有效
+
+
+
+
+
+
+
+
+ 块
+
+
+
+
+ 密钥A+B
+
MainWindow
diff --git a/main.cpp b/main.cpp
index 2e242b2..7ac5c30 100644
--- a/main.cpp
+++ b/main.cpp
@@ -9,6 +9,17 @@
int main(int argc, char *argv[])
{
+ // A trick to handle non-ascii path
+ // The application cannot find the plugins when the path contains non ascii characters.
+ // However, the plugins will be load after creating MainWindow(or QApplication?).
+ // QDir will handle the path correctly.
+ QDir* pluginDir = new QDir;
+ if(pluginDir->cd("plugins")) // has plugins folder
+ {
+ qputenv("QT_PLUGIN_PATH", pluginDir->absolutePath().toLocal8Bit());
+ }
+ delete pluginDir;
+
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
QDir *langPath = new QDir();
diff --git a/ui/mf_trailerdecoderdialog.cpp b/ui/mf_trailerdecoderdialog.cpp
index d4c5092..9e9f8bc 100644
--- a/ui/mf_trailerdecoderdialog.cpp
+++ b/ui/mf_trailerdecoderdialog.cpp
@@ -85,15 +85,15 @@ void MF_trailerDecoderDialog::on_blockSizeChanged(int id, bool st)
{
if(id == 4)
{
- ui->dataBlockWidget->verticalHeaderItem(0)->setText("Block0");
- ui->dataBlockWidget->verticalHeaderItem(1)->setText("Block1");
- ui->dataBlockWidget->verticalHeaderItem(2)->setText("Block2");
+ ui->dataBlockWidget->verticalHeaderItem(0)->setText(tr("Block") + "0");
+ ui->dataBlockWidget->verticalHeaderItem(1)->setText(tr("Block") + "1");
+ ui->dataBlockWidget->verticalHeaderItem(2)->setText(tr("Block") + "2");
}
else if(id == 16)
{
- ui->dataBlockWidget->verticalHeaderItem(0)->setText("Block0~4");
- ui->dataBlockWidget->verticalHeaderItem(1)->setText("Block5~9");
- ui->dataBlockWidget->verticalHeaderItem(2)->setText("Block10~14");
+ ui->dataBlockWidget->verticalHeaderItem(0)->setText(tr("Block") + "0~4");
+ ui->dataBlockWidget->verticalHeaderItem(1)->setText(tr("Block") + "5~9");
+ ui->dataBlockWidget->verticalHeaderItem(2)->setText(tr("Block") + "10~14");
}
}
@@ -110,15 +110,15 @@ void MF_trailerDecoderDialog::setTableItem(QTableWidget* widget, int row, int co
}
else if(accessType == Mifare::ACC_KEY_A)
{
- text = "KeyA";
+ text = tr("KeyA");
}
else if(accessType == Mifare::ACC_KEY_B)
{
- text = "KeyB";
+ text = tr("KeyB");
}
else if(accessType == Mifare::ACC_KEY_AB)
{
- text = "KeyA+B";
+ text = tr("KeyA+B");
}
widget->item(row, column)->setText(text);
}