mirror of
https://gitee.com/eda-development/eda_fpga.git
synced 2025-08-14 01:32:27 +08:00
增加多语言
This commit is contained in:
@ -17,6 +17,8 @@ RC_ICONS = icon.ico
|
|||||||
# In order to do so, uncomment the following line.
|
# In order to do so, uncomment the following line.
|
||||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||||
|
TRANSLATIONS += English.ts\
|
||||||
|
Chinese.ts
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
about_dialog.cpp \
|
about_dialog.cpp \
|
||||||
|
@ -1110,3 +1110,23 @@ void MainWindow::on_actionAdd_to_popular_triggered()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::on_actionChinese_triggered()
|
||||||
|
{
|
||||||
|
QTranslator m;
|
||||||
|
QString currentPath = QCoreApplication::applicationDirPath();
|
||||||
|
m.load(currentPath+"/lang/Chinese.qm");
|
||||||
|
qApp->installTranslator(&m);
|
||||||
|
this->ui->retranslateUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::on_actionEnglish_triggered()
|
||||||
|
{
|
||||||
|
QString currentPath = QCoreApplication::applicationDirPath();
|
||||||
|
QTranslator m;
|
||||||
|
m.load(currentPath+"/lang/English.qm");
|
||||||
|
qApp->installTranslator(&m);
|
||||||
|
this->ui->retranslateUi(this);
|
||||||
|
}
|
||||||
|
@ -81,6 +81,10 @@ private slots:
|
|||||||
|
|
||||||
void on_actionAdd_to_popular_triggered();
|
void on_actionAdd_to_popular_triggered();
|
||||||
|
|
||||||
|
void on_actionChinese_triggered();
|
||||||
|
|
||||||
|
void on_actionEnglish_triggered();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="page">
|
<widget class="QWidget" name="page">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
@ -149,7 +149,7 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="label">
|
<attribute name="label">
|
||||||
<string>Page 1</string>
|
<string>Popular</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="toolbox_system">
|
<widget class="QWidget" name="toolbox_system">
|
||||||
@ -162,7 +162,7 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="label">
|
<attribute name="label">
|
||||||
<string>System</string>
|
<string>Examples</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<widget class="QListView" name="listView_left">
|
<widget class="QListView" name="listView_left">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
@ -377,9 +377,29 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
<addaction name="actionAbout"/>
|
<addaction name="actionAbout"/>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QMenu" name="menuTools">
|
||||||
|
<property name="title">
|
||||||
|
<string>Tools</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QMenu" name="menuPreferences">
|
||||||
|
<property name="title">
|
||||||
|
<string>Preferences</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QMenu" name="menuLanguage">
|
||||||
|
<property name="title">
|
||||||
|
<string>Language</string>
|
||||||
|
</property>
|
||||||
|
<addaction name="actionChinese"/>
|
||||||
|
<addaction name="actionEnglish"/>
|
||||||
|
</widget>
|
||||||
|
<addaction name="menuLanguage"/>
|
||||||
|
</widget>
|
||||||
|
<addaction name="menuPreferences"/>
|
||||||
|
</widget>
|
||||||
<addaction name="menuFile"/>
|
<addaction name="menuFile"/>
|
||||||
<addaction name="menuEdit"/>
|
<addaction name="menuEdit"/>
|
||||||
<addaction name="menuCode"/>
|
<addaction name="menuCode"/>
|
||||||
|
<addaction name="menuTools"/>
|
||||||
<addaction name="menuHelp"/>
|
<addaction name="menuHelp"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QStatusBar" name="statusbar"/>
|
<widget class="QStatusBar" name="statusbar"/>
|
||||||
@ -458,6 +478,16 @@ p, li { white-space: pre-wrap; }
|
|||||||
<string>Add to popular</string>
|
<string>Add to popular</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionChinese">
|
||||||
|
<property name="text">
|
||||||
|
<string>Chinese</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionEnglish">
|
||||||
|
<property name="text">
|
||||||
|
<string>English</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
Reference in New Issue
Block a user