Skip to content

Commit e07838d

Browse files
committed
Translate some Czech comments
1 parent fb5a721 commit e07838d

4 files changed

Lines changed: 39 additions & 39 deletions

File tree

src/customwidgets/myelidedcombobox.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ MyElidedComboBox::MyElidedComboBox(QWidget* parent) : QComboBox(parent) {
2222
void MyElidedComboBox::paintEvent(QPaintEvent* event) {
2323
Q_UNUSED(event)
2424

25-
// Pokud je text delší než pole, je oříznut a zakončen třemi tečkami
25+
// If the text is longer than the field, it is truncated and ended with three dots
2626

27-
// Kód je založen na tomto:
27+
// This code is based on:
2828
// https://stackoverflow.com/questions/41360618/qcombobox-elided-text-on-selected-item
2929

3030
QStyleOptionComboBox opt;

src/qml/ansiterminalmodel.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ void AnsiTerminalModel::printText(QByteArray bytes) {
219219
QApplication::beep();
220220
continue;
221221
}
222-
if (text.at(i) == '\t') { // Tabulátor posune kursor na další sloupec který je násobkem 8 (počítáno od 0)
222+
if (text.at(i) == '\t') { // Tab moves cursor to the next column that is a multiple of 8 (counted from 0)
223223
do
224224
moveCursorRelative(1, 0);
225225
while (cursorX % 8);
@@ -265,20 +265,20 @@ void AnsiTerminalModel::parseFontEscapeCode(QByteArray data) {
265265
}
266266

267267
void AnsiTerminalModel::parseEscapeCode(QByteArray data) {
268-
// Uložit pozici kursoru
268+
// Save cursor position
269269
if (data == "s") {
270270
cursorX_saved = cursorX;
271271
cursorY_saved = cursorY;
272272
}
273-
// Vrátit kursor na uloženou posici
273+
// Restore cursor to saved position
274274
else if (data == "u") {
275275
moveCursorAbsolute(cursorX_saved, cursorY_saved);
276276
}
277-
// Nastavení barev a stylů
277+
// Set colors and styles
278278
else if (data.right(1) == "m") {
279279
parseFontEscapeCode(data.left(data.length() - 1));
280280
}
281-
// Pohyb kursoru
281+
// Cursor movement
282282
else if (data.right(1) == "A" || data.right(1) == "B" || data.right(1) == "C" || data.right(1) == "D" || data.right(1) == "E" || data.right(1) == "F") {
283283
int value = 1;
284284
if (data.length() > 1) {
@@ -289,23 +289,23 @@ void AnsiTerminalModel::parseEscapeCode(QByteArray data) {
289289
return;
290290
}
291291
}
292-
if (data.right(1) == "A") // Nahoru
292+
if (data.right(1) == "A") // Up
293293
moveCursorRelative(0, -value);
294-
else if (data.right(1) == "B") // Dolů
294+
else if (data.right(1) == "B") // Down
295295
moveCursorRelative(0, value);
296-
else if (data.right(1) == "C") // Vpravo
296+
else if (data.right(1) == "C") // Right
297297
moveCursorRelative(value, 0);
298-
else if (data.right(1) == "D") // Vlevo
298+
else if (data.right(1) == "D") // Left
299299
moveCursorRelative(-value, 0);
300-
else if (data.right(1) == "E") // Řádek dolů
300+
else if (data.right(1) == "E") // Line down
301301
moveCursorAbsolute(0, cursorY + value);
302-
else if (data.right(1) == "F") // Řádek nahoru
302+
else if (data.right(1) == "F") // Line up
303303
moveCursorAbsolute(0, cursorY - value);
304-
else if (data.right(1) == "G") // Sloupec
304+
else if (data.right(1) == "G") // Column
305305
moveCursorAbsolute(value - 1, cursorY);
306306
}
307307

308-
// Posunout kursor na pozici (v příkazu se čísluje od 1)
308+
// Move cursor to position (command numbering starts at 1)
309309
else if (data.right(1) == "H" || data.right(1) == "f") {
310310
int n = 1;
311311
int m = 1;
@@ -338,27 +338,27 @@ void AnsiTerminalModel::parseEscapeCode(QByteArray data) {
338338
emit sendMessage(tr("Invalid escape sequence").toUtf8(), data, MessageLevel::error);
339339
}
340340

341-
// Vymazat od kursoru na konec všeho
341+
// Clear from cursor to the end
342342
else if (data == "0J" || data == "J") {
343343
clearLineRight();
344344
clearDown();
345345
}
346-
// Vymazet od kursoru po začátek všeho
346+
// Clear from cursor to the beginning
347347
else if (data == "1J") {
348348
clearLineLeft();
349349
clearUp();
350350
}
351-
// Vymazat všechno
351+
// Clear everything
352352
else if (data == "2J")
353353
clear();
354354

355-
// Vymazat od kursoru na konec řádku
355+
// Clear from cursor to end of line
356356
else if (data == "0K" || data == "K")
357357
clearLineRight();
358-
// Vymazet od kursoru po začátek řádku
358+
// Clear from cursor to start of line
359359
else if (data == "1K")
360360
clearLineLeft();
361-
// Vymazat řádek
361+
// Clear line
362362
else if (data == "2K")
363363
clearLine();
364364

@@ -426,7 +426,7 @@ bool AnsiTerminalModel::colorFromSequence(QByteArray code, QColor &clr) {
426426
return true;
427427
}
428428

429-
// Základní a rozšířené (16) barvy
429+
// Basic and extended (16) colors
430430
else if (colorCodes().contains(code)) {
431431
clr = colorCodes().value(code);
432432
return true;
@@ -456,7 +456,7 @@ void AnsiTerminalModel::printToTerminal(QByteArray data) {
456456
while (!buffer.isEmpty()) {
457457
if ((((uint8_t)buffer.at(buffer.length() - 1)) & 0b10000000) == 0b10000000) { // 1xxxxxxx
458458
if ((((uint8_t)buffer.at(buffer.length() - 1)) & 0b11000000) == 0b10000000) { // 10xxxxxx
459-
// Poslední znak je UTF-8, ale ne první bajt, je potřeba zjistit, jestli jde o poslední z bajtů (kompletní znak)
459+
// Last character is UTF-8 but not the first byte, need to check if it is the final byte of the character
460460
bool complete = false;
461461
if ((buffer.length() >= 2) && (((uint8_t)buffer.at(buffer.length() - 2)) & 0b11100000) == 0b11000000) // 110xxxxx 10xxxxxx
462462
complete = true;
@@ -470,7 +470,7 @@ void AnsiTerminalModel::printToTerminal(QByteArray data) {
470470
if (!complete)
471471
return;
472472
} else
473-
return; // Pozlední znak je začátek UTF-8 znaku, je potřeba počkat na zbytek
473+
return; // Last character is the start of a UTF-8 sequence, wait for the rest
474474
}
475475

476476
if (buffer.at(0) != '\u001b') {

src/utils.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ QString getChName(int chid) {
6464
}
6565

6666
int intLog10(double x) {
67-
if (qFuzzyIsNull(x)) // - nekonečno
67+
if (qFuzzyIsNull(x)) // minus infinity
6868
return -1000;
6969
if (qIsInf(x) || qIsInf(-x))
7070
return 100;
@@ -95,23 +95,23 @@ QString toSignificantDigits(double x, int prec, bool trimZeroes) {
9595
return zeroes;
9696
}
9797

98-
// Vlivem zaokrouhlní může hodnota být trochu menší než měla být,
99-
// například 1.000000 se může změnit na 0.99999999, proto je číslo mírně
100-
// zvětšeno, aby se zajistilo, že rád nevfijde o jedna mensí než měl být.
98+
// Due to rounding the value may be slightly lower than it should be,
99+
// for example 1.000000 can turn into 0.99999999, so the number is
100+
// slightly increased to ensure the exponent does not drop by one.
101101
int log10ofX = intLog10(x);
102102

103103
if (log10ofX >= prec - 1) {
104104
return QString::number((int)round(x));
105105
} else {
106-
// Převedu na text jako celé číslo
106+
// Convert to text as an integer
107107
QString result = QString::number((int)round(x * (pow(10, prec - log10ofX - 1))));
108108

109-
// Na příslušné místo vloží desetinnou tečku
109+
// Insert decimal point at the proper place
110110
int decimalPoint = result.length() - prec + log10ofX + 1;
111111
if (decimalPoint > 0) {
112112
result.insert(decimalPoint, '.');
113113
if (trimZeroes) {
114-
// Odřízne nuly z desetinných míst
114+
// Trim trailing zeros in the decimal part
115115
for (int i = result.length() - 1; i >= decimalPoint; i--) {
116116
if (result.at(i) == '0' || result.at(i) == '.')
117117
result.remove(i, 1);
@@ -120,8 +120,8 @@ QString toSignificantDigits(double x, int prec, bool trimZeroes) {
120120
}
121121
}
122122
} else {
123-
// Pokud číslo nemá celou část, je před něj přidána nula s desettinou tečkou
124-
// Případně další nuly za tečkou
123+
// If there is no integer part, prepend zero with decimal point
124+
// and add zeros after the point if needed
125125
for (; decimalPoint < 0; decimalPoint++)
126126
result.push_front('0');
127127
result.push_front('.');

src/utils.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,20 +111,20 @@ double floorToNiceValue(double value);
111111

112112
int getAnalogChId(int number, ChannelType::enumChannelType type);
113113

114-
/// Skupina od 0, bit od 0, Vrátí chID
114+
/// Group from 0 and bit from 0, returns chID
115115
int getLogicChannelID(int group, int bit);
116116

117-
/// Chid od 0
117+
/// chid starting from 0
118118
QString getChName(int chid);
119119

120120
int intLog10(double x);
121121

122-
/// Nejbližší vyšší (nebo rovná) mocnina 2
122+
/// Nearest power of two that is greater or equal
123123
int nextPow2(int number);
124124

125-
/// Převede číslo na text s (prec) platnými ciframi
126-
/// TrimZeroes odstraní nuly na konci desetinych míst
127-
/// (např. namísto 1.200 zobrazí jako 1.2)
125+
/// Converts the number to text with (prec) significant digits
126+
/// TrimZeroes removes zeros at the end of the decimal part
127+
/// (e.g. instead of 1.200 it shows 1.2)
128128
QString toSignificantDigits(double x, int prec, bool trimZeroes = false);
129129

130130
QString floatToNiceString(double d, int significantDigits, bool justify, bool justifyUnit, bool noDecimalsIfInteger = false, UnitOfMeasure unit = UnitOfMeasure(""));

0 commit comments

Comments
 (0)