mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-30 11:38:50 -07:00
Fix Web UI translation
This commit is contained in:
parent
b4f6745251
commit
7778877fa7
7 changed files with 29 additions and 27 deletions
|
@ -109,7 +109,7 @@ QString HttpConnection::translateDocument(QString data) {
|
|||
bool found = false;
|
||||
do {
|
||||
found = false;
|
||||
QRegExp regex(QString::fromUtf8("_\\(([\\w\\s?!:\\/\\(\\),µ\\-\\.]+)\\)"));
|
||||
QRegExp regex(QString::fromUtf8("_\\(([\\w\\s?!:\\/\\(\\),µ&\\-\\.]+)\\)"));
|
||||
i = regex.indexIn(data, i);
|
||||
if(i >= 0) {
|
||||
//qDebug("Found translatable string: %s", regex.cap(1).toUtf8().data());
|
||||
|
@ -120,6 +120,8 @@ QString HttpConnection::translateDocument(QString data) {
|
|||
translation = qApp->translate(contexts[context_index].c_str(), word.toLocal8Bit().constData(), 0, QCoreApplication::UnicodeUTF8, 1);
|
||||
++context_index;
|
||||
}while(translation == word && context_index < 13);
|
||||
// Remove keyboard shortcuts
|
||||
translation = translation.replace("&", "");
|
||||
//qDebug("Translation is %s", translation.toUtf8().data());
|
||||
data = data.replace(i, regex.matchedLength(), translation);
|
||||
i += translation.length();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue