added translation tab

This commit is contained in:
2026-05-22 16:20:00 +02:00
parent c86768e391
commit 0291b8be7a
10 changed files with 1227 additions and 246 deletions

View File

@ -15,6 +15,12 @@
--shadow-lg: 0 4px 12px rgba(0,0,0,.1);
--sidebar-width: 240px;
--font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
/* Incomplete translation highlight (neutral, not yellow) */
--trans-missing-bg: #f8fafc;
--trans-missing-bg-hover: #f1f5f9;
--trans-missing-border: #cbd5e1;
--trans-missing-accent: #64748b;
--trans-missing-placeholder: #94a3b8;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
@ -740,6 +746,204 @@ th.sort-desc::after { content: ' \2193'; opacity: 1; }
transform: rotate(90deg);
}
/* ── Translations page ── */
.trans-page { padding: 20px 24px; }
.trans-controls {
display: flex;
flex-wrap: wrap;
gap: 16px 24px;
margin-bottom: 16px;
}
.trans-control {
display: flex;
flex-direction: column;
gap: 6px;
flex: 1;
min-width: 200px;
max-width: 360px;
font-size: .85rem;
color: var(--text-secondary);
}
.trans-control span { font-weight: 500; }
.trans-select {
padding: 8px 12px;
border: 1px solid var(--border);
border-radius: 6px;
font-size: .9rem;
font-family: var(--font);
background: var(--surface);
}
.trans-select:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.trans-type-select { width: auto; min-width: 140px; flex-shrink: 0; }
.trans-lang-panel {
margin-bottom: 16px;
padding: 12px 14px;
background: #f8fafc;
border: 1px solid var(--border);
border-radius: var(--radius);
}
.trans-lang-panel summary {
cursor: pointer;
font-weight: 600;
font-size: .9rem;
color: var(--text);
user-select: none;
}
.trans-lang-panel[open] summary { margin-bottom: 12px; }
.trans-lang-panel .lang-chips { margin-bottom: 10px; }
.trans-hint { padding: 24px 0; text-align: center; font-size: .9rem; }
.text-muted { color: var(--text-secondary); }
.required-mark { color: var(--danger); font-weight: 600; }
.trans-list-header {
display: grid;
grid-template-columns: minmax(100px, 0.75fr) 1fr 1fr;
gap: 12px;
padding: 8px 14px;
font-size: .75rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: .04em;
color: var(--text-secondary);
background: #f1f5f9;
border: 1px solid var(--border);
border-bottom: none;
border-radius: var(--radius) var(--radius) 0 0;
}
.trans-qn-block {
margin-bottom: 28px;
padding-bottom: 8px;
border-bottom: 1px solid var(--border);
}
.trans-qn-block:last-child { border-bottom: none; margin-bottom: 0; }
.trans-qn-hidden { display: none !important; }
.trans-qn-title {
font-size: 1.05rem;
font-weight: 600;
color: var(--text);
margin: 0 0 14px;
}
.trans-group {
margin-bottom: 18px;
}
.trans-group-hidden { display: none !important; }
.trans-group-title {
font-size: .8rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: .04em;
color: var(--text-secondary);
margin: 0 0 8px;
padding-bottom: 6px;
border-bottom: 1px solid #e2e8f0;
}
.trans-groups-wrap .trans-list-header { margin-top: 0; }
.trans-list-in-group {
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
}
#transGroupedRoot {
max-height: calc(100vh - 360px);
overflow-y: auto;
}
.trans-list {
border: 1px solid var(--border);
border-radius: 0 0 var(--radius) var(--radius);
max-height: calc(100vh - 360px);
overflow-y: auto;
}
.trans-list-item {
display: grid;
grid-template-columns: minmax(100px, 0.75fr) 1fr 1fr;
gap: 12px;
align-items: center;
padding: 10px 14px;
border-bottom: 1px solid #f1f5f9;
}
.trans-list-item:last-child { border-bottom: none; }
.trans-list-item:hover { background: #f8fafc; }
.trans-list-item-missing {
background: var(--trans-missing-bg);
box-shadow: inset 3px 0 0 var(--trans-missing-accent);
}
.trans-list-item-missing:hover { background: var(--trans-missing-bg-hover); }
.trans-list-key {
display: flex;
align-items: flex-start;
gap: 6px;
min-width: 0;
}
.trans-key-text {
font-family: monospace;
font-size: .8rem;
line-height: 1.35;
color: var(--text-secondary);
word-break: break-word;
}
.trans-list-source {
min-width: 0;
}
.trans-source-text {
display: block;
font-size: .9rem;
line-height: 1.4;
color: var(--text);
word-break: break-word;
}
.lang-chip-fixed {
background: #dbeafe;
border-color: #93c5fd;
}
.trans-list-item .trans-cell-input {
border: 1px solid var(--border);
background: var(--surface);
border-radius: 6px;
padding: 8px 10px;
}
.trans-input-missing {
border-color: var(--trans-missing-border) !important;
background: var(--surface) !important;
box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.12);
}
.trans-input-missing::placeholder {
color: var(--trans-missing-placeholder);
font-style: normal;
}
@media (max-width: 768px) {
.trans-list-header,
.trans-list-item {
grid-template-columns: 1fr;
gap: 6px;
}
.trans-list-header { display: none; }
.trans-list-item .trans-list-key::before {
content: 'Key';
display: block;
font-size: .7rem;
font-weight: 600;
text-transform: uppercase;
color: var(--text-secondary);
margin-bottom: 2px;
}
.trans-list-item .trans-list-source::before {
content: 'German';
display: block;
font-size: .7rem;
font-weight: 600;
text-transform: uppercase;
color: var(--text-secondary);
margin-bottom: 2px;
}
.trans-list-item .trans-cell-input[data-field="translation"] {
margin-top: 4px;
}
}
/* ── Language manager ── */
.lang-manager {
background: #f8fafc;
@ -849,7 +1053,11 @@ th.sort-desc::after { content: ' \2193'; opacity: 1; }
.trans-table td { padding: 2px 4px; }
.trans-table tbody tr { border-bottom: 1px solid #f1f5f9; }
.trans-table tbody tr:hover { background: #f8fafc; }
.trans-row-hidden { display: none; }
.trans-row-hidden { display: none !important; }
#tabContent-translations .trans-list,
#tabContent-translations .trans-list-header {
margin-top: 0;
}
.col-key { min-width: 180px; }
.col-type { width: 50px; text-align: center; }
@ -876,11 +1084,11 @@ th.sort-desc::after { content: ' \2193'; opacity: 1; }
letter-spacing: .3px;
}
.badge-q { background: #dbeafe; color: #1e40af; }
.badge-opt { background: #fef3c7; color: #92400e; }
.badge-opt { background: #e2e8f0; color: #475569; }
.badge-str { background: #ede9fe; color: #5b21b6; }
.cell-trans { position: relative; }
.cell-missing { background: #fff7ed; }
.cell-missing { background: var(--trans-missing-bg); }
.trans-cell-input {
width: 100%;
@ -903,16 +1111,22 @@ th.sort-desc::after { content: ' \2193'; opacity: 1; }
box-shadow: 0 0 0 2px rgba(37,99,235,.1);
}
.trans-cell-input::placeholder {
color: #f59e0b;
font-style: italic;
color: var(--trans-missing-placeholder);
font-style: normal;
font-size: .8rem;
}
.trans-cell-input:not(.trans-input-missing)::placeholder {
color: var(--text-secondary);
}
.trans-cell-input.save-flash {
animation: saveFlash .4s ease;
}
@keyframes saveFlash {
0% { background: #dcfce7; }
100% { background: transparent; }
0% { background: #dbeafe; }
100% { background: var(--surface); }
}
.trans-list-item .trans-cell-input.save-flash {
animation: saveFlash .4s ease;
}
/* ── Stats bar ── */