forked from qt-creator/qt-creator
SerialTerminal: Tr::tr
Change-Id: Iac630d03a27eb1599485a9b8044d794fc66c7bb2 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -40762,7 +40762,7 @@ Gemning mislykkedes.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SerialTerminal::Internal::SerialControl</name>
|
||||
<name>::SerialTerminal</name>
|
||||
<message>
|
||||
<source>Unable to open port %1.</source>
|
||||
<translation>Kan ikke åbne porten %1.</translation>
|
||||
@@ -40791,9 +40791,6 @@ Gemning mislykkedes.</translation>
|
||||
<source>Serial port error: %1 (%2)</source>
|
||||
<translation>Fejl ved seriel port: %1 (%2)</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SerialTerminal::Internal::SerialOutputPane</name>
|
||||
<message>
|
||||
<source>Close Tab</source>
|
||||
<translation>Luk faneblad</translation>
|
||||
@@ -40830,9 +40827,6 @@ Gemning mislykkedes.</translation>
|
||||
<source>Add New Terminal</source>
|
||||
<translation>Tilføj ny terminal</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SerialTerminal::Internal::SerialTerminalOutputPane</name>
|
||||
<message>
|
||||
<source>Serial Terminal</source>
|
||||
<translation>Seriel terminal</translation>
|
||||
|
@@ -41571,7 +41571,7 @@ Was soll %1 tun?</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SerialTerminal::Internal::SerialControl</name>
|
||||
<name>::SerialTerminal</name>
|
||||
<message>
|
||||
<source>Unable to open port %1: %2.</source>
|
||||
<translation>Port %1 konnte nicht geöffnet werden: %2.</translation>
|
||||
@@ -41600,9 +41600,6 @@ Was soll %1 tun?</translation>
|
||||
<source>Serial port error: %1 (%2)</source>
|
||||
<translation>Fehler des seriellen Ports: %1 (%2)</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SerialTerminal::Internal::SerialOutputPane</name>
|
||||
<message>
|
||||
<source>Close Tab</source>
|
||||
<translation>Reiter schließen</translation>
|
||||
@@ -41639,9 +41636,6 @@ Was soll %1 tun?</translation>
|
||||
<source>Add New Terminal</source>
|
||||
<translation>Neues Terminal hinzufügen</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SerialTerminal::Internal::SerialTerminalOutputPane</name>
|
||||
<message>
|
||||
<source>Serial Terminal</source>
|
||||
<translation>Serielles Terminal</translation>
|
||||
|
@@ -33263,7 +33263,7 @@ Row: %4, Column: %5
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SerialTerminal::Internal::SerialControl</name>
|
||||
<name>::SerialTerminal</name>
|
||||
<message>
|
||||
<source>Unable to open port %1: %2.</source>
|
||||
<translation>Neuspjelo otvaranje priključka %1: %2.</translation>
|
||||
@@ -33292,9 +33292,6 @@ Row: %4, Column: %5
|
||||
<source>Serial port error: %1 (%2)</source>
|
||||
<translation>Greška u serijskom priključku: %1 (%2)</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SerialTerminal::Internal::SerialOutputPane</name>
|
||||
<message>
|
||||
<source>Close Tab</source>
|
||||
<translation>Zatvori karticu</translation>
|
||||
@@ -33331,9 +33328,6 @@ Row: %4, Column: %5
|
||||
<source>Add New Terminal</source>
|
||||
<translation>Dodaj novi terminal</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SerialTerminal::Internal::SerialTerminalOutputPane</name>
|
||||
<message>
|
||||
<source>Serial Terminal</source>
|
||||
<translation>Serijski terminal</translation>
|
||||
|
@@ -48466,7 +48466,7 @@ Row: %4, Column: %5
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SerialTerminal::Internal::SerialControl</name>
|
||||
<name>::SerialTerminal</name>
|
||||
<message>
|
||||
<source>Unable to open port %1: %2.</source>
|
||||
<translation>ポート %1 を開けませんでした: %2。</translation>
|
||||
@@ -48475,9 +48475,6 @@ Row: %4, Column: %5
|
||||
<source>Session resumed.</source>
|
||||
<translation>セッションが再開されました。</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SerialTerminal::Internal::SerialOutputPane</name>
|
||||
<message>
|
||||
<source>Close Tab</source>
|
||||
<translation>タブを閉じる</translation>
|
||||
|
@@ -42296,7 +42296,7 @@ Row: %4, Column: %5
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SerialTerminal::Internal::SerialControl</name>
|
||||
<name>::SerialTerminal</name>
|
||||
<message>
|
||||
<source>Unable to open port %1: %2.</source>
|
||||
<translation>Не удалось открыть порт %1: %2.</translation>
|
||||
@@ -42325,9 +42325,6 @@ Row: %4, Column: %5
|
||||
<source>Serial port error: %1 (%2)</source>
|
||||
<translation>Ошибка последовательного порта: %1 (%2)</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SerialTerminal::Internal::SerialOutputPane</name>
|
||||
<message>
|
||||
<source>Close Tab</source>
|
||||
<translation>Закрыть вкладку</translation>
|
||||
@@ -42364,9 +42361,6 @@ Row: %4, Column: %5
|
||||
<source>Add New Terminal</source>
|
||||
<translation>Добавить новый терминал</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SerialTerminal::Internal::SerialTerminalOutputPane</name>
|
||||
<message>
|
||||
<source>Serial Terminal</source>
|
||||
<translation>Последовательный терминал</translation>
|
||||
|
@@ -40666,7 +40666,7 @@ Row: %4, Column: %5
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SerialTerminal::Internal::SerialControl</name>
|
||||
<name>::SerialTerminal</name>
|
||||
<message>
|
||||
<source>Unable to open port %1: %2.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -40695,9 +40695,6 @@ Row: %4, Column: %5
|
||||
<source>Serial port error: %1 (%2)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SerialTerminal::Internal::SerialOutputPane</name>
|
||||
<message>
|
||||
<source>Close Tab</source>
|
||||
<translation type="unfinished">关闭标签</translation>
|
||||
@@ -40734,9 +40731,6 @@ Row: %4, Column: %5
|
||||
<source>Add New Terminal</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SerialTerminal::Internal::SerialTerminalOutputPane</name>
|
||||
<message>
|
||||
<source>Serial Terminal</source>
|
||||
<translation type="unfinished"></translation>
|
||||
|
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "serialcontrol.h"
|
||||
#include "serialterminalconstants.h"
|
||||
#include "serialterminaltr.h"
|
||||
|
||||
#include <utils/outputformatter.h>
|
||||
|
||||
@@ -42,7 +43,7 @@ bool SerialControl::start()
|
||||
|
||||
if (!m_serialPort.open(QIODevice::ReadWrite)) {
|
||||
if (!m_retrying) {
|
||||
appendMessage(tr("Unable to open port %1: %2.")
|
||||
appendMessage(Tr::tr("Unable to open port %1: %2.")
|
||||
.arg(portName(), m_serialPort.errorString()),
|
||||
Utils::ErrorMessageFormat);
|
||||
}
|
||||
@@ -53,9 +54,9 @@ bool SerialControl::start()
|
||||
m_serialPort.setRequestToSend(m_initialRtsState);
|
||||
|
||||
if (m_retrying)
|
||||
appendMessage(tr("Session resumed.") + QString("\n\n"), Utils::NormalMessageFormat);
|
||||
appendMessage(Tr::tr("Session resumed.") + QString("\n\n"), Utils::NormalMessageFormat);
|
||||
else
|
||||
appendMessage(tr("Starting new session on %1...").arg(portName()) + "\n", Utils::NormalMessageFormat);
|
||||
appendMessage(Tr::tr("Starting new session on %1...").arg(portName()) + "\n", Utils::NormalMessageFormat);
|
||||
|
||||
m_retrying = false;
|
||||
|
||||
@@ -80,7 +81,7 @@ void SerialControl::stop(bool force)
|
||||
// Print paused or finished message
|
||||
if (force || (m_running && !m_retrying)) {
|
||||
appendMessage(QString("\n")
|
||||
+ tr("Session finished on %1.").arg(portName())
|
||||
+ Tr::tr("Session finished on %1.").arg(portName())
|
||||
+ QString("\n\n"),
|
||||
Utils::NormalMessageFormat);
|
||||
|
||||
@@ -89,7 +90,7 @@ void SerialControl::stop(bool force)
|
||||
emit runningChanged(false);
|
||||
} else if (m_running && m_retrying) {
|
||||
appendMessage(QString("\n")
|
||||
+ tr("Session paused...")
|
||||
+ Tr::tr("Session paused...")
|
||||
+ QString("\n"),
|
||||
Utils::NormalMessageFormat);
|
||||
m_running = false;
|
||||
@@ -105,7 +106,7 @@ bool SerialControl::isRunning() const
|
||||
|
||||
QString SerialControl::displayName() const
|
||||
{
|
||||
return portName().isEmpty() ? tr("No Port") : portName();
|
||||
return portName().isEmpty() ? Tr::tr("No Port") : portName();
|
||||
}
|
||||
|
||||
bool SerialControl::canReUseOutputPane(const SerialControl *other) const
|
||||
@@ -190,7 +191,7 @@ void SerialControl::handleError(QSerialPort::SerialPortError error)
|
||||
|
||||
if (!m_retrying && error != QSerialPort::NoError)
|
||||
appendMessage(QString("\n")
|
||||
+ tr("Serial port error: %1 (%2)").arg(m_serialPort.errorString()).arg(error)
|
||||
+ Tr::tr("Serial port error: %1 (%2)").arg(m_serialPort.errorString()).arg(error)
|
||||
+ QString("\n"),
|
||||
Utils::ErrorMessageFormat);
|
||||
|
||||
|
@@ -6,6 +6,7 @@
|
||||
#include "consolelineedit.h"
|
||||
#include "serialcontrol.h"
|
||||
#include "serialterminalconstants.h"
|
||||
#include "serialterminaltr.h"
|
||||
|
||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
@@ -113,9 +114,9 @@ SerialOutputPane::SerialOutputPane(Settings &settings) :
|
||||
m_tabWidget(new TabWidget),
|
||||
m_settings(settings),
|
||||
m_devicesModel(new SerialDeviceModel),
|
||||
m_closeCurrentTabAction(new QAction(tr("Close Tab"), this)),
|
||||
m_closeAllTabsAction(new QAction(tr("Close All Tabs"), this)),
|
||||
m_closeOtherTabsAction(new QAction(tr("Close Other Tabs"), this))
|
||||
m_closeCurrentTabAction(new QAction(Tr::tr("Close Tab"), this)),
|
||||
m_closeAllTabsAction(new QAction(Tr::tr("Close All Tabs"), this)),
|
||||
m_closeOtherTabsAction(new QAction(Tr::tr("Close Other Tabs"), this))
|
||||
{
|
||||
createToolButtons();
|
||||
|
||||
@@ -138,7 +139,7 @@ SerialOutputPane::SerialOutputPane(Settings &settings) :
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->setSpacing(2);
|
||||
|
||||
m_inputLine->setPlaceholderText(tr("Type text and hit Enter to send."));
|
||||
m_inputLine->setPlaceholderText(Tr::tr("Type text and hit Enter to send."));
|
||||
inputLayout->addWidget(m_inputLine);
|
||||
|
||||
connect(m_inputLine, &QLineEdit::returnPressed, this, &SerialOutputPane::sendInput);
|
||||
@@ -173,7 +174,7 @@ QList<QWidget *> SerialOutputPane::toolBarWidgets() const
|
||||
|
||||
QString SerialOutputPane::displayName() const
|
||||
{
|
||||
return tr(Constants::OUTPUT_PANE_TITLE);
|
||||
return Tr::tr(Constants::OUTPUT_PANE_TITLE);
|
||||
}
|
||||
|
||||
int SerialOutputPane::priorityInStatusBar() const
|
||||
@@ -287,7 +288,7 @@ void SerialOutputPane::createNewOutputWindow(SerialControl *rc)
|
||||
connect(TextEditorSettings::instance(), &TextEditorSettings::fontSettingsChanged,
|
||||
this, fontSettingsChanged);
|
||||
fontSettingsChanged();
|
||||
ow->setWindowTitle(tr("Serial Terminal Window"));
|
||||
ow->setWindowTitle(Tr::tr("Serial Terminal Window"));
|
||||
// TODO: wordwrap, maxLineCount, zoom/wheelZoom (add to settings)
|
||||
|
||||
auto controlTab = SerialControlTab(rc, ow);
|
||||
@@ -323,7 +324,7 @@ void SerialOutputPane::createToolButtons()
|
||||
// Connect button
|
||||
m_connectButton = new QToolButton;
|
||||
m_connectButton->setIcon(Utils::Icons::RUN_SMALL_TOOLBAR.icon());
|
||||
m_connectButton->setToolTip(tr("Connect"));
|
||||
m_connectButton->setToolTip(Tr::tr("Connect"));
|
||||
m_connectButton->setEnabled(false);
|
||||
connect(m_connectButton, &QToolButton::clicked,
|
||||
this, &SerialOutputPane::connectControl);
|
||||
@@ -331,7 +332,7 @@ void SerialOutputPane::createToolButtons()
|
||||
// Disconnect button
|
||||
m_disconnectButton = new QToolButton;
|
||||
m_disconnectButton->setIcon(Utils::Icons::STOP_SMALL_TOOLBAR.icon());
|
||||
m_disconnectButton->setToolTip(tr("Disconnect"));
|
||||
m_disconnectButton->setToolTip(Tr::tr("Disconnect"));
|
||||
m_disconnectButton->setEnabled(false);
|
||||
|
||||
connect(m_disconnectButton, &QToolButton::clicked,
|
||||
@@ -340,7 +341,7 @@ void SerialOutputPane::createToolButtons()
|
||||
// Reset button
|
||||
m_resetButton = new QToolButton;
|
||||
m_resetButton->setIcon(Utils::Icons::RELOAD_TOOLBAR.icon());
|
||||
m_resetButton->setToolTip(tr("Reset Board"));
|
||||
m_resetButton->setToolTip(Tr::tr("Reset Board"));
|
||||
m_resetButton->setEnabled(false);
|
||||
|
||||
connect(m_resetButton, &QToolButton::clicked,
|
||||
@@ -349,7 +350,7 @@ void SerialOutputPane::createToolButtons()
|
||||
// New terminal button
|
||||
m_newButton = new QToolButton;
|
||||
m_newButton->setIcon(Utils::Icons::PLUS_TOOLBAR.icon());
|
||||
m_newButton->setToolTip(tr("Add New Terminal"));
|
||||
m_newButton->setToolTip(Tr::tr("Add New Terminal"));
|
||||
m_newButton->setEnabled(true);
|
||||
|
||||
connect(m_newButton, &QToolButton::clicked,
|
||||
|
@@ -23,5 +23,6 @@ QtcPlugin {
|
||||
"serialterminalplugin.h",
|
||||
"serialterminalsettings.cpp",
|
||||
"serialterminalsettings.h",
|
||||
"serialterminaltr.h",
|
||||
]
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@
|
||||
namespace SerialTerminal {
|
||||
namespace Constants {
|
||||
|
||||
const char OUTPUT_PANE_TITLE[] = QT_TRANSLATE_NOOP("SerialTerminal::Internal::SerialTerminalOutputPane", "Serial Terminal");
|
||||
const char OUTPUT_PANE_TITLE[] = QT_TRANSLATE_NOOP("::SerialTerminal", "Serial Terminal");
|
||||
|
||||
const char LOGGING_CATEGORY[] = "qtc.serialterminal.outputpane";
|
||||
|
||||
|
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "serialterminalsettings.h"
|
||||
#include "serialterminalconstants.h"
|
||||
#include "serialterminaltr.h"
|
||||
|
||||
#include <QLoggingCategory>
|
||||
#include <QSettings>
|
||||
@@ -22,10 +23,10 @@ void readSetting(const QSettings &settings, T &value, const QString &key) {
|
||||
Settings::Settings()
|
||||
{
|
||||
lineEndings = {
|
||||
{QObject::tr("None"), ""},
|
||||
{QObject::tr("LF"), "\n"},
|
||||
{QObject::tr("CR"), "\r"},
|
||||
{QObject::tr("CRLF"), "\r\n"}
|
||||
{Tr::tr("None"), ""},
|
||||
{Tr::tr("LF"), "\n"},
|
||||
{Tr::tr("CR"), "\r"},
|
||||
{Tr::tr("CRLF"), "\r\n"}
|
||||
};
|
||||
defaultLineEndingIndex = 1;
|
||||
}
|
||||
|
15
src/plugins/serialterminal/serialterminaltr.h
Normal file
15
src/plugins/serialterminal/serialterminaltr.h
Normal file
@@ -0,0 +1,15 @@
|
||||
// Copyright (C) 2023 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
namespace SerialTerminal {
|
||||
|
||||
struct Tr
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(::SerialTerminal)
|
||||
};
|
||||
|
||||
} // namespace SerialTerminal
|
Reference in New Issue
Block a user