Skip to content

Commit e84c11f

Browse files
committed
Fixed critical part of language issue
1 parent bea33b3 commit e84c11f

22 files changed

+432
-72
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
- Floppy & CD code for Linux has been added, what I forgot with the 0.5 lineup.
44
- Altered the floppy code so QEMU doesn't complain anymore.
5+
- At least you can use EmuGUI normally now, except you can't change the language too often in a single session.
56

67
# EmuGUI v0.6.1
78

504 Bytes
Binary file not shown.
56 Bytes
Binary file not shown.
499 Bytes
Binary file not shown.
494 Bytes
Binary file not shown.
498 Bytes
Binary file not shown.
498 Bytes
Binary file not shown.
499 Bytes
Binary file not shown.
499 Bytes
Binary file not shown.

dialogExecution/editVirtualMachine.py

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ def langDetect(self):
137137
elif result[0][1] == "uk":
138138
langmode = "uk"
139139

140+
elif result[0][1] == "system":
141+
langmode = "system"
142+
140143
self.setLanguage(langmode)
141144
print("The query was executed successfully. The language slot already is in the database.")
142145

@@ -155,14 +158,43 @@ def setLanguage(self, langmode):
155158
else:
156159
languageToUse = langmode
157160

158-
if languageToUse.startswith("de"):
159-
translations.de.translateNewVmDE(self)
161+
print(languageToUse)
162+
163+
if languageToUse != None:
164+
if languageToUse.startswith("de"):
165+
translations.de.translateNewVmDE(self)
160166

161-
elif languageToUse.startswith("uk"):
162-
translations.uk.translateNewVmUK(self)
167+
elif languageToUse.startswith("uk"):
168+
translations.uk.translateNewVmUK(self)
163169

170+
else:
171+
translations.en.translateNewVmEN(self)
172+
164173
else:
165-
translations.en.translateNewVmEN(self)
174+
if platform.system() == "Windows":
175+
langfile = platformSpecific.windowsSpecific.windowsLanguageFile()
176+
177+
else:
178+
langfile = platformSpecific.unixSpecific.unixLanguageFile()
179+
180+
try:
181+
with open(langfile, "r+") as language:
182+
languageContent = language.readlines()
183+
languageToUse = languageContent[0].replace("\n", "")
184+
185+
if languageToUse != None:
186+
if languageToUse.startswith("de"):
187+
translations.de.translateNewVmDE(self)
188+
189+
elif languageToUse.startswith("uk"):
190+
translations.uk.translateNewVmUK(self)
191+
192+
else:
193+
translations.en.translateNewVmEN(self)
194+
195+
except:
196+
print("Translation can't be figured out. Using English language.")
197+
translations.en.translateNewVmEN(self)
166198

167199
# First, it will check the architecture of your VM.
168200

0 commit comments

Comments
 (0)