Skip to content

Commit abb839d

Browse files
committed
Update translation
1 parent b84022a commit abb839d

6 files changed

Lines changed: 200 additions & 51 deletions

File tree

omodsim/controls/addressbasecombobox.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <QEvent>
12
#include "addressbasecombobox.h"
23

34
///
@@ -13,6 +14,32 @@ AddressBaseComboBox::AddressBaseComboBox(QWidget* parent)
1314
connect(this, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &AddressBaseComboBox::on_currentIndexChanged);
1415
}
1516

17+
///
18+
/// \brief AddressBaseComboBox::changeEvent
19+
/// \param event
20+
///
21+
void AddressBaseComboBox::changeEvent(QEvent* event)
22+
{
23+
if (event->type() == QEvent::LanguageChange)
24+
{
25+
for(int i = 0; i < count(); i++)
26+
{
27+
switch(itemData(i).value<AddressBase>())
28+
{
29+
case AddressBase::Base0:
30+
setItemText(i, tr("0-based"));
31+
break;
32+
33+
case AddressBase::Base1:
34+
setItemText(i, tr("1-based"));
35+
break;
36+
}
37+
}
38+
}
39+
40+
QComboBox::changeEvent(event);
41+
}
42+
1643
///
1744
/// \brief AddressBaseComboBox::currentAddressBase
1845
/// \return

omodsim/controls/addressbasecombobox.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ class AddressBaseComboBox : public QComboBox
1919
signals:
2020
void addressBaseChanged(AddressBase base);
2121

22+
protected:
23+
void changeEvent(QEvent* event) override;
24+
2225
private slots:
2326
void on_currentIndexChanged(int);
2427
};

omodsim/docs/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ <h1 id="register">Register</h1>
798798
<div class="section-content">
799799
<p>The <strong><code>Register</code></strong> is a enum object that contains modbus register types.</p>
800800
</div>
801-
<section aria-labelledby="static_properties"><h2 id="">Enum constants </h2><div class="section-content"><dl>
801+
<section aria-labelledby="static_properties"><h2 id="">Enum constants</h2><div class="section-content"><dl>
802802
<dt id="register.discreteinputs"><code>Register.DiscreteInputs</code></dt>
803803
<dd>
804804
<p>Describes the modbus Discrete Input (0x) flags.</p>
@@ -824,7 +824,7 @@ <h1 id="addressbase">AddressBase</h1>
824824
<div class="section-content">
825825
<p>The <strong><code>AddressBase</code></strong> is a enum object that contains values that describes from what value the modbus address space starts (zero or one).</p>
826826
</div>
827-
<section aria-labelledby="static_properties"><h2 id="">Enum constants </h2><div class="section-content"><dl>
827+
<section aria-labelledby="static_properties"><h2 id="">Enum constants</h2><div class="section-content"><dl>
828828
<dt id="addressbase.base0"><code>AddressBase.Base0</code></dt>
829829
<dd>
830830
<p>This value means that the modbus address space starts from zero (0-based).</p>

omodsim/docs/index_ru.html

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,20 @@ <h1 class="title">Справка по JavaScript</h1>
167167
<li><a href="#storage.removeitem">Storage.removeItem</a></li>
168168
</ul>
169169
</li>
170+
<li class="object"><a href="#register"><strong>Register</strong></a>
171+
<ul class="level2">
172+
<li><a href="#register.discreteinputs">Register.DiscreteInputs</a></li>
173+
<li><a href="#register.coils">Register.Coils</a></li>
174+
<li><a href="#register.input">Register.Input</a></li>
175+
<li><a href="#register.holding">Register.Holding</a></li>
176+
</ul>
177+
</li>
178+
<li class="object"><a href="#addressbase"><strong>AddressBase</strong></a>
179+
<ul class="level2">
180+
<li><a href="#addressbase.base0">AddressBase.Base0</a></li>
181+
<li><a href="#addressbase.base1">AddressBase.Base1</a></li>
182+
</ul>
183+
</li>
170184
</ul>
171185
<article class="article-content">
172186
<div class="article-header">
@@ -777,7 +791,50 @@ <h1 id="storage">Storage</h1>
777791
</dd>
778792
</dl></div></section>
779793
</article>
780-
794+
<article class="article-content">
795+
<div class="article-header">
796+
<h1 id="register">Register</h1>
797+
</div>
798+
<div class="section-content">
799+
<p><strong><code>Register</code></strong>— это объект перечисления, содержащий типы регистров Modbus.</p>
800+
</div>
801+
<section aria-labelledby="static_properties"><h2 id="">Константы перечисления</h2><div class="section-content"><dl>
802+
<dt id="register.discreteinputs"><code>Register.DiscreteInputs</code></dt>
803+
<dd>
804+
<p>Описывает флаги Modbus DiscreteInputs (0x).</p>
805+
</dd>
806+
<dt id="register.coils"><code>Register.Coils</code></dt>
807+
<dd>
808+
<p>Описывает флаги Modbus Coil (1x).</p>
809+
</dd>
810+
<dt id="register.input"><code>Register.Input</code></dt>
811+
<dd>
812+
<p>Описывает регистры Modbus Input (3x).</p>
813+
</dd>
814+
<dt id="register.holding"><code>Register.Holding</code></dt>
815+
<dd>
816+
<p>Описывает регистры Modbus Holding (4x).</p>
817+
</dd>
818+
</dl></div></section>
819+
</article>
820+
<article class="article-content">
821+
<div class="article-header">
822+
<h1 id="addressbase">AddressBase</h1>
823+
</div>
824+
<div class="section-content">
825+
<p><strong><code>AddressBase</code></strong> представляет собой объект перечисления, содержащий значения, описывающие, с какого значения начинается адресное пространство Modbus (ноль или единица).</p>
826+
</div>
827+
<section aria-labelledby="static_properties"><h2 id="">Константы перечисления</h2><div class="section-content"><dl>
828+
<dt id="addressbase.base0"><code>AddressBase.Base0</code></dt>
829+
<dd>
830+
<p>Это значение означает, что адресное пространство Modbus начинается с нуля.</p>
831+
</dd>
832+
<dt id="addressbase.base1"><code>AddressBase.Base1</code></dt>
833+
<dd>
834+
<p>Это значение означает, что адресное пространство Modbus начинается с единицы.</p>
835+
</dd>
836+
</dl></div></section>
837+
</article>
781838
</body>
782839

783840
</html>

omodsim/translations/omodsim_ru.qm

1004 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)