git-status übersetzt, fehlender key "st.cleanable"

- Git-Zeile auf Karten/Liste wird clientseitig aus den Rohdaten des
  Servers gebaut (dirty/ahead/behind/remote/upstream) und übersetzt –
  vorher blieb sie auch in der englischen Oberfläche deutsch.
- Speicher-Ansicht: Kennzahl "Aufräumbar" zeigte den rohen Key
  "st.cleanable" (fehlte im Wörterbuch).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-24 21:21:05 +01:00
parent b481488f72
commit bf6bbf0169
2 changed files with 35 additions and 4 deletions

View File

@@ -115,8 +115,21 @@ function factsHtml(p) {
} }
function gitHtml(git, short = false) { function gitHtml(git, short = false) {
const label = short ? t('git.' + git.level) : git.label const label = short ? t('git.' + git.level) : gitLabel(git)
return `<span class="git ${git.level}" title="${escapeHtml(git.label)}">${ic(GIT_ICON[git.level], 'sm')}<span class="gl">${escapeHtml(label)}</span></span>` return `<span class="git ${git.level}" title="${escapeHtml(gitLabel(git))}">${ic(GIT_ICON[git.level], 'sm')}<span class="gl">${escapeHtml(label)}</span></span>`
}
// Git status line in the current language, built from the server's raw fields (lib/git.js)
function gitLabel(g) {
if (!g) return ''
if (!g.isRepo) return t('gitl.noGit')
if (g.label === 'Git nicht installiert') return t('gitl.notInstalled')
const parts = []
if (g.dirty) parts.push(t('gitl.changed', { n: g.dirty }))
if (g.ahead) parts.push(t('gitl.unpushed', { n: g.ahead }))
if (g.behind) parts.push(t('gitl.behind', { n: g.behind }))
if (!g.remote) return [t('gitl.noRemote'), ...parts].join(' · ')
if (!g.upstream) return [t('gitl.noUpstream'), ...parts].join(' · ')
return parts.length ? parts.join(' · ') : t('gitl.saved')
} }
// Backup state of one project (p.lastBackup from the server: own or full backup, newer one) // Backup state of one project (p.lastBackup from the server: own or full backup, newer one)
@@ -1473,7 +1486,7 @@ function rowHtml(p) {
${rootTag(p, true)} ${rootTag(p, true)}
<span class="rsize" title="${escapeHtml(sizeTitle(p))}">${ic('folder', 'sm')}${p.storage?.sizeMB != null ? fmtMB(p.storage.sizeMB) : '–'}</span> <span class="rsize" title="${escapeHtml(sizeTitle(p))}">${ic('folder', 'sm')}${p.storage?.sizeMB != null ? fmtMB(p.storage.sizeMB) : '–'}</span>
<span class="rdate" title="${escapeHtml(changeTitle(p))}">${ic('file-pen', 'sm')}<span class="dl">${fmtDate(lastActivity(p))}</span><span class="ds">${fmtDate(lastActivity(p), false)}</span></span> <span class="rdate" title="${escapeHtml(changeTitle(p))}">${ic('file-pen', 'sm')}<span class="dl">${fmtDate(lastActivity(p))}</span><span class="ds">${fmtDate(lastActivity(p), false)}</span></span>
<span class="ri ${p.git.level}" title="Git: ${escapeHtml(p.git.label)}">${ic(GIT_ICON[p.git.level], 'sm')}</span> <span class="ri ${p.git.level}" title="Git: ${escapeHtml(gitLabel(p.git))}">${ic(GIT_ICON[p.git.level], 'sm')}</span>
<span class="ri ${c.level}" title="${escapeHtml(c.label)}">${ic('hard-drive', 'sm')}</span> <span class="ri ${c.level}" title="${escapeHtml(c.label)}">${ic('hard-drive', 'sm')}</span>
${open ? `<span class="ri tasks" title="${t('tasks.openN', { n: open })}">${ic('list-checks', 'sm')}${open}</span>` : ''} ${open ? `<span class="ri tasks" title="${t('tasks.openN', { n: open })}">${ic('list-checks', 'sm')}${open}</span>` : ''}
${p.published ? `<a class="ri pub" href="${escapeHtml(p.published.url)}" target="_blank" draggable="false" onclick="event.stopPropagation()" title="${escapeHtml(pubTitle(p))}">${ic('rocket', 'sm')}</a>` : ''} ${p.published ? `<a class="ri pub" href="${escapeHtml(p.published.url)}" target="_blank" draggable="false" onclick="event.stopPropagation()" title="${escapeHtml(pubTitle(p))}">${ic('rocket', 'sm')}</a>` : ''}
@@ -1562,7 +1575,7 @@ function renderGallery() {
<img loading="lazy" class="${p.hasIcon ? '' : 'photo'}" src="${thumbUrl(p.name)}" alt="" onerror="this.remove()"> <img loading="lazy" class="${p.hasIcon ? '' : 'photo'}" src="${thumbUrl(p.name)}" alt="" onerror="this.remove()">
${statusHtml(p.status)} ${statusHtml(p.status)}
${favBtn(p, 'onthumb')} ${favBtn(p, 'onthumb')}
<span class="tbadges">${pubBadge(p)}${cloudBadge(p)}<span class="tbadge ${p.git.level}" title="Git: ${escapeHtml(p.git.label)}">${ic(GIT_ICON[p.git.level])}</span></span> <span class="tbadges">${pubBadge(p)}${cloudBadge(p)}<span class="tbadge ${p.git.level}" title="Git: ${escapeHtml(gitLabel(p.git))}">${ic(GIT_ICON[p.git.level])}</span></span>
</div> </div>
<div class="info"> <div class="info">
<div class="ghead"><div class="name">${escapeHtml(p.name)}</div>${qsGroup(p, false, true)}</div> <div class="ghead"><div class="name">${escapeHtml(p.name)}</div>${qsGroup(p, false, true)}</div>

View File

@@ -261,6 +261,14 @@ window.LANG = {
'git.green': 'Backed up', 'git.green': 'Backed up',
'git.yellow': 'Not backed up', 'git.yellow': 'Not backed up',
'git.red': 'No remote', 'git.red': 'No remote',
'gitl.noGit': 'no Git',
'gitl.notInstalled': 'Git not installed',
'gitl.changed': '{n} changed',
'gitl.unpushed': '{n} not pushed',
'gitl.behind': '{n} behind',
'gitl.noRemote': 'no remote (local only)',
'gitl.noUpstream': 'no upstream',
'gitl.saved': 'pushed',
'cloud.never': 'never', 'cloud.never': 'never',
'cloud.neverLong': 'Backup: never backed up', 'cloud.neverLong': 'Backup: never backed up',
'cloud.incomplete': 'incomplete', 'cloud.incomplete': 'incomplete',
@@ -631,6 +639,7 @@ window.LANG = {
'st.inside': 'of it {s}', 'st.inside': 'of it {s}',
'st.clickSub': 'Click: subfolders', 'st.clickSub': 'Click: subfolders',
'st.used': 'Used', 'st.used': 'Used',
'st.cleanable': 'Cleanable',
'st.nMeasured': '{n} projects measured', 'st.nMeasured': '{n} projects measured',
'st.cleanableShare': 'Cleanable share', 'st.cleanableShare': 'Cleanable share',
'st.ofUsed': 'of the used space', 'st.ofUsed': 'of the used space',
@@ -1028,6 +1037,14 @@ window.LANG = {
'git.green': 'Gesichert', 'git.green': 'Gesichert',
'git.yellow': 'Ungesichert', 'git.yellow': 'Ungesichert',
'git.red': 'Kein Remote', 'git.red': 'Kein Remote',
'gitl.noGit': 'kein Git',
'gitl.notInstalled': 'Git nicht installiert',
'gitl.changed': '{n} geändert',
'gitl.unpushed': '{n} nicht gepusht',
'gitl.behind': '{n} hinterher',
'gitl.noRemote': 'kein Remote (nur lokal)',
'gitl.noUpstream': 'kein Upstream',
'gitl.saved': 'gesichert',
'cloud.never': 'nie', 'cloud.never': 'nie',
'cloud.neverLong': 'Backup: noch nie gesichert', 'cloud.neverLong': 'Backup: noch nie gesichert',
'cloud.incomplete': 'unvollständig', 'cloud.incomplete': 'unvollständig',
@@ -1398,6 +1415,7 @@ window.LANG = {
'st.inside': 'darin {s}', 'st.inside': 'darin {s}',
'st.clickSub': 'Klick: Unterordner', 'st.clickSub': 'Klick: Unterordner',
'st.used': 'Belegt', 'st.used': 'Belegt',
'st.cleanable': 'Aufräumbar',
'st.nMeasured': '{n} Projekte gemessen', 'st.nMeasured': '{n} Projekte gemessen',
'st.cleanableShare': 'Anteil aufräumbar', 'st.cleanableShare': 'Anteil aufräumbar',
'st.ofUsed': 'vom belegten Platz', 'st.ofUsed': 'vom belegten Platz',