Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make "Local PC" translatable #595

Merged
merged 1 commit into from
Jan 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion wingetui/storeEngine.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def runInstallation(self) -> None:
self.progressbar.setValue(0)
if self.progressbar.invertedAppearance(): self.progressbar.setInvertedAppearance(False)
self.finishedInstallation = False
if(self.store == "winget" or self.store.lower() in ("local pc", "microsoft store", "steam", "gog", "ubisoft connect")):
if(self.store == "winget" or self.store in ((_("Local PC"), "Microsoft Store", "Steam", "GOG", "Ubisoft Connect"))):
self.p = subprocess.Popen(self.adminstr + [wingetHelpers.winget, "uninstall", "-e"] + (["--id", self.packageId] if self.useId else ["--name", self.programName]) + wingetHelpers.common_params + self.cmdline_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin=subprocess.PIPE, shell=True, cwd=sudoLocation, env=os.environ)
self.t = KillableThread(target=wingetHelpers.uninstallAssistant, args=(self.p, self.finishInstallation, self.addInfoLine, self.counterSignal))
self.t.start()
Expand Down
16 changes: 8 additions & 8 deletions wingetui/uiSections.py
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@ def showMenu(pos: QPoint):
contextMenu.addSeparator()
else:
contextMenu.addAction(ins5)
if self.packageList.currentItem().text(4).lower() not in ("local pc", "microsoft store", "steam", "gog", "ubisoft connect"):
if self.packageList.currentItem().text(4) not in ((_("Local PC"), "Microsoft Store", "Steam", "GOG", "Ubisoft Connect")):
contextMenu.addAction(ins4)

contextMenu.exec(QCursor.pos())
Expand Down Expand Up @@ -1431,7 +1431,7 @@ def showMenu(pos: QPoint):

def showInfo():
item = self.packageList.currentItem()
if item.text(4).lower() in ("local pc", "microsoft store", "steam", "gog", "ubisoft connect"):
if item.text(4) in ((_("Local PC"), "Microsoft Store", "Steam", "GOG", "Ubisoft Connect")):
self.err = ErrorMessage(self.window())
errorData = {
"titlebarTitle": _("Unable to load informarion"),
Expand Down Expand Up @@ -1720,19 +1720,19 @@ def addItem(self, name: str, id: str, version: str, store: str) -> None:
if store.lower() == "winget":
for illegal_char in ("{", "}", " "):
if illegal_char in id:
store = "Local PC"
store = (_("Local PC"))
break

if store.lower() == "winget":
if id.count(".") != 1:
store = "Local PC"
store = (_("Local PC"))
if id.count(".") > 1:
for letter in id:
if letter in "ABCDEFGHIJKLMNOPQRSTUVWXYZ":
store = "Winget"
break

if store.lower() == "local pc":
if store == (_("Local PC")):
if id == "Steam":
store = "Steam"
if id == "Uplay":
Expand All @@ -1741,10 +1741,10 @@ def addItem(self, name: str, id: str, version: str, store: str) -> None:
store = "GOG"
for number in id.split("_is1")[0]:
if number not in "0123456789":
store = "Local PC"
store = (_("Local PC"))
break
if len(id) != 14:
store = "Local PC"
store = (_("Local PC"))
if id.count("GOG") == 1:
store = "GOG"

Expand All @@ -1764,7 +1764,7 @@ def addItem(self, name: str, id: str, version: str, store: str) -> None:
item.setIcon(4, self.scoopIcon)
elif "winget" in store.lower():
item.setIcon(4, self.wingetIcon)
elif "local pc" in store.lower():
elif (_("Local PC")) in store:
item.setIcon(4, self.localIcon)
elif "steam" in store.lower():
item.setIcon(4, self.SteamIcon)
Expand Down