mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-11 07:18:08 +00:00
Apply i18n translation only to built-in WebUI
This commit is contained in:
parent
ee38124db7
commit
082e6f8830
@ -428,13 +428,16 @@ void WebApplication::sendFile(const Path &path)
|
|||||||
const QDateTime lastModified = Utils::Fs::lastModified(path);
|
const QDateTime lastModified = Utils::Fs::lastModified(path);
|
||||||
|
|
||||||
// find translated file in cache
|
// find translated file in cache
|
||||||
const auto it = m_translatedFiles.constFind(path);
|
if (!m_isAltUIUsed)
|
||||||
if ((it != m_translatedFiles.constEnd()) && (lastModified <= it->lastModified))
|
{
|
||||||
|
if (const auto it = m_translatedFiles.constFind(path);
|
||||||
|
(it != m_translatedFiles.constEnd()) && (lastModified <= it->lastModified))
|
||||||
{
|
{
|
||||||
print(it->data, it->mimeType);
|
print(it->data, it->mimeType);
|
||||||
setHeader({Http::HEADER_CACHE_CONTROL, getCachingInterval(it->mimeType)});
|
setHeader({Http::HEADER_CACHE_CONTROL, getCachingInterval(it->mimeType)});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QFile file {path.data()};
|
QFile file {path.data()};
|
||||||
if (!file.open(QIODevice::ReadOnly))
|
if (!file.open(QIODevice::ReadOnly))
|
||||||
@ -454,7 +457,7 @@ void WebApplication::sendFile(const Path &path)
|
|||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
const QMimeType mimeType = QMimeDatabase().mimeTypeForFileNameAndData(path.data(), data);
|
const QMimeType mimeType = QMimeDatabase().mimeTypeForFileNameAndData(path.data(), data);
|
||||||
const bool isTranslatable = mimeType.inherits(u"text/plain"_qs);
|
const bool isTranslatable = !m_isAltUIUsed && mimeType.inherits(u"text/plain"_qs);
|
||||||
|
|
||||||
// Translate the file
|
// Translate the file
|
||||||
if (isTranslatable)
|
if (isTranslatable)
|
||||||
|
Loading…
Reference in New Issue
Block a user