i18n DE/EN + DossierSettings panel + English file renames

i18n:
- src/i18n/de.json + en.json: 200+ keys covering all main panels
- src/i18n/index.js: t(key, vars) reads window.DOSSIER_LANG
- panel_base.py: injects window.DOSSIER_LANG from dossier_settings.json
- EbenenManager, GeschossManager, AusschnitteApp, LayoutsApp: all
  context menus and main labels use t()

DossierSettings panel:
- DossierSettingsApp.jsx: language toggle (DE/EN pill) + launcher status
- toolbar.py: OPEN_SETTINGS opens new Rhino-hosted satellite window,
  SAVE_LANG writes lang to dossier_settings.json + reloads all panels

File renames (JSX → English):
- ZeichnungsebenenApp → DrawingLevelsApp
- GeschossManager/Dialog/Settings → Floor*
- AusschnitteApp/Settings → Viewports*
- EbenenManager/Settings → Layer*
- GestaltungApp → StylesApp, OberleisteApp → ToolbarApp
- WerkzeugeApp → ToolsApp, DimensionenApp → DimensionsApp
- MassstabApp → ScaleApp, KameraApp → CameraApp
- MasseSettingsApp → UnitsSettingsApp
- ConfirmDeleteEbene → ConfirmDeleteLayer
- AusschnittLayerDialog → ViewportLayerDialog

Python module renames:
- rhinopanel.py → layers_panel.py
- oberleiste.py → toolbar.py
- gestaltung.py → styles.py
- werkzeuge.py → tools.py
- dimensionen.py → dimensions.py
- startup.py _MODULE_TO_PY updated, all cross-imports fixed
This commit is contained in:
2026-06-06 11:09:33 +02:00
parent 92b4baa285
commit 375487c10c
45 changed files with 998 additions and 148 deletions
+133
View File
@@ -0,0 +1,133 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2026 Karim Gabriele Varano
import { useEffect } from 'react'
import Icon from './components/Icon'
import { notifyReady, runRhinoCommand } from './lib/rhinoBridge'
// Tool-Definitionen: [icon, label, rhino-command, tooltip]
// Material-Symbol-Namen siehe https://fonts.google.com/icons
const TOOLS = {
'2D Zeichnen': [
['horizontal_rule', 'Line', '_Line', 'Linie zwischen zwei Punkten'],
['polyline', 'Polyline', '_Polyline', 'Polylinie'],
['rectangle', 'Rect', '_Rectangle', 'Rechteck'],
['radio_button_unchecked', 'Circle', '_Circle', 'Kreis'],
['network_intelligence', 'Arc', '_Arc', 'Bogen'],
['gesture', 'Curve', '_Curve', 'Freie Kurve (Spline)'],
['text_fields', 'Text', '_Text', 'Text'],
['grid_view', 'Hatch', '_Hatch', 'Schraffur'],
['straighten', 'Dim', '_Dim', 'Linearbemassung'],
],
'2D Editieren': [
['open_with', 'Move', '_Move', 'Verschieben'],
['content_copy', 'Copy', '_Copy', 'Kopieren'],
['rotate_right', 'Rotate', '_Rotate', 'Drehen'],
['aspect_ratio', 'Scale', '_Scale', 'Skalieren'],
['flip', 'Mirror', '_Mirror', 'Spiegeln'],
['padding', 'Offset', '_Offset', 'Parallelversatz'],
['content_cut', 'Trim', '_Trim', 'Stutzen'],
['swipe_right_alt', 'Extend', '_Extend', 'Verlängern'],
['link', 'Join', '_Join', 'Verbinden'],
['scatter_plot', 'Explode', '_Explode', 'Auflösen'],
['rounded_corner', 'Fillet', '_Fillet', 'Verrunden (Ecke abrunden)'],
['apps', 'Array', '_ArrayPolar','Polar-Array'],
],
'3D Modellieren': [
['vertical_align_top','Extrude', '_ExtrudeCrv', 'Kurve zu 3D extrudieren'],
['square', 'Box', '_Box', 'Quader'],
['join_inner', 'Union', '_BooleanUnion', 'Boolean-Vereinigung'],
['remove', 'Diff', '_BooleanDifference', 'Boolean-Differenz'],
['gradient', 'Intersect','_BooleanIntersection','Boolean-Schnittmenge'],
['roofing', 'Cap', '_Cap', 'Planare Loecher schliessen'],
['cut', 'Section', '_Section', 'Schnittlinien erzeugen'],
['unfold_more', 'Loft', '_Loft', 'Loft (Kurven verbinden)'],
],
'Auswahl': [
['add_link', 'Chain', '_SelChain', 'Tangentiale Kurvenkette wählen'],
['filter_alt', 'Dup', '_SelDup', 'Doppelte Objekte wählen'],
['loop', 'Closed', '_SelClosedCrv', 'Geschlossene Kurven wählen'],
['compare_arrows', 'Invert', '_Invert', 'Auswahl invertieren'],
['select_all', 'All', '_SelAll', 'Alle auswählen'],
['deselect', 'None', '_SelNone', 'Auswahl aufheben'],
],
}
// ---------------------------------------------------------------------------
function ToolPill({ icon, label, cmd, tip }) {
return (
<button
onClick={() => runRhinoCommand(cmd)}
title={`${tip} (${cmd})`}
onMouseEnter={(e) => {
e.currentTarget.style.borderColor = 'var(--accent)'
e.currentTarget.style.background = 'var(--bg-item-hover)'
}}
onMouseLeave={(e) => {
e.currentTarget.style.borderColor = 'var(--border-light)'
e.currentTarget.style.background = 'var(--bg-input)'
}}
style={{
display: 'flex', alignItems: 'center', gap: 6,
padding: '5px 10px 5px 8px',
background: 'var(--bg-input)',
border: '1px solid var(--border-light)',
borderRadius: 999,
cursor: 'pointer',
transition: 'background 0.1s, border-color 0.1s',
fontSize: 11, fontWeight: 500,
color: 'var(--text-primary)',
whiteSpace: 'nowrap',
appearance: 'none', WebkitAppearance: 'none',
}}
>
<Icon name={icon} size={14} style={{ color: 'var(--accent)', flexShrink: 0 }} />
<span>{label}</span>
</button>
)
}
function PillGroup({ label, children }) {
return (
<div style={{ display: 'flex', flexDirection: 'column', gap: 5 }}>
<span style={{
fontSize: 9, color: 'var(--text-muted)',
letterSpacing: '0.08em', textTransform: 'uppercase',
fontWeight: 600,
}}>
{label}
</span>
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 5 }}>
{children}
</div>
</div>
)
}
// ---------------------------------------------------------------------------
export default function WerkzeugeApp() {
useEffect(() => { notifyReady() }, [])
const groups = Object.entries(TOOLS)
return (
<div style={{
width: '100%', height: '100%',
display: 'flex', flexDirection: 'column', gap: 10,
padding: 10,
fontFamily: 'var(--font)', color: 'var(--text-primary)',
background: 'var(--bg-base)',
boxSizing: 'border-box',
overflowY: 'auto', overflowX: 'hidden',
}}>
{groups.map(([title, items]) => (
<PillGroup key={title} label={title}>
{items.map(([icon, label, cmd, tip]) => (
<ToolPill key={cmd} icon={icon} label={label} cmd={cmd} tip={tip} />
))}
</PillGroup>
))}
</div>
)
}