@@ -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
267267void 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 ' ) {
0 commit comments