Translate Python log messages + fix rhinopanel import in PROJECTS

- startup.py: all user-visible messages translated to English
- panel_base.py: icon/rendering log messages translated
- toolbar.py: display mode check messages translated
- Global: Panel registered/opened/listener-active across all modules
- Fix: elemente.py and other files with stale 'import rhinopanel'
  were missing from PROJECTS sync — now properly copied
This commit is contained in:
2026-06-06 11:38:20 +02:00
parent 375487c10c
commit b9f661cdb3
16 changed files with 63 additions and 63 deletions
+27 -27
View File
@@ -29,7 +29,7 @@ if not sc.sticky.get("_dossier_startup_scheduled"):
import _startup_splash as _splash_first
_splash_first.show()
except Exception as _ex_splash:
print("[STARTUP] splash early:", _ex_splash)
print("[STARTUP] splash error:", _ex_splash)
# DIAGNOSE — welcher Python-Engine laeuft hier wirklich? Einmalig beim Start.
print("[STARTUP] Python: {}".format(sys.version))
@@ -107,7 +107,7 @@ def _assign_default_display_modes(doc):
try:
from Rhino.Display import DisplayModeDescription
except Exception as ex:
print("[STARTUP] view-modes: DMD nicht verfuegbar:", ex); return
print("[STARTUP] view-modes: DMD not available:", ex); return
# Mode-Lookup per Name
mode_plan = mode_3d = None
@@ -119,10 +119,10 @@ def _assign_default_display_modes(doc):
elif n == "Dossier 3D": mode_3d = dm
except Exception: pass
except Exception as ex:
print("[STARTUP] view-modes: Mode-List:", ex); return
print("[STARTUP] view-modes: mode list error:", ex); return
if mode_plan is None and mode_3d is None:
print("[STARTUP] view-modes: keine Dossier-Modes registriert — skip")
print("[STARTUP] view-modes: no Dossier display modes found — skip")
return
n_set = 0
@@ -150,7 +150,7 @@ def _assign_default_display_modes(doc):
try:
doc.Strings.SetString(_DOC_FLAG_VIEW_MODES, "1")
except Exception: pass
print("[STARTUP] view-modes: {} Viewport(s) gesetzt".format(n_set))
print("[STARTUP] view-modes: {} viewport(s) set".format(n_set))
_DOC_FLAG_VIEW_MAXIMIZED = "dossier_top_view_maximized"
@@ -176,15 +176,15 @@ def _maximize_top_view(doc):
break
except Exception: pass
if top_view is None:
print("[STARTUP] view-max: kein Top-Viewport gefunden")
print("[STARTUP] view-max: no Top viewport found")
return
try:
top_view.Maximized = True
doc.Views.ActiveView = top_view
doc.Views.Redraw()
print("[STARTUP] view-max: Top-Viewport maximiert")
print("[STARTUP] view-max: Top viewport maximized")
except Exception as ex:
print("[STARTUP] view-max set:", ex); return
print("[STARTUP] view-max set error:", ex); return
try:
doc.Strings.SetString(_DOC_FLAG_VIEW_MAXIMIZED, "1")
except Exception: pass
@@ -213,7 +213,7 @@ def _check_doc_unit(doc):
target_unit_str = rhinopanel.get_project_unit(doc)
target_unit_enum = rhinopanel.get_project_unit_enum(doc)
except Exception as ex:
print("[STARTUP] unit-check: project-setting lesen:", ex)
print("[STARTUP] unit-check: project setting read error:", ex)
return
if target_unit_enum is None: return
try:
@@ -255,9 +255,9 @@ def _check_doc_unit(doc):
except Exception as ex:
print("[STARTUP] unit-convert RunScript:", ex)
else:
print("[STARTUP] User hat Unit-Umstellung verweigertDoc bleibt {}".format(current))
print("[STARTUP] User declined unit changedoc stays {}".format(current))
except Exception as ex:
print("[STARTUP] unit-check dialog:", ex)
print("[STARTUP] unit-check dialog error:", ex)
def _on_doc_opened(sender, e):
@@ -281,9 +281,9 @@ def _hint_dossier_ui():
manuell laden kann. Rhino merkt sich die Anordnung dann persistent."""
if not os.path.isfile(_UI_FILE):
return
print("[STARTUP] DOSSIERUI gefunden: {}".format(_UI_FILE))
print("[STARTUP] Einmalig laden: Window -> Window Layout -> Open -> obige Datei")
print("[STARTUP] Anordnung bleibt danach ueber Rhino-Restarts erhalten.")
print("[STARTUP] DOSSIERUI found: {}".format(_UI_FILE))
print("[STARTUP] Load once: Window -> Window Layout -> Open -> file above")
print("[STARTUP] Layout persists across Rhino restarts.")
def _load_all(sender, e):
@@ -293,7 +293,7 @@ def _load_all(sender, e):
except Exception:
pass
# Splash wird ganz oben in startup.py (vor diesem Idle) gezeigt.
print("[STARTUP] Lade DOSSIER-Panels...")
print("[STARTUP] Loading DOSSIER panels...")
# Migration einmal fuer das beim Start aktive Doc
_migrate_active_doc()
# Und Listener fuer spaeter geoeffnete Docs registrieren
@@ -311,13 +311,13 @@ def _load_all(sender, e):
if config and isinstance(config.get("modules"), list):
enabled_ids = [m for m in config["modules"] if m in _MODULE_TO_PY]
unknown = [m for m in config["modules"] if m not in _MODULE_TO_PY]
print("[STARTUP] Projekt: '{}'".format(config.get("name") or "?"))
print("[STARTUP] Aktivierte Module: {}".format(", ".join(enabled_ids) or "(keine)"))
print("[STARTUP] Project: '{}'".format(config.get("name") or "?"))
print("[STARTUP] Active modules: {}".format(", ".join(enabled_ids) or "(keine)"))
if unknown:
print("[STARTUP] Unbekannte Modul-IDs in Config: {}".format(unknown))
print("[STARTUP] Unknown module IDs in config: {}".format(unknown))
else:
enabled_ids = _ALL_MODULES
print("[STARTUP] Keine dossier.project.json — alle Module laden")
print("[STARTUP] No dossier.project.json — loading all modules")
# massstab.py wird als Library mitgeladen (von oberleiste/ausschnitte/...)
# und braucht hier nicht mehr als eigenstaendiges Panel zu erscheinen.
# Imports messen — das ist der grosse Block der bisher unmeasured war
@@ -331,7 +331,7 @@ def _load_all(sender, e):
_pb._t_mark("import", mod_id, _t_imp)
print("[STARTUP] {} ({}) OK".format(mod_id, py_name))
except Exception as ex:
print("[STARTUP] {} ({}) FEHLER: {}".format(mod_id, py_name, ex))
print("[STARTUP] {} ({}) ERROR: {}".format(mod_id, py_name, ex))
# Text-Editor Doppelklick-Hook fuer DOSSIER-Texte
_t_te = _t.time()
try:
@@ -346,7 +346,7 @@ def _load_all(sender, e):
_assign_default_display_modes(Rhino.RhinoDoc.ActiveDoc)
_pb._t_mark("post_init", "view_modes", _t_vm)
except Exception as ex:
print("[STARTUP] view-modes assign:", ex)
print("[STARTUP] view-modes assign error:", ex)
# Top-View maximieren (= einzige aktive View statt 4-View Default)
try:
_maximize_top_view(Rhino.RhinoDoc.ActiveDoc)
@@ -359,7 +359,7 @@ def _load_all(sender, e):
_check_doc_unit(Rhino.RhinoDoc.ActiveDoc)
_pb._t_mark("post_init", "unit_check", _t_uc)
except Exception as ex:
print("[STARTUP] unit-check active doc:", ex)
print("[STARTUP] unit-check active doc error:", ex)
# Aliases + Shortcuts (Defaults aus rhino/aliases/shortcuts_default.json
# + User-Overrides aus dossier_settings.json) registrieren. Idempotent —
# SetMacro/SetMacro ueberschreibt vorhandene Eintraege. Wenn Bridge noch
@@ -374,7 +374,7 @@ def _load_all(sender, e):
.format(_na, _nf, _nc, _ns))
_pb._t_mark("post_init", "aliases", _t_al)
except Exception as ex:
print("[STARTUP] alias-loader:", ex)
print("[STARTUP] alias-loader error:", ex)
# BeginCommand-Hook: Gestaltung-Panel oeffnen bei Drawing-Commands
try:
import begin_cmd_hook
@@ -413,18 +413,18 @@ def _load_all(sender, e):
with open(os.path.join(marker_dir, "plugin_loaded.flag"), "w") as f:
f.write("ok")
except Exception as ex:
print("[STARTUP] marker schreiben:", ex)
print("[STARTUP] marker write error:", ex)
import threading
threading.Timer(2.0, _write_marker).start()
print("[STARTUP] Fertig")
print("[STARTUP] Done")
# Idempotency-Guard: wenn beide Pfade gleichzeitig feuern (C#-Plugin OnLoad
# UND legacy StartupCommands-XML), nur das erste registriert den Idle-Loader.
# Verhindert doppelte Panel-Registrierung + doppelte Listener.
if sc.sticky.get("_dossier_startup_scheduled"):
print("[STARTUP] schon geplant — skip (parallel-aufruf)")
print("[STARTUP] already scheduled — skip (parallel call)")
else:
sc.sticky["_dossier_startup_scheduled"] = True
Rhino.RhinoApp.Idle += _load_all
print("[STARTUP] geplant - laedt sobald Rhino idle ist")
print("[STARTUP] scheduled — loads when Rhino is idle")