diff options
| author | OIS <mistresssilvara@hotmail.com> | 2021-03-16 22:48:37 +0700 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2021-03-16 21:04:07 +0100 |
| commit | 502219103193c850604110bbfe5e0c456df980bc (patch) | |
| tree | 1d81b2b92f106497dd0030f442b724027820e0f3 /src | |
| parent | aab2b50efa1298ba8a5dd1f21f05c306ee8ea4d1 (diff) | |
| download | kristall-502219103193c850604110bbfe5e0c456df980bc.tar.gz | |
mark more strings for translation
Diffstat (limited to 'src')
| -rw-r--r-- | src/browsertab.cpp | 2 | ||||
| -rw-r--r-- | src/mainwindow.cpp | 12 | ||||
| -rw-r--r-- | src/protocols/abouthandler.cpp | 8 | ||||
| -rw-r--r-- | src/protocols/filehandler.cpp | 6 | ||||
| -rw-r--r-- | src/protocols/geminiclient.cpp | 18 | ||||
| -rw-r--r-- | src/widgets/ssltrusteditor.cpp | 6 |
6 files changed, 26 insertions, 26 deletions
diff --git a/src/browsertab.cpp b/src/browsertab.cpp index dc85078..4c28f1c 100644 --- a/src/browsertab.cpp +++ b/src/browsertab.cpp @@ -196,7 +196,7 @@ void BrowserTab::navigateTo(const QUrl &url, PushToHistory mode, RequestFlags fl this->timer.start(); if(not this->startRequest(url, ProtocolHandler::Default, flags)) { - QMessageBox::critical(this, "Kristall", QString("Failed to execute request to %1").arg(url.toString())); + QMessageBox::critical(this, tr("Kristall"), QString(tr("Failed to execute request to %1")).arg(url.toString())); return; } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 66406ae..d9ee161 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -199,22 +199,22 @@ void MainWindow::setRequestState(RequestState state) { case RequestState::Started: { - this->request_status = "Looking up..."; + this->request_status = tr("Looking up..."); } break; case RequestState::StartedWeb: { - this->request_status = "Loading webpage..."; + this->request_status = tr("Loading webpage..."); } break; case RequestState::HostFound: { - this->request_status = "Connecting..."; + this->request_status = tr("Connecting..."); } break; case RequestState::Connected: { - this->request_status = "Downloading..."; + this->request_status = tr("Downloading..."); } break; default: @@ -240,10 +240,10 @@ void MainWindow::updateWindowTitle() BrowserTab * tab = this->curTab(); if (tab == nullptr || tab->page_title.isEmpty()) { - this->setWindowTitle("Kristall"); + this->setWindowTitle(tr("Kristall")); return; } - this->setWindowTitle(QString("%0 - %1").arg(tab->page_title, "Kristall")); + this->setWindowTitle(QString(tr("%0 - %1")).arg(tab->page_title, tr("Kristall"))); } void MainWindow::setUiDensity(UIDensity density, bool previewing) diff --git a/src/protocols/abouthandler.cpp b/src/protocols/abouthandler.cpp index 13bc098..999de87 100644 --- a/src/protocols/abouthandler.cpp +++ b/src/protocols/abouthandler.cpp @@ -52,7 +52,7 @@ bool AboutHandler::startRequest(const QUrl &url, ProtocolHandler::RequestOptions else if (url.path() == "cache") { QByteArray document; - document.append("# Cache information\n"); + document.append(tr("# Cache information\n")); auto& cache = kristall::globals().cache.getPages(); long unsigned cache_usage = 0; @@ -63,9 +63,9 @@ bool AboutHandler::startRequest(const QUrl &url, ProtocolHandler::RequestOptions } document.append(QString( - "In-memory cache usage:\n" + tr("In-memory cache usage:\n" "* %1 used\n" - "* %2 pages in cache\n") + "* %2 pages in cache\n")) .arg(IoUtil::size_human(cache_usage), QString::number(cached_count)).toUtf8()); emit this->requestComplete(document, "text/gemini"); @@ -79,7 +79,7 @@ bool AboutHandler::startRequest(const QUrl &url, ProtocolHandler::RequestOptions } else { - emit this->networkError(ResourceNotFound, "The requested resource does not exist."); + emit this->networkError(ResourceNotFound, QObject::tr("The requested resource does not exist.")); } } return true; diff --git a/src/protocols/filehandler.cpp b/src/protocols/filehandler.cpp index 9e76dcd..f352fa4 100644 --- a/src/protocols/filehandler.cpp +++ b/src/protocols/filehandler.cpp @@ -35,7 +35,7 @@ bool FileHandler::startRequest(const QUrl &url, RequestOptions options) // URL points to directory - we create Gemtext // page which lists contents of directory. QString page; - page += QString("# Index of %1\n").arg(url.path()); + page += QString(tr("# Index of %1\n")).arg(url.path()); auto filters = QDir::Dirs | QDir::Files | QDir::NoDot; if (kristall::globals().options.show_hidden_files_in_dirs) filters |= QDir::Hidden; @@ -45,7 +45,7 @@ bool FileHandler::startRequest(const QUrl &url, RequestOptions options) for (unsigned i = 0; i < dir.count(); ++i) { // Add link to page. - page += QString("=> file://%1 %2\n") + page += QString(tr("=> file://%1 %2\n")) .arg(QUrl(dir.filePath(dir[i])).toString(QUrl::FullyEncoded), dir[i]); } @@ -54,7 +54,7 @@ bool FileHandler::startRequest(const QUrl &url, RequestOptions options) } else { - emit this->networkError(ResourceNotFound, "The requested file does not exist!"); + emit this->networkError(ResourceNotFound, QObject::tr("The requested file does not exist!")); } return true; } diff --git a/src/protocols/geminiclient.cpp b/src/protocols/geminiclient.cpp index 15a05f9..273ced1 100644 --- a/src/protocols/geminiclient.cpp +++ b/src/protocols/geminiclient.cpp @@ -173,30 +173,30 @@ void GeminiClient::socketReadyRead() if(buffer.size() < 4) { // we allow an empty <META> socket.close(); qDebug() << buffer; - emit networkError(ProtocolViolation, "Line is too short for valid protocol"); + emit networkError(ProtocolViolation, QObject::tr("Line is too short for valid protocol")); return; } if(buffer.size() >= 1200) { - emit networkError(ProtocolViolation, "response too large!"); + emit networkError(ProtocolViolation, QObject::tr("response too large!")); socket.close(); } if(buffer[buffer.size() - 1] != '\r') { socket.close(); qDebug() << buffer; - emit networkError(ProtocolViolation, "Line does not end with <CR> <LF>"); + emit networkError(ProtocolViolation, QObject::tr("Line does not end with <CR> <LF>")); return; } if(not isdigit(buffer[0])) { socket.close(); qDebug() << buffer; - emit networkError(ProtocolViolation, "First character is not a digit."); + emit networkError(ProtocolViolation, QObject::tr("First character is not a digit.")); return; } if(not isdigit(buffer[1])) { socket.close(); qDebug() << buffer; - emit networkError(ProtocolViolation, "Second character is not a digit."); + emit networkError(ProtocolViolation, QObject::tr("Second character is not a digit.")); return; } // TODO: Implement stricter version @@ -204,7 +204,7 @@ void GeminiClient::socketReadyRead() if(not isspace(buffer[2])) { socket.close(); qDebug() << buffer; - emit networkError(ProtocolViolation, "Third character is not a space."); + emit networkError(ProtocolViolation, QObject::tr("Third character is not a space.")); return; } @@ -247,7 +247,7 @@ void GeminiClient::socketReadyRead() emit redirected(new_url, (secondary_code == 1)); } else { - emit networkError(ProtocolViolation, "Invalid URL for redirection!"); + emit networkError(ProtocolViolation, QObject::tr("Invalid URL for redirection!")); } return; } @@ -297,7 +297,7 @@ void GeminiClient::socketReadyRead() return; default: - emit networkError(ProtocolViolation, "Unspecified status code used!"); + emit networkError(ProtocolViolation, QObject::tr("Unspecified status code used!")); return; } @@ -306,7 +306,7 @@ void GeminiClient::socketReadyRead() } if((buffer.size() + response.size()) >= 1200) { - emit networkError(ProtocolViolation, "META too large!"); + emit networkError(ProtocolViolation, QObject::tr("META too large!")); socket.close(); } buffer.append(response); diff --git a/src/widgets/ssltrusteditor.cpp b/src/widgets/ssltrusteditor.cpp index da5d179..584e926 100644 --- a/src/widgets/ssltrusteditor.cpp +++ b/src/widgets/ssltrusteditor.cpp @@ -8,9 +8,9 @@ SslTrustEditor::SslTrustEditor(QWidget *parent) : ui->setupUi(this); this->ui->trust_level->clear(); - this->ui->trust_level->addItem("Trust on first encounter", QVariant::fromValue<int>(SslTrust::TrustOnFirstUse)); - this->ui->trust_level->addItem("Trust everything", QVariant::fromValue<int>(SslTrust::TrustEverything)); - this->ui->trust_level->addItem("Manually verify fingerprints", QVariant::fromValue<int>(SslTrust::TrustNoOne)); + this->ui->trust_level->addItem(tr("Trust on first encounter"), QVariant::fromValue<int>(SslTrust::TrustOnFirstUse)); + this->ui->trust_level->addItem(tr("Trust everything"), QVariant::fromValue<int>(SslTrust::TrustEverything)); + this->ui->trust_level->addItem(tr("Manually verify fingerprints"), QVariant::fromValue<int>(SslTrust::TrustNoOne)); auto sort_model =new QSortFilterProxyModel(this); sort_model ->setDynamicSortFilter(true); |
