Commit 552556a9 authored by Peter Zhigalov's avatar Peter Zhigalov

Добавил русскую локализацию в проект с Qt

parent 1da4b114
......@@ -38,7 +38,14 @@ HEADERS += \
FORMS += \
src_qt/mainwindow.ui
RESOURCES += resources/icon.qrc
TRANSLATIONS += \
src_qt/l10ns/fem_draw_qt_en.ts \
src_qt/l10ns/fem_draw_qt_ru.ts
RESOURCES += \
resources/icon.qrc \
src_qt/l10ns/l10ns.qrc
QMAKE_RESOURCE_FLAGS += -threshold 0 -compress 9
win32 {
......
This diff is collapsed.
This diff is collapsed.
<RCC>
<qresource prefix="/l10ns">
<file>fem_draw_qt_en.qm</file>
<file>fem_draw_qt_ru.qm</file>
</qresource>
</RCC>
#include "mainwindow.h"
#include <QMenu>
#include "Application.h"
#if defined (USE_STATIC_QJPEG)
......@@ -15,13 +14,12 @@ Q_IMPORT_PLUGIN(qico)
int main(int argc, char *argv[])
{
Application a(argc, argv);
a.setOrganizationDomain("fami.codefreak.ru");
a.setOrganizationName("FAMI Net Team");
a.setApplicationName("FEM Draw Qt");
a.setApplicationVersion("1.7");
MainWindow w;
#if defined (Q_OS_MAC)
void qt_mac_set_dock_menu(QMenu *menu);
QMenu dock_menu;
dock_menu.addAction("New Window", &w, SLOT(on_actionNew_Window_triggered()));
qt_mac_set_dock_menu(&dock_menu);
#endif
w.update_translations();
if(argc > 1)
{
string filename;
......
This diff is collapsed.
......@@ -38,6 +38,10 @@ public:
public slots:
// Открытие файла по имени
void open_file(const QString & filename);
// Функция для применения локализации
void update_translations(QString language = QString());
// Функция, устанавливающая меню в доке OS X
void update_dock_menu();
private slots:
// Событие при открытии файла
void on_actionOpen_Tecplot_File_triggered();
......@@ -68,6 +72,10 @@ private slots:
void on_actionVectors_Length_triggered();
// Событие при запросе конфигурации размера стрелок векторов
void on_actionArrowSize_triggered();
// Событие при включении английского языка
void on_actionEnglish_triggered();
// Событие при включении русского языка
void on_actionRussian_triggered();
// Событие при переключении рисования легенды
void on_actionShow_Legend_triggered();
// Событие при переключении использования светлых цветов
......
......@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
<string>FEM Draw</string>
</property>
<property name="windowIcon">
<iconset resource="../resources/icon.qrc">
......@@ -209,6 +209,14 @@
<property name="title">
<string>Configuration</string>
</property>
<widget class="QMenu" name="menuLanguage">
<property name="title">
<string>Language</string>
</property>
<addaction name="actionEnglish"/>
<addaction name="actionRussian"/>
</widget>
<addaction name="menuLanguage"/>
<addaction name="actionShow_Legend"/>
<addaction name="actionUse_Light_Colors"/>
<addaction name="actionUse_Purple_Colors"/>
......@@ -385,6 +393,22 @@
<string>Vectors Arrow Size...</string>
</property>
</action>
<action name="actionEnglish">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>English</string>
</property>
</action>
<action name="actionRussian">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Russian</string>
</property>
</action>
<action name="actionShow_Legend">
<property name="checkable">
<bool>true</bool>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment