| 1389 | } |
| 1390 | |
| 1391 | void CustomLangPack::fetchError(QNetworkReply::NetworkError e) { |
| 1392 | LOG(("Network error: %1").arg(e)); |
| 1393 | |
| 1394 | if (e == QNetworkReply::NetworkError::ContentNotFoundError) { |
| 1395 | QString langPackBaseId = Lang::GetInstance().baseId(); |
| 1396 | QString langPackId = Lang::GetInstance().id(); |
| 1397 | |
| 1398 | if (!langPackId.isEmpty() && !langPackBaseId.isEmpty() && !needFallback) { |
| 1399 | LOG(("64Gram Language pack not found! Fallback to main language: %1...").arg(langPackBaseId)); |
| 1400 | needFallback = true; |
| 1401 | _chkReply->disconnect(); |
| 1402 | fetchCustomLangPack("", langPackBaseId); |
| 1403 | } else { |
| 1404 | LOG(("64Gram Language pack not found! Fallback to default language: English...")); |
| 1405 | loadDefaultLangFile(); |
| 1406 | _chkReply = nullptr; |
| 1407 | } |
| 1408 | } |
| 1409 | } |
| 1410 | |
| 1411 | void CustomLangPack::loadDefaultLangFile() { |
| 1412 | QFile file(":/localization/en.json"); |