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/protocols | |
| parent | aab2b50efa1298ba8a5dd1f21f05c306ee8ea4d1 (diff) | |
mark more strings for translation
Diffstat (limited to 'src/protocols')
| -rw-r--r-- | src/protocols/abouthandler.cpp | 8 | ||||
| -rw-r--r-- | src/protocols/filehandler.cpp | 6 | ||||
| -rw-r--r-- | src/protocols/geminiclient.cpp | 18 |
3 files changed, 16 insertions, 16 deletions
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); |
