Skip to content

Commit fcecfd0

Browse files
committed
Request: Parley w/dfgHiatus's "Please use our new locale system for text!"
1 parent f9e37fa commit fcecfd0

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

BabbleApp/Locale/English/locale.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@
3535
"error.frame": "Problem while getting frame",
3636
"error.size": "Size of frames to display are of unequal sizes",
3737
"error.capture": "Frame capture issue detected",
38+
"error.winmm": "Failed to load winmm",
3839
"warn.frameDrop": "Frame drop. Corrupted JPEG",
3940
"warn.captureProblem": "Capture source problem, assuming camera disconnected, waiting for reconnect",
4041
"warn.serialCapture": "Serial capture source problem, assuming camera disconnected, waiting for reconnect",
4142
"warn.backpressure1": "CAPTURE QUEUE BACKPRESSURE OF",
4243
"warn.backpressure2": "CHECK FOR CRASH OR TIMING ISSUES IN ALGORITHM",
4344
"warn.oneEuroValues": "OneEuroFilter values must be a legal number",
45+
"warn.timerRes": "Failed to set timer resolution:",
4446
"info.moveToTrackingMode": "Moving to tracking mode",
4547
"info.moveToROIMode": "Moving to ROI mode",
4648
"info.setROI": "Set ROI",

BabbleApp/Locale/OwO/locale.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@
3535
"error.frame": "Problem while getting frame",
3636
"error.size": "Size of frames to display are of unequal sizes",
3737
"error.capture": "Frame capture issue detected",
38+
"error.winmmDll": "Faiwed to woad winmm",
3839
"warn.frameDrop": "Frame drop. Corrupted JPEG",
3940
"warn.captureProblem": "Capture source problem, assuming camera disconnected, waiting for reconnect",
4041
"warn.serialCapture": "Serial capture source problem, assuming camera disconnected, waiting for reconnect",
4142
"warn.backpressure1": "CAPTURE QUEUE BACKPRESSURE OF",
4243
"warn.backpressure2": "CHECK FOR CRASH OR TIMING ISSUES IN ALGORITHM",
4344
"warn.oneEuroValues": "OneEuroFilter values must be a legal number",
45+
"warn.timerRes": "Faiwed to set timew wesowution:",
4446
"info.moveToTrackingMode": "Moving to tracking mode",
4547
"info.moveToROIMode": "Moving to ROI mode",
4648
"info.setROI": "Set ROI",

BabbleApp/Locale/Pirate Speak/locale.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@
3535
"error.frame": "Problem while getting frame",
3636
"error.size": "Size of frames to display are of unequal sizes",
3737
"error.capture": "Frame capture issue detected",
38+
"error.winmmDll": "We be failin' to load th' winmm, matey!",
3839
"warn.frameDrop": "Frame drop. Corrupted JPEG",
3940
"warn.captureProblem": "Capture source problem, assuming camera disconnected, waiting for reconnect",
4041
"warn.serialCapture": "Serial capture source problem, assuming camera disconnected, waiting for reconnect",
4142
"warn.backpressure1": "CAPTURE QUEUE BACKPRESSURE OF",
4243
"warn.backpressure2": "CHECK FOR CRASH OR TIMING ISSUES IN ALGORITHM",
4344
"warn.oneEuroValues": "OneEuroFilter values must be a legal number",
45+
"warn.timerRes": "We be failin' to set th' timer resolution:",
4446
"info.moveToTrackingMode": "Moving to tracking mode",
4547
"info.moveToROIMode": "Moving to ROI mode",
4648
"info.setROI": "Set ROI",

BabbleApp/babbleapp.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,16 @@
3333
from utils.misc_utils import EnsurePath, is_nt, bg_color_highlight, bg_color_clear
3434
from lang_manager import LocaleStringManager as lang
3535

36+
winmm = None
37+
3638
if is_nt:
3739
from winotify import Notification
40+
try:
41+
winmm = windll.winmm
42+
except OSError:
43+
print(f'\033[91m[{lang._instance.get_string("log.error")}] {lang._instance.get_string("error.winmm")}.\033[0m')
3844
os.system("color") # init ANSI color
3945

40-
winmm = None
41-
try:
42-
winmm = windll.winmm
43-
except OSError:
44-
#print("[DEBUG] Failed to load winmm.dll")
45-
pass
46-
4746
# Random environment variable to speed up webcam opening on the MSMF backend.
4847
# https://github.com/opencv/opencv/issues/17687
4948
os.environ["OPENCV_VIDEOIO_MSMF_ENABLE_HW_TRANSFORMS"] = "0"
@@ -67,7 +66,7 @@ def timerResolution(toggle):
6766
rc = c_int(winmm.timeBeginPeriod(1))
6867
if rc.value != 0:
6968
# TIMEERR_NOCANDO = 97
70-
print(f"[WARN] Failed to set timer resolution: {rc.value}")
69+
print(f'\033[93m[{lang._instance.get_string("log.warn")}] {lang._instance.get_string("warn.timerRes")} {rc.value}\033[0m')
7170
else:
7271
winmm.timeEndPeriod(1)
7372

0 commit comments

Comments
 (0)