mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-21 03:10:24 +08:00
change: changed language code format
This commit is contained in:
parent
ad9acc686b
commit
8746877bd2
@ -1 +1 @@
|
||||
3076
|
||||
3077
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "QvTinyLog.hpp"
|
||||
#include "QvCoreConfigObjects.hpp"
|
||||
|
||||
const int QV2RAY_CONFIG_VERSION = 7;
|
||||
const int QV2RAY_CONFIG_VERSION = 8;
|
||||
|
||||
// Linux users and DEs should handle the darkMode UI themselves.
|
||||
#ifndef QV2RAY_USE_BUILTIN_DARKTHEME
|
||||
|
@ -69,7 +69,7 @@ namespace Qv2ray
|
||||
UPDATELOG("Added v2CorePath to the config file.")
|
||||
//
|
||||
QJsonObject uiSettings;
|
||||
uiSettings["language"] = root["language"].toString("en-US");
|
||||
uiSettings["language"] = root["language"].toString("en-US").replace("-", "_");
|
||||
root["uiConfig"] = uiSettings;
|
||||
//
|
||||
root["inboundConfig"] = root["inBoundSettings"];
|
||||
@ -121,6 +121,7 @@ namespace Qv2ray
|
||||
}
|
||||
|
||||
root["subscriptions"] = newSubscriptions;
|
||||
UPDATELOG("Added subscription renewal options.")
|
||||
break;
|
||||
}
|
||||
|
||||
@ -133,6 +134,15 @@ namespace Qv2ray
|
||||
root["apiConfig"] = apiConfig;
|
||||
break;
|
||||
}
|
||||
|
||||
case 7: {
|
||||
auto lang = root["uiConfig"].toObject()["language"].toString().replace("-", "_");
|
||||
auto uiConfig = root["uiConfig"].toObject();
|
||||
uiConfig["language"] = lang;
|
||||
root["uiConfig"] = uiConfig;
|
||||
UPDATELOG("Changed language: " + lang)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
root["config_version"] = root["config_version"].toInt() + 1;
|
||||
|
@ -191,7 +191,7 @@ int main(int argc, char *argv[])
|
||||
std::unique_ptr<QCoreApplication> consoleApp(new QCoreApplication(argc, argv));
|
||||
//
|
||||
// Install a default translater. From the OS/DE
|
||||
consoleApp->installTranslator(getTranslator(QLocale::system().name().replace("_", "-")));
|
||||
consoleApp->installTranslator(getTranslator(QLocale::system().name()));
|
||||
QvCommandArgParser parser;
|
||||
QString errorMessage;
|
||||
|
||||
@ -251,7 +251,7 @@ int main(int argc, char *argv[])
|
||||
//
|
||||
// Not duplicated.
|
||||
// Install a default translater. From the OS/DE
|
||||
auto _lang = QLocale::system().name().replace("_", "-");
|
||||
auto _lang = QLocale::system().name();
|
||||
auto _sysTranslator = getTranslator(_lang);
|
||||
|
||||
if (_lang != "en-US") {
|
||||
|
Loading…
Reference in New Issue
Block a user