MCPcopy Create free account
hub / github.com/Windscribe/Desktop-App / setLanguage

Method setLanguage

src/windscribe-cli/languagecontroller.cpp:21–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21void LanguageController::setLanguage(const QString &language)
22{
23 if (language != language_) {
24 bool languageLoaded = false;
25
26 // We don't have a language file for English, since all the hard-coded strings are
27 // already in English.
28 if (language != "en") {
29 // Try to load the specified language. If that fails, try to load the system language.
30 languageLoaded = loadLanguage(language);
31 if (!languageLoaded) {
32 languageLoaded = loadLanguage(LanguagesUtil::systemLanguage());
33 }
34 }
35
36 if (!languageLoaded) {
37 qApp->removeTranslator(&translator_);
38 language_ = "en";
39 }
40
41 emit languageChanged();
42 }
43}
44
45bool LanguageController::loadLanguage(const QString &language)
46{

Callers 3

sendCommandMethod · 0.45
onStateResponseMethod · 0.45
mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected