translation of all project, and new translation mechanism
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "seasonalbuildservice.h"
|
||||
#include "localization.h"
|
||||
|
||||
#include "launcherpaths.h"
|
||||
#include "modloader.h"
|
||||
@@ -121,8 +122,8 @@ QList<SeasonalBuildEntry> SeasonalBuildService::parseCatalog(const QJsonObject &
|
||||
if (format != kSupportedFormatVersion) {
|
||||
if (error) {
|
||||
*error = format > kSupportedFormatVersion
|
||||
? tr("Сервер сборок отдаёт формат %1 — обновите лаунчер").arg(format)
|
||||
: tr("Неизвестный формат каталога сборок (%1)").arg(format);
|
||||
? Loc::text("seasonal.error.formatTooNew").arg(format)
|
||||
: Loc::text("seasonal.error.formatUnknown").arg(format);
|
||||
}
|
||||
return {};
|
||||
}
|
||||
@@ -200,7 +201,7 @@ QList<SeasonalBuildEntry> SeasonalBuildService::parseCatalog(const QJsonObject &
|
||||
void SeasonalBuildService::ensureLoaded(Callback callback, bool forceRefresh)
|
||||
{
|
||||
if (!m_baseUrl.isValid() || m_baseUrl.host().isEmpty()) {
|
||||
m_lastError = tr("Адрес сервера сборок не задан");
|
||||
m_lastError = Loc::text("seasonal.error.noServerUrl");
|
||||
if (callback) {
|
||||
const QString error = m_lastError;
|
||||
QTimer::singleShot(0, this, [callback = std::move(callback), error] {
|
||||
@@ -252,7 +253,7 @@ void SeasonalBuildService::startRefresh()
|
||||
|
||||
if (reply->error() != QNetworkReply::NoError) {
|
||||
finishRefresh(false,
|
||||
tr("Не удалось получить список сборок: %1").arg(reply->errorString()));
|
||||
Loc::text("seasonal.error.catalogFetchFailed").arg(reply->errorString()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -265,7 +266,7 @@ void SeasonalBuildService::startRefresh()
|
||||
// остаётся прежним, а причина уходит в lastError.
|
||||
if (parsed.isEmpty()) {
|
||||
finishRefresh(false,
|
||||
parseError.isEmpty() ? tr("Список сборок пуст или не разобран")
|
||||
parseError.isEmpty() ? Loc::text("seasonal.error.catalogEmpty")
|
||||
: parseError);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user