Skip to content

Commit 279d211

Browse files
committed
fIx some serious bugs
1 parent c2858ca commit 279d211

File tree

5 files changed

+23
-13
lines changed

5 files changed

+23
-13
lines changed

oclp_r/support/translate_language.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,11 +1637,11 @@ def gui_main_menu(self):
16371637
"Resources for OpenCore Legacy":"Resources for OpenCore Legacy",
16381638
"Patcher.":"Patcher.",
16391639
"Unsupported Configuration Detected!":"Unsupported Configuration Detected!",
1640-
"We found you are currently booting OpenCore built for a different unit: {self.constants.computer.build_model}\n\nWe builds configs to match individual units and cannot be mixed or reused with different Macs.\n\nPlease Build and Install a new OpenCore config, and reboot your Mac.":"We found you are currently booting OpenCore built for a different unit: {self.constants.computer.build_model}\n\nWe builds configs to match individual units and cannot be mixed or reused with different Macs.\n\nPlease Build and Install a new OpenCore config, and reboot your Mac.",
1640+
"We found you are currently booting OpenCore built for a different unit: {build_model}\n\nWe builds configs to match individual units and cannot be mixed or reused with different Macs.\n\nPlease Build and Install a new OpenCore config, and reboot your Mac.":"We found you are currently booting OpenCore built for a different unit: {self.constants.computer.build_model}\n\nWe builds configs to match individual units and cannot be mixed or reused with different Macs.\n\nPlease Build and Install a new OpenCore config, and reboot your Mac.",
16411641
"Update successful!":"Update successful!",
1642-
"OCLP-R has been updated to the latest version: {self.constants.patcher_version}\n\nWould you like to update OpenCore and your root volume patches?":"OCLP-R has been updated to the latest version: {self.constants.patcher_version}\n\nWould you like to update OpenCore and your root volume patches?",
1642+
"OCLP-R has been updated to the latest version: {patcher_version}\n\nWould you like to update OpenCore and your root volume patches?":"OCLP-R has been updated to the latest version: {patcher_version}\n\nWould you like to update OpenCore and your root volume patches?",
16431643
"A new version of OCLP-R is available!":"A new version of OCLP-R is available!",
1644-
"OCLP-R {oclp_version} is now available - You have {self.constants.patcher_version}. Would you like to update?":"OCLP-R {oclp_version} is now available - You have {self.constants.patcher_version}. Would you like to update?",
1644+
"OCLP-R {oclp_version} is now available - You have {patcher_version}. Would you like to update?":"OCLP-R {oclp_version} is now available - You have {patcher_version}. Would you like to update?",
16451645
"Unable to fetch changelog\n\nPlease check the Github page for more information about this release.":"Unable to fetch changelog\n\nPlease check the Github page for more information about this release.",
16461646
"Dismiss":"Dismiss",
16471647
"View on GitHub":"View on GitHub",
@@ -1687,11 +1687,11 @@ def gui_main_menu(self):
16871687
"Resources for OpenCore Legacy":"OpenCore Legacy Patcher",
16881688
"Patcher.":"的资源。",
16891689
"Unsupported Configuration Detected!":"检测到不支持的配置!",
1690-
"We found you are currently booting OpenCore built for a different unit: {self.constants.computer.build_model}\n\nWe builds configs to match individual units and cannot be mixed or reused with different Macs.\n\nPlease Build and Install a new OpenCore config, and reboot your Mac.":"我们发现您当前正在引导为不同设备构建的 OpenCore:{self.constants.computer.build_model}\n\n我们构建的配置是为匹配单个设备的,不能与不同的 Mac 混合使用或重复使用。\n\n请构建并安装一个新的 OpenCore 配置,然后重启您的 Mac。",
1690+
"We found you are currently booting OpenCore built for a different unit: {build_model}\n\nWe builds configs to match individual units and cannot be mixed or reused with different Macs.\n\nPlease Build and Install a new OpenCore config, and reboot your Mac.":"我们发现您当前正在引导为不同设备构建的 OpenCore:{self.constants.computer.build_model}\n\n我们构建的配置是为匹配单个设备的,不能与不同的 Mac 混合使用或重复使用。\n\n请构建并安装一个新的 OpenCore 配置,然后重启您的 Mac。",
16911691
"Update successful!":"更新成功!",
1692-
"OCLP-R has been updated to the latest version: {self.constants.patcher_version}\n\nWould you like to update OpenCore and your root volume patches?":"OCLP-R 已更新到最新版本:{self.constants.patcher_version}\n\n您是否要更新 OpenCore 和根卷补丁?",
1692+
"OCLP-R has been updated to the latest version: {patcher_version}\n\nWould you like to update OpenCore and your root volume patches?":"OCLP-R 已更新到最新版本:{patcher_version}\n\n您是否要更新 OpenCore 和根卷补丁?",
16931693
"A new version of OCLP-R is available!":"OCLP-R 有新版本可用!",
1694-
"OCLP-R {oclp_version} is now available - You have {self.constants.patcher_version}. Would you like to update?":"OCLP-R {oclp_version} 现已可用 - 您当前版本是 {self.constants.patcher_version}。您是否要更新?",
1694+
"OCLP-R {oclp_version} is now available - You have {patcher_version}. Would you like to update?":"OCLP-R {oclp_version} 现已可用 - 您当前版本是 {patcher_version}。您是否要更新?",
16951695
"Unable to fetch changelog\n\nPlease check the Github page for more information about this release.":"无法获取更新日志\n\n请查看 Github 页面了解有关此版本的更多信息。",
16961696
"Dismiss":"关闭",
16971697
"View on GitHub":"在 GitHub 上查看",
@@ -2676,7 +2676,7 @@ def gui_update(self):
26762676
}
26772677
return trans
26782678
class TranslateLanguage_sys_patch:
2679-
def __init__(self, global_constants: Constants = None) -> None:
2679+
def __init__(self, global_constants = None) -> None:
26802680
self.file_name: str = ".com.hackdoc.oclp-r.plist"
26812681
self.global_settings_folder: str = "/Users/Shared"
26822682
self.global_settings_plist: str = f"{self.global_settings_folder}/{self.file_name}"
@@ -2688,6 +2688,8 @@ def __init__(self, global_constants: Constants = None) -> None:
26882688
def detect(self):
26892689
if self.language_point=="English":
26902690
trans={
2691+
"- Breakdown:":"- Breakdown:",
2692+
"Network connection missing, checking whether network patches are applicable":"Network connection missing, checking whether network patches are applicable",
26912693
"Failed to parse diskutil output.":"Failed to parse diskutil output.",
26922694
"FileVault is Off":"FileVault is Off",
26932695
"Settings: Kernel Debug Kit required":"Settings: Kernel Debug Kit required",
@@ -2710,9 +2712,17 @@ def detect(self):
27102712
"System volume is tainted, unpatching is required":"System volume is tainted, unpatching is required",
27112713
"Installed patches are from different commit, unpatching is required":"Installed patches are from different commit, unpatching is required",
27122714
"Patch(es) already installed: {0}, unpatching is required":"Patch(es) already installed: {0}, unpatching is required",
2715+
"Network patches are already applied, requiring network connection":"Network patches are already applied, requiring network connection",
2716+
"Network patches are applicable, removing other patches":"Network patches are applicable, removing other patches",
2717+
"Network patches are not applicable, requiring network connection":"Network patches are not applicable, requiring network connection",
27132718
}
27142719
elif self.language_point=="简体中文":
27152720
trans={
2721+
"- Breakdown:":"- 分析",
2722+
"Network patches are applicable, removing other patches":"网络补丁可用,会移除其他补丁",
2723+
"Network patches are not applicable, requiring network connection":"网络补丁不适用,需要网络连接",
2724+
"Network patches are already applied, requiring network connection":"网络补丁已应用,需要网络连接",
2725+
"Network connection missing, checking whether network patches are applicable":"无网络连接,检测网络补丁是否可用",
27162726
"Patch(es) already installed: {0}, unpatching is required":"已安装的补丁:{0},需要取消修补",
27172727
"Installed patches are from different commit, unpatching is required":"已安装的补丁来自不同的提交,需要取消修补",
27182728
"System volume is tainted, unpatching is required":"系统卷已被修改,需要取消修补",

oclp_r/sys_patch/patchsets/detect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ def _detect(self) -> None:
539539
item: BaseHardware
540540
device_properties[item.name()] = True
541541

542-
if item.name() == "Graphics: Nvidia Web Drivers":
542+
if item.name() == "Graphics: Nvidia Web Drivers" or item.name() == "图形: Nvidia Web 驱动程序" :
543543
has_nvidia_web_drivers = True
544544

545545
for config in item.required_system_integrity_protection_configurations():

oclp_r/sys_patch/patchsets/hardware/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from ....support import translate_language
1717
from oclp_r import constants
1818

19-
19+
trans=translate_language.TranslateLanguage_sys_patch.hardware(None)
2020
class HardwareVariant(StrEnum):
2121
"""
2222
Hardware variant for patch set

oclp_r/wx_gui/gui_main_menu.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ def _preflight_checks(self):
267267
# Notify user they're booting an unsupported configuration
268268
pop_up = wx.MessageDialog(
269269
self,
270-
self.trans["We found you are currently booting OpenCore built for a different unit: {self.constants.computer.build_model}\n\nWe builds configs to match individual units and cannot be mixed or reused with different Macs.\n\nPlease Build and Install a new OpenCore config, and reboot your Mac."].format(self.constants.computer.build_model),
270+
self.trans["We found you are currently booting OpenCore built for a different unit: {build_model}\n\nWe builds configs to match individual units and cannot be mixed or reused with different Macs.\n\nPlease Build and Install a new OpenCore config, and reboot your Mac."].format(build_model=self.constants.computer.build_model),
271271
self.trans["Unsupported Configuration Detected!"],
272272
style=wx.OK | wx.ICON_EXCLAMATION
273273
)
@@ -280,7 +280,7 @@ def _preflight_checks(self):
280280
self.constants.has_checked_updates = True
281281
pop_up = wx.MessageDialog(
282282
self,
283-
self.trans["OCLP-R has been updated to the latest version: {self.constants.patcher_version}\n\nWould you like to update OpenCore and your root volume patches?"].format(self.constants.patcher_version),
283+
self.trans["OCLP-R has been updated to the latest version: {patcher_version}\n\nWould you like to update OpenCore and your root volume patches?"].format(patcher_version=self.constants.patcher_version),
284284
self.trans["Update successful!"],
285285
style=wx.YES_NO | wx.YES_DEFAULT | wx.ICON_INFORMATION
286286
)
@@ -408,7 +408,7 @@ def on_update(self, oclp_url: str, oclp_version: str, oclp_github_url: str):
408408
sizer = wx.BoxSizer(wx.VERTICAL)
409409
sizer.AddSpacer(10)
410410
self.title_text = wx.StaticText(panel, label=self.trans["A new version of OCLP-R is available!"])
411-
self.description = wx.StaticText(panel, label=self.trans[f"OCLP-R {oclp_version} is now available - You have {self.constants.patcher_version}. Would you like to update?"])
411+
self.description = wx.StaticText(panel, label=self.trans["OCLP-R {oclp_version} is now available - You have {patcher_version}. Would you like to update?"].format(oclp_version=oclp_version,patcher_version=self.constants.patcher_version))
412412
self.title_text.SetFont(gui_support.font_factory(19, wx.FONTWEIGHT_BOLD))
413413
self.description.SetFont(gui_support.font_factory(13, wx.FONTWEIGHT_NORMAL))
414414
self.web_view = wx.html2.WebView.New(panel, style=wx.BORDER_SUNKEN)

oclp_r/wx_gui/gui_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def _generate_elements(self, frame: wx.Frame = None) -> None:
109109

110110
tabs = list(self.settings.keys())
111111
if not Path("~/.hackdoc_developer").expanduser().exists():
112-
tabs.remove("Developer")
112+
tabs.remove(self.trans["Developer"])
113113
for tab in tabs:
114114
panel = wx.Panel(notebook)
115115
notebook.AddPage(panel, tab)

0 commit comments

Comments
 (0)