Skip to content

Commit c09dc4e

Browse files
committed
add more translations
1 parent 80b8adf commit c09dc4e

36 files changed

+1829
-1134
lines changed

PRIVACY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ Users who wish to opt-out can do so either via the application's preferences or
2222
defaults write com.dortania.opencore-legacy-patcher DisableCrashAndAnalyticsReporting -bool true
2323
```
2424

25-
To have your data removed, please contact us via our [Discord server](https://discord.gg/rqdPgH8xSN) and provide the UUID of your system.
25+
To have your data removed, please contact us via our [Discord server](https://discord.gg/rqdPgH8xSN) and provide the UUID of your system.
26+

ci_tooling/build_modules/disk_images.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def _generate_payloads_dmg(self):
7676
'/usr/bin/hdiutil', 'create', './payloads.dmg',
7777
'-megabytes', '32000', # Overlays can only be as large as the disk image allows
7878
'-format', 'UDZO', '-ov',
79-
'-volname', 'OpenCore Patcher Resources (Base)',
79+
'-volname', 'OCLP-R Resources (Base)',
8080
'-fs', 'HFS+',
8181
'-layout', 'NONE',
8282
'-srcfolder', './payloads',

oclp_r/application_entry.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
logging_handler,
2828
analytics_handler
2929
)
30-
30+
from .support.translate_language import TranslateLanguage
3131

3232
class OpenCoreLegacyPatcher:
3333
"""
@@ -36,6 +36,7 @@ class OpenCoreLegacyPatcher:
3636

3737
def __init__(self) -> None:
3838
self.constants: constants.Constants = constants.Constants()
39+
self.trans: dict = TranslateLanguage(self.constants).application_entry()
3940

4041
logging_handler.InitializeLoggingSupport(self.constants)
4142

@@ -52,11 +53,11 @@ def _fix_cwd(self) -> None:
5253
_test_dir = None
5354
try:
5455
_test_dir = Path.cwd()
55-
logging.info(f"Current working directory: {_test_dir}")
56+
logging.info(f"{self.trans['Current working directory:']} {_test_dir}")
5657
except FileNotFoundError:
5758
_test_dir = Path(__file__).parent.parent.resolve()
5859
os.chdir(_test_dir)
59-
logging.warning(f"Current working directory was invalid, switched to: {_test_dir}")
60+
logging.warning(f"{self.trans['Current working directory was invalid, switched to:']} {_test_dir}")
6061

6162

6263
def _generate_base_data(self) -> None:
@@ -120,7 +121,7 @@ def _generate_base_data(self) -> None:
120121
self.constants.cli_mode = False
121122
return
122123

123-
logging.info("Detected arguments, switching to CLI mode")
124+
logging.info(self.trans["Detected arguments, switching to CLI mode"])
124125
self.constants.gui_mode = True # Assumes no user interaction is required
125126

126127
ignore_args = ["--auto_patch", "--gui_patch", "--gui_unpatch", "--update_installed"]

oclp_r/efi_builder/bluetooth.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
smbios_data,
1717
bluetooth_data
1818
)
19-
19+
from ..support.translate_language import TranslateLanguage_efi_builder
2020

2121
class BuildBluetooth:
2222
"""
@@ -26,6 +26,7 @@ class BuildBluetooth:
2626
"""
2727

2828
def __init__(self, model: str, global_constants: constants.Constants, config: dict) -> None:
29+
self.trans = TranslateLanguage_efi_builder(global_constants=global_constants).bluetooth()
2930
self.model: str = model
3031
self.config: dict = config
3132
self.constants: constants.Constants = global_constants
@@ -60,7 +61,7 @@ def _on_model(self) -> None:
6061
On-Model Hardware Detection Handling
6162
"""
6263
if self.computer.bluetooth_chipset in ["BRCM2070 Hub", "BRCM2046 Hub"]:
63-
logging.info("- Fixing Legacy Bluetooth for macOS Monterey")
64+
logging.info(self.trans["- Fixing Legacy Bluetooth for macOS Monterey"])
6465
support.BuildSupport(self.model, self.constants, self.config).enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path)
6566
support.BuildSupport(self.model, self.constants, self.config).enable_kext("Bluetooth-Spoof.kext", self.constants.btspoof_version, self.constants.btspoof_path)
6667
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -btlfxallowanyaddr"
@@ -71,19 +72,19 @@ def _on_model(self) -> None:
7172
# Due to this, BlueToolFixup is required to resolve Firmware Uploading on legacy chipsets
7273
if self.computer.wifi:
7374
if self.computer.wifi.chipset == device_probe.Broadcom.Chipsets.AirPortBrcm4360:
74-
logging.info("- Fixing Legacy Bluetooth for macOS Monterey")
75+
logging.info(self.trans["- Fixing Legacy Bluetooth for macOS Monterey"])
7576
support.BuildSupport(self.model, self.constants, self.config).enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path)
7677

7778
# Older Mac firmwares (pre-2012) don't support the new chipsets correctly (regardless of WiFi card)
7879
if self.model in smbios_data.smbios_dictionary:
7980
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] < cpu_data.CPUGen.ivy_bridge.value:
80-
logging.info("- Fixing Legacy Bluetooth for macOS Monterey")
81+
logging.info(self.trans["- Fixing Legacy Bluetooth for macOS Monterey"])
8182
support.BuildSupport(self.model, self.constants, self.config).enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path)
8283
self._bluetooth_firmware_incompatibility_workaround()
8384
elif self.computer.bluetooth_chipset == "3rd Party Bluetooth 4.0 Hub":
84-
logging.info("- Detected 3rd Party Bluetooth Chipset")
85+
logging.info(self.trans["- Detected 3rd Party Bluetooth Chipset"])
8586
support.BuildSupport(self.model, self.constants, self.config).enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path)
86-
logging.info("- Enabling Bluetooth FeatureFlags")
87+
logging.info(self.trans["- Enabling Bluetooth FeatureFlags"])
8788
self.config["Kernel"]["Quirks"]["ExtendBTFeatureFlags"] = True
8889

8990

@@ -98,7 +99,7 @@ def _prebuilt_assumption(self) -> None:
9899
return
99100

100101
if smbios_data.smbios_dictionary[self.model]["Bluetooth Model"] <= bluetooth_data.bluetooth_data.BRCM20702_v1.value:
101-
logging.info("- Fixing Legacy Bluetooth for macOS Monterey")
102+
logging.info(self.trans["- Fixing Legacy Bluetooth for macOS Monterey"])
102103
support.BuildSupport(self.model, self.constants, self.config).enable_kext("BlueToolFixup.kext", self.constants.bluetool_version, self.constants.bluetool_path)
103104
if smbios_data.smbios_dictionary[self.model]["Bluetooth Model"] <= bluetooth_data.bluetooth_data.BRCM2070.value:
104105
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -btlfxallowanyaddr"

oclp_r/efi_builder/build.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
security,
3131
misc
3232
)
33-
33+
from ..support.translate_language import TranslateLanguage_efi_builder
3434

3535
def rmtree_handler(func, path, exc_info) -> None:
3636
if exc_info[0] == FileNotFoundError:
@@ -45,6 +45,7 @@ class BuildOpenCore:
4545
"""
4646

4747
def __init__(self, model: str, global_constants: constants.Constants) -> None:
48+
self.trans = TranslateLanguage_efi_builder(global_constants=global_constants).build()
4849
self.model: str = model
4950
self.config: dict = None
5051
self.constants: constants.Constants = global_constants
@@ -58,7 +59,7 @@ def _build_efi(self) -> None:
5859
"""
5960

6061
utilities.cls()
61-
logging.info(f"Building Configuration {'for external' if self.constants.custom_model else 'on model'}: {self.model}")
62+
logging.info(self.trans["Building Configuration {0} model: {1}"].format('for external' if self.constants.custom_model else 'on model', self.model))
6263

6364
self._generate_base()
6465
self._set_revision()
@@ -86,7 +87,7 @@ def _build_efi(self) -> None:
8687

8788
# Work-around ocvalidate
8889
if self.constants.validate is False:
89-
logging.info("- Adding bootmgfw.efi BlessOverride")
90+
logging.info(self.trans["- Adding bootmgfw.efi BlessOverride"])
9091
self.config["Misc"]["BlessOverride"] += ["\\EFI\\Microsoft\\Boot\\bootmgfw.efi"]
9192

9293

@@ -96,25 +97,25 @@ def _generate_base(self) -> None:
9697
"""
9798

9899
if not Path(self.constants.build_path).exists():
99-
logging.info("Creating build folder")
100+
logging.info(self.trans["Creating build folder"])
100101
Path(self.constants.build_path).mkdir()
101102
else:
102-
logging.info("Build folder already present, skipping")
103+
logging.info(self.trans["Build folder already present, skipping"])
103104

104105
if Path(self.constants.opencore_zip_copied).exists():
105-
logging.info("Deleting old copy of OpenCore zip")
106+
logging.info(self.trans["Deleting old copy of OpenCore zip"])
106107
Path(self.constants.opencore_zip_copied).unlink()
107108
if Path(self.constants.opencore_release_folder).exists():
108-
logging.info("Deleting old copy of OpenCore folder")
109+
logging.info(self.trans["Deleting old copy of OpenCore folder"])
109110
shutil.rmtree(self.constants.opencore_release_folder, onerror=rmtree_handler, ignore_errors=True)
110111

111112
logging.info("")
112-
logging.info(f"- Adding OpenCore v{self.constants.opencore_version} {'DEBUG' if self.constants.opencore_debug is True else 'RELEASE'}")
113+
logging.info(self.trans["- Adding OpenCore v{0} {1}"].format(self.constants.opencore_version, 'DEBUG' if self.constants.opencore_debug is True else 'RELEASE'))
113114
shutil.copy(self.constants.opencore_zip_source, self.constants.build_path)
114115
zipfile.ZipFile(self.constants.opencore_zip_copied).extractall(self.constants.build_path)
115116

116117
# Setup config.plist for editing
117-
logging.info("- Adding config.plist for OpenCore")
118+
logging.info(self.trans["- Adding config.plist for OpenCore"])
118119
shutil.copy(self.constants.plist_template, self.constants.oc_folder)
119120
self.config = plistlib.load(Path(self.constants.plist_path).open("rb"))
120121

@@ -169,6 +170,6 @@ def _build_opencore(self) -> None:
169170
support.BuildSupport(self.model, self.constants, self.config).validate_pathing()
170171

171172
logging.info("")
172-
logging.info(f"Your OpenCore EFI for {self.model} has been built at:")
173-
logging.info(f" {self.constants.opencore_release_folder}")
173+
logging.info(self.trans["Your OpenCore EFI for {0} has been built at:"].format(self.model))
174+
logging.info(self.trans[" {0}"].format(self.constants.opencore_release_folder))
174175
logging.info("")

0 commit comments

Comments
 (0)