summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurelian R <arusanu@gmail.com>2026-04-19 02:05:08 +0300
committerAurelian R <arusanu@gmail.com>2026-04-19 02:05:08 +0300
commit61a5654ec67fc9bfa084a13d41df9a8619e5961c (patch)
treee23e78d9538f6d551204656fddd789275b8dbb86
parentbbcc505eaa507b4097035d4b96bd684958dedb53 (diff)
downloadmageiawelcome-61a5654ec67fc9bfa084a13d41df9a8619e5961c.tar
mageiawelcome-61a5654ec67fc9bfa084a13d41df9a8619e5961c.tar.gz
mageiawelcome-61a5654ec67fc9bfa084a13d41df9a8619e5961c.tar.bz2
mageiawelcome-61a5654ec67fc9bfa084a13d41df9a8619e5961c.tar.xz
mageiawelcome-61a5654ec67fc9bfa084a13d41df9a8619e5961c.zip
Perform translation of the "AppList" items when called (mga#35371)
AppList is evaluated before the translators are loaded. Use a function to translate the strings only when called.
-rw-r--r--src/AppList.py3
-rw-r--r--src/ui.py5
2 files changed, 6 insertions, 2 deletions
diff --git a/src/AppList.py b/src/AppList.py
index 209a07e..d1f5e4d 100644
--- a/src/AppList.py
+++ b/src/AppList.py
@@ -1,7 +1,8 @@
from PyQt6.QtWidgets import QApplication
_ = QApplication.translate
-AppList = [
+def get_AppList():
+ return [
{ "group": "audio featured", "description": _("AppList", "Various Audio Codecs"), "title": "Audio Codecs", "name": "task-codec-audio", "command": "", "repo": "", "icon": "img/codecs-audio.png", "arch": ""},
{ "group": "audio featured", "description": _("AppList", "Various Audio Codecs"), "title": "Audio Codecs", "name": "task-codec-audio", "command": "", "repo": "tainted", "icon": "img/codecs-audio.png", "arch": ""},
{ "group": "video featured", "description": _("AppList", "Various Video Codecs"), "title": "Video Codecs", "name": "task-codec-video", "command": "", "repo": "", "icon": "img/codecs-video.png", "arch": ""},
diff --git a/src/ui.py b/src/ui.py
index 4abeb72..8290495 100644
--- a/src/ui.py
+++ b/src/ui.py
@@ -57,7 +57,7 @@ from helpers import (
Autostart,
SystemArch,
)
-from AppList import AppList
+from AppList import get_AppList
from version import version
DEFAULT_WIDTH = 900
@@ -830,6 +830,7 @@ class AppListStack(QStackedWidget):
"""
Update the entry in any other tab except the current designated by except_group
"""
+ AppList = get_AppList()
item = AppList[index]
group = item["group"]
name = item["name"]
@@ -863,6 +864,7 @@ class AppListPage(QScrollArea):
self.setStyleSheet("border: none;")
# self.setBackgroundRole(QPalette.ColorRole.Window);
self.list_layout = QVBoxLayout()
+ AppList = get_AppList()
for index in range(len(AppList)):
item = AppList[index]
if group in item["group"] and not (item["arch"] == "64bits" and arch32):
@@ -891,6 +893,7 @@ class AppListPage(QScrollArea):
def update_item(self, widget, applist_index):
index = self.list_layout.indexOf(widget)
widget.deleteLater()
+ AppList = get_AppList()
item = AppList[applist_index]
self.list_layout.insertWidget(
index,