Skip to content

Commit

Permalink
Added Belarusian translation
Browse files Browse the repository at this point in the history
  • Loading branch information
WiseLord committed Mar 12, 2018
1 parent a37ac89 commit 1f0352b
Show file tree
Hide file tree
Showing 6 changed files with 620 additions and 31 deletions.
3 changes: 2 additions & 1 deletion editor/editor.pro
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ RESOURCES += \
ts.qrc

TRANSLATIONS += \
ts/editor_ru.ts
ts/editor_ru.ts \
ts/editor_by.ts

tr.commands = lupdate \"$$_PRO_FILE_\" && lrelease \"$$_PRO_FILE_\"
commands = lupdate \"$$_PRO_FILE_\" && lrelease \"$$_PRO_FILE_\"
Expand Down
6 changes: 5 additions & 1 deletion editor/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ MainWindow::MainWindow(QWidget *parent) :

QString lang = settings.value(SETTINGS_GENERAL_LANGUAGE, "auto").toString();
actionLangAuto->setChecked(lang.compare("auto") == 0);
actionLangBelarusian->setChecked(lang.compare("by") == 0);
actionLangEnglish->setChecked(lang.compare("en") == 0);
actionLangRussian->setChecked(lang.compare("ru") == 0);

retranslate(lang);

QActionGroup* langGroup = new QActionGroup(this);
actionLangAuto->setActionGroup(langGroup);
actionLangBelarusian->setActionGroup(langGroup);
actionLangEnglish->setActionGroup(langGroup);
actionLangRussian->setActionGroup(langGroup);

Expand Down Expand Up @@ -474,7 +476,9 @@ void MainWindow::setLanguage()
{
QString lang;

if (actionLangEnglish->isChecked()) {
if (actionLangBelarusian->isChecked()) {
lang = "by";
} else if (actionLangEnglish->isChecked()) {
lang = "en";
} else if (actionLangRussian->isChecked()) {
lang = "ru";
Expand Down
33 changes: 29 additions & 4 deletions editor/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@
</property>
<widget class="QMenu" name="menuFile">
<property name="title">
<string>Fi&amp;le</string>
<string>&amp;File</string>
</property>
<addaction name="actionOpenEeprom"/>
<addaction name="actionSaveEeprom"/>
Expand All @@ -1127,16 +1127,17 @@
</widget>
<widget class="QMenu" name="menuHelp">
<property name="title">
<string>Help</string>
<string>&amp;Help</string>
</property>
<addaction name="actionAbout"/>
<addaction name="actionAboutQt"/>
</widget>
<widget class="QMenu" name="menuLang">
<property name="title">
<string>Language</string>
<string>&amp;Language</string>
</property>
<addaction name="actionLangAuto"/>
<addaction name="actionLangBelarusian"/>
<addaction name="actionLangEnglish"/>
<addaction name="actionLangRussian"/>
</widget>
Expand All @@ -1157,7 +1158,7 @@
</action>
<action name="actionSaveEepromAs">
<property name="text">
<string>Save &amp;eeprom binary as …</string>
<string>Save eeprom binary &amp;as …</string>
</property>
</action>
<action name="actionLoadDefaultEeprom">
Expand Down Expand Up @@ -1202,6 +1203,14 @@
<string>Russian</string>
</property>
</action>
<action name="actionLangBelarusian">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Belarusian</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
Expand Down Expand Up @@ -1741,6 +1750,22 @@
</hint>
</hints>
</connection>
<connection>
<sender>actionLangBelarusian</sender>
<signal>triggered()</signal>
<receiver>MainWindow</receiver>
<slot>setLanguage()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>429</x>
<y>299</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>openEeprom()</slot>
Expand Down
1 change: 1 addition & 0 deletions editor/ts.qrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<RCC>
<qresource prefix="/">
<file>ts/editor_ru.qm</file>
<file>ts/editor_by.qm</file>
</qresource>
</RCC>
Loading

0 comments on commit 1f0352b

Please sign in to comment.