Skip to content

armgit / bento

Public Imported from GitHub
0

Bento, the office suite that fits in a file

v0.6.0: internationalization — six languages, viewer-follows locale

nyblnet8b48dfa02a62
diff --git a/CLAUDE.md b/CLAUDE.md
index 62e4177c..9f9712a4 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -53,6 +53,16 @@ One HTML file = the document + viewer + editor. See `README.md` for the vision.
`scripts/sign-release.mjs`. Docs carry a stable `docId` (uuid, minted at
creation/load) — identity for future sync/merge; never regenerate it.
Scripting: `window.bento.updates.{version,check,build,apply}`.
+- `src/i18n.ts` + `src/i18n/*.ts` — internationalization: ~1KB t() with
+ ENGLISH-STRING-AS-KEY (gettext style; missing key = English fallback),
+ {placeholder} interpolation, catalogs compiled in (ja, zh-Hans, es, fr, de);
+ locale follows the VIEWER (navigator.language; localStorage 'bento-lang'
+ override; picker in About rebuilds the workspace). Language never enters the
+ document format. select() localizes DISPLAY labels only (values stay model
+ words). GOTCHAS: never call t() in module-level consts (frozen at import —
+ translate at render time); keys must match source EXACTLY (validate with the
+ extraction/diff script pattern in git history); setLocale('x-pseudo') audits
+ unswept strings. New UI strings must be added to ALL catalogs.
- `src/charts.ts` — ECharts (Apache-2.0, svg renderer only, tree-shaken:
bar/line/pie/scatter + grid/tooltip/legend/dataZoom/title/dataset). A `chart`
element stores a PURE-JSON option (template-string formatters, never
diff --git a/slides/package.json b/slides/package.json
index 0aaa7ceb..4ab0cadc 100644
--- a/slides/package.json
+++ b/slides/package.json
@@ -1,7 +1,7 @@
{
"name": "bento-slides",
"private": true,
- "version": "0.5.5",
+ "version": "0.6.0",
"type": "module",
"scripts": {
"dev": "vite",
diff --git a/slides/src/editor/canvas.ts b/slides/src/editor/canvas.ts
index 7523ea4b..57e15eac 100644
--- a/slides/src/editor/canvas.ts
+++ b/slides/src/editor/canvas.ts
@@ -5,6 +5,7 @@
import Moveable from 'moveable'
import Selecto from 'selecto'
import type { Store } from '../store'
+import { t } from '../i18n'
import type { SlideElement } from '../model'
import { renderSlide, sanitizeHtml } from '../render'
import { autoformatAtCaret, clearAutoformat, markdownToHtml, undoAutoformat } from './markdown'
@@ -161,13 +162,13 @@ export class SlideCanvas {
b.addEventListener('click', onClick)
return b
}
- const label = mk('100%', 'Reset zoom to fit (⌘0)', () => this.zoomReset())
+ const label = mk('100%', t('Reset zoom to fit (⌘0)'), () => this.zoomReset())
label.classList.add('ed-zoomlabel')
this.zoomLabel = label
bar.append(
- mk('−', 'Zoom out (⌘−)', () => this.zoomOut()),
+ mk('−', t('Zoom out (⌘−)'), () => this.zoomOut()),
label,
- mk('+', 'Zoom in (⌘+)', () => this.zoomIn()),
+ mk('+', t('Zoom in (⌘+)'), () => this.zoomIn()),
)
this.wrap.appendChild(bar)
}
@@ -220,7 +221,7 @@ export class SlideCanvas {
this.stage.appendChild(hl)
const chip = document.createElement('div')
chip.className = 'ed-comment-chip'
- chip.textContent = '💬 whole slide'
+ chip.textContent = t('💬 whole slide')
chip.style.display = 'none'
this.stage.appendChild(chip)
const cleanup = () => {
@@ -390,7 +391,7 @@ export class SlideCanvas {
bar.className = 'ed-setbar'
const label = document.createElement('span')
label.className = 'ed-setbar-label'
- label.textContent = 'Hover set:'
+ label.textContent = t('Hover set:')
bar.appendChild(label)
for (const set of sets) {
const chip = document.createElement('button')
diff --git a/slides/src/editor/comments.ts b/slides/src/editor/comments.ts
index 189aac4e..ae5d29c7 100644
--- a/slides/src/editor/comments.ts
+++ b/slides/src/editor/comments.ts
@@ -6,13 +6,14 @@
import type { Store } from '../store'
import { uid, type Comment } from '../model'
+import { t } from '../i18n'
/** The commenter's name, remembered per browser (localStorage, never sent
* anywhere); asked for on first use. */
export function commentAuthor(): string | null {
let name = localStorage.getItem('bento-author')
if (!name) {
- name = window.prompt('Your name (shown on comments):')?.trim() || ''
+ name = window.prompt(t('Your name (shown on comments):'))?.trim() || ''
if (!name) return null
localStorage.setItem('bento-author', name)
}
@@ -21,7 +22,7 @@ export function commentAuthor(): string | null {
/** Re-ask for the name; existing threads keep their original author. */
export function changeCommentAuthor(): string | null {
- const next = window.prompt('Your name (shown on new comments):', localStorage.getItem('bento-author') ?? '')?.trim()
+ const next = window.prompt(t('Your name (shown on new comments):'), localStorage.getItem('bento-author') ?? '')?.trim()
if (!next) return null
localStorage.setItem('bento-author', next)
return next
@@ -29,10 +30,10 @@ export function changeCommentAuthor(): string | null {
function relTime(iso: string): string {
const s = (Date.now() - new Date(iso).getTime()) / 1000
- if (!Number.isFinite(s) || s < 45) return 'just now'
- if (s < 3600) return `${Math.round(s / 60)}m ago`
- if (s < 86400) return `${Math.round(s / 3600)}h ago`
- if (s < 86400 * 30) return `${Math.round(s / 86400)}d ago`
+ if (!Number.isFinite(s) || s < 45) return t('just now')
+ if (s < 3600) return t('{n}m ago', { n: Math.round(s / 60) })
+ if (s < 86400) return t('{n}h ago', { n: Math.round(s / 3600) })
+ if (s < 86400 * 30) return t('{n}d ago', { n: Math.round(s / 86400) })
return new Date(iso).toLocaleDateString()
}
@@ -91,7 +92,7 @@ export class CommentsUI {
openNew(elementId?: string, point?: { x: number; y: number }) {
const author = commentAuthor()
if (!author) return
- const text = window.prompt('Comment:')?.trim()
+ const text = window.prompt(t('Comment:'))?.trim()
if (!text) return
const comment: Comment = {
id: uid('cmt'), elementId, ...(point ?? {}), author, text, at: new Date().toISOString(),
@@ -117,15 +118,15 @@ export class CommentsUI {
head.className = 'ed-comment-pop-head'
const headLabel = document.createElement('span')
headLabel.textContent = c.elementId
- ? 'Comment · element'
- : typeof c.x === 'number' ? `Comment · point (${c.x}, ${c.y})` : 'Comment · slide'
+ ? t('Comment · element')
+ : typeof c.x === 'number' ? t('Comment · point ({x}, {y})', { x: c.x!, y: c.y! }) : t('Comment · slide')
const me = document.createElement('button')
me.className = 'ed-comment-me'
- me.textContent = `you: ${localStorage.getItem('bento-author') ?? '—'} ✎`
- me.title = 'Change the name used for your new comments and replies'
+ me.textContent = t('you: {name} ✎', { name: localStorage.getItem('bento-author') ?? '—' })
+ me.title = t('Change the name used for your new comments and replies')
me.addEventListener('click', () => {
const next = changeCommentAuthor()
- if (next) me.textContent = `you: ${next} ✎`
+ if (next) me.textContent = t('you: {name} ✎', { name: next })
})
head.append(headLabel, me)
pop.appendChild(head)
@@ -148,7 +149,7 @@ export class CommentsUI {
const reply = document.createElement('textarea')
reply.className = 'ed-comment-reply'
reply.rows = 2
- reply.placeholder = 'Reply…'
+ reply.placeholder = t('Reply…')
pop.appendChild(reply)
const foot = document.createElement('div')
@@ -161,7 +162,7 @@ export class CommentsUI {
return b
}
foot.append(
- mkBtn('Reply', () => {
+ mkBtn(t('Reply'), () => {
const text = reply.value.trim()
const author = commentAuthor()
if (!text || !author) return
@@ -172,7 +173,7 @@ export class CommentsUI {
pop.remove()
this.refresh()
}),
- mkBtn(c.resolved ? 'Reopen' : 'Resolve', () => {
+ mkBtn(c.resolved ? t('Reopen') : t('Resolve'), () => {
this.store.commit(() => {
const live = this.store.slide.comments?.find((x) => x.id === commentId)
if (live) live.resolved = !live.resolved
@@ -180,7 +181,7 @@ export class CommentsUI {
pop.remove()
this.refresh()
}),
- mkBtn('Delete', () => {
+ mkBtn(t('Delete'), () => {
this.store.commit(() => {
const s = this.store.slide
s.comments = (s.comments ?? []).filter((x) => x.id !== commentId)
diff --git a/slides/src/editor/editor.ts b/slides/src/editor/editor.ts
index 7ae51691..41bc5ab3 100644
--- a/slides/src/editor/editor.ts
+++ b/slides/src/editor/editor.ts
@@ -16,6 +16,9 @@ import { PropsPanel } from './panels'
import { startPresentation } from '../present'
import { saveFile } from '../save'
import { ICONS } from '../icons'
+import { t, setLocale, locale, LOCALE_CHOICES } from '../i18n'
+
+const i18nT = t
const SHAPE_MENU: Array<{ kind: ShapeKind; label: string; icon: string }> = [
{ kind: 'rect', label: 'Rectangle', icon: ICONS.rect },
@@ -77,7 +80,7 @@ export class Editor {
`<rect x="14" y="5" width="13" height="10" rx="2.5" fill="#FF9E8A"/>` +
`<rect x="14" y="17" width="13" height="10" rx="2.5" fill="#F0EBE0"/>` +
`</svg> <b>Bento<span style="color:#FF9E8A">/</span>Slides</b>`
- logo.title = 'About Bento Slides — version, updates, licenses'
+ logo.title = t('About Bento Slides — version, updates, licenses')
logo.style.cursor = 'pointer'
logo.addEventListener('click', () => this.openAbout())
const title = document.createElement('input')
@@ -89,21 +92,21 @@ export class Editor {
document.title = `${this.store.doc.title} — Bento Slides`
})
this.dirtyDot = div('ed-dirty')
- this.dirtyDot.title = 'Unsaved changes'
+ this.dirtyDot.title = t('Unsaved changes')
const insert = div('ed-group')
insert.append(
- btn(ICONS.text, 'Text', () => this.canvas.insert(defaultText({ y: 120 + Math.random() * 200 }), true)),
+ btn(ICONS.text, t('Text'), () => this.canvas.insert(defaultText({ y: 120 + Math.random() * 200 }), true)),
this.shapeDropdown(),
- btn(ICONS.image, 'Image', () => this.pickImage()),
- btn(ICONS.chart, 'Chart', () => this.canvas.insert(defaultChart(CHART_PRESETS.bar()))),
+ btn(ICONS.image, t('Image'), () => this.pickImage()),
+ btn(ICONS.chart, t('Chart'), () => this.canvas.insert(defaultChart(CHART_PRESETS.bar()))),
)
const commentB = btn(ICONS.comment, '', () => this.canvas.toggleCommentMode(),
- 'Comment (C) — click an element or a spot on the slide')
+ t('Comment (C) — click an element or a spot on the slide'))
insert.appendChild(commentB)
const actions = div('ed-group ed-group-right')
- this.updatesB = btn(ICONS.sync, '', () => this.openAbout(true), 'Check for updates')
+ this.updatesB = btn(ICONS.sync, '', () => this.openAbout(true), t('Check for updates'))
// launch-time check (opt-out lives in the About dialog); a found update
// turns the button into a visible peach chip
setTimeout(async () => {
@@ -114,24 +117,24 @@ export class Editor {
this.updateFound = r.release.version
this.updatesB.classList.add('ed-btn-update')
this.updatesB.innerHTML = `${ICONS.sync}<span>v${r.release.version}</span>`
- this.updatesB.title = `Version ${r.release.version} is available — click to update`
- this.toast(`Update available: v${r.release.version} — click the peach button to update`)
+ this.updatesB.title = t('Version {v} is available — click to update', { v: r.release.version })
+ this.toast(t('Update available: v{v} — click the peach button to update', { v: r.release.version }))
} else if (r.status === 'current') {
- this.updatesB.title = `Up to date (v${APP_VERSION}) — checked at launch`
- this.toast(`Up to date — v${APP_VERSION}`)
+ this.updatesB.title = t('Up to date (v{v}) — checked at launch', { v: APP_VERSION })
+ this.toast(t('Up to date — v{v}', { v: APP_VERSION }))
} else {
- this.updatesB.title = `Update check failed: ${r.message} — click to retry`
+ this.updatesB.title = t('Update check failed: {m} — click to retry', { m: r.message })
}
}, 1500)
- const undoB = btn(ICONS.undo, '', () => this.store.undo(), 'Undo (⌘Z)')
- const redoB = btn(ICONS.redo, '', () => this.store.redo(), 'Redo (⇧⌘Z)')
- const presentB = btn(ICONS.play, 'Present', () => this.present(), 'Present from current slide')
+ const undoB = btn(ICONS.undo, '', () => this.store.undo(), t('Undo (⌘Z)'))
+ const redoB = btn(ICONS.redo, '', () => this.store.redo(), t('Redo (⇧⌘Z)'))
+ const presentB = btn(ICONS.play, t('Present'), () => this.present(), t('Present from current slide'))
presentB.classList.add('ed-btn-primary')
- const saveB = btn(ICONS.save, 'Save', () => this.save(false), 'Save — rewrite this file in place (⌘S)')
- const saveAsB = btn(ICONS.download, '', () => this.save(true), 'Save a copy — pick a new file, leave this one untouched')
- const pdfB = btn(ICONS.pdf, '', () => this.exportPdf(), 'Export PDF (print)')
- const leftT = btn(ICONS.panelLeft, '', () => this.togglePanel('left'), 'Toggle slide list ([)')
- const rightT = btn(ICONS.panelRight, '', () => this.togglePanel('right'), 'Toggle properties (])')
+ const saveB = btn(ICONS.save, t('Save'), () => this.save(false), t('Save — rewrite this file in place (⌘S)'))
+ const saveAsB = btn(ICONS.download, '', () => this.save(true), t('Save a copy — pick a new file, leave this one untouched'))
+ const pdfB = btn(ICONS.pdf, '', () => this.exportPdf(), t('Export PDF (print)'))
+ const leftT = btn(ICONS.panelLeft, '', () => this.togglePanel('left'), t('Toggle slide list ([)'))
+ const rightT = btn(ICONS.panelRight, '', () => this.togglePanel('right'), t('Toggle properties (])'))
actions.append(undoB, redoB, pdfB, this.updatesB, leftT, rightT, presentB, saveB, saveAsB)
bar.append(logo, title, this.dirtyDot, insert, actions)
@@ -174,7 +177,7 @@ export class Editor {
private makeResizer(side: 'left' | 'right'): HTMLElement {
const handle = div('ed-resizer')
- handle.title = 'Drag to resize · double-click to reset'
+ handle.title = t('Drag to resize · double-click to reset')
const commit = () => {
localStorage.setItem('bento-ed-panels', JSON.stringify(this.panelW))
// thumbnails render at a width derived from the sidebar — refit them
@@ -221,10 +224,10 @@ export class Editor {
private shapeDropdown(): HTMLElement {
const wrap = div('ed-dropdown')
- const trigger = btn(ICONS.shapes, 'Shape', () => wrap.classList.toggle('open'))
+ const trigger = btn(ICONS.shapes, t('Shape'), () => wrap.classList.toggle('open'))
const menu = div('ed-menu')
for (const item of SHAPE_MENU) {
- const b = btn(item.icon, item.label, () => {
+ const b = btn(item.icon, t(item.label), () => {
wrap.classList.remove('open')
const partial = item.kind === 'line' ? { h: 4, w: 400, strokeWidth: 3 } : {}
this.canvas.insert(defaultShape(item.kind, partial))
@@ -262,8 +265,8 @@ export class Editor {
}
const tools = div('ed-thumb-tools')
tools.append(
- btn(ICONS.copy, '', (ev) => { ev.stopPropagation(); this.duplicateSlide(i) }, 'Duplicate slide'),
- btn(ICONS.trash, '', (ev) => { ev.stopPropagation(); this.deleteSlide(i) }, 'Delete slide'),
+ btn(ICONS.copy, '', (ev) => { ev.stopPropagation(); this.duplicateSlide(i) }, t('Duplicate slide')),
+ btn(ICONS.trash, '', (ev) => { ev.stopPropagation(); this.deleteSlide(i) }, t('Delete slide')),
)
item.append(num, surface, tools)
item.addEventListener('click', () => this.store.goTo(i))
@@ -290,9 +293,9 @@ export class Editor {
this.sidebar.appendChild(item)
})
this.sidebar.appendChild(this.insertGap(slides.length))
- const add = btn(ICONS.plus, 'New slide', () => this.openLayoutPicker(add))
+ const add = btn(ICONS.plus, t('New slide'), () => this.openLayoutPicker(add))
add.classList.add('ed-add-slide')
- add.title = 'New slide from a layout'
+ add.title = t('New slide from a layout')
this.sidebar.appendChild(add)
this.sidebar.scrollTop = scroll
this.highlightSidebar()
@@ -311,11 +314,11 @@ export class Editor {
const doc = this.store.doc
if (action.kind === 'apply') {
const t = div('ed-layoutpick-title')
- t.textContent = 'Apply layout to this slide'
+ t.textContent = i18nT('Apply layout to this slide')
pick.appendChild(t)
}
- const sections: Array<[string, Slide[], boolean]> = [['Built-in', builtinLayouts(), false]]
- if (doc.layouts?.length) sections.push(['This document', doc.layouts, true])
+ const sections: Array<[string, Slide[], boolean]> = [[t('Built-in'), builtinLayouts(), false]]
+ if (doc.layouts?.length) sections.push([t('This document'), doc.layouts, true])
for (const [label, layouts, custom] of sections) {
const h = div('ed-layoutpick-h')
h.textContent = label
@@ -325,7 +328,7 @@ export class Editor {
const item = div('ed-layoutpick-item')
item.appendChild(renderThumbnail(ly, doc, 104))
const name = div('ed-layoutpick-name')
- name.textContent = ly.name ?? 'Untitled'
+ name.textContent = ly.name ?? t('Untitled')
item.appendChild(name)
item.addEventListener('click', () => {
pick.remove()
@@ -336,7 +339,7 @@ export class Editor {
const del = document.createElement('button')
del.className = 'ed-layoutpick-del'
del.textContent = '✕'
- del.title = 'Delete this layout'
+ del.title = t('Delete this layout')
del.addEventListener('click', (ev) => {
ev.stopPropagation()
this.store.commit(() => {
@@ -394,7 +397,7 @@ export class Editor {
/** Slim hover strip between thumbnails — click inserts a blank slide there. */
private insertGap(at: number): HTMLElement {
const gap = div('ed-insertgap')
- gap.title = 'Insert slide here'
+ gap.title = t('Insert slide here')
const plus = document.createElement('button')
plus.className = 'ed-insertgap-btn'
plus.textContent = '+'
@@ -450,7 +453,7 @@ export class Editor {
const badge = item.querySelector('.ed-thumb-cmt')
if (open && !badge) {
const b = div('ed-thumb-cmt')
- b.title = 'Open comment(s)'
+ b.title = t('Open comment(s)')
item.appendChild(b)
} else if (!open && badge) {
badge.remove()
@@ -473,7 +476,7 @@ export class Editor {
}
private deleteSlide(i: number) {
- if (this.store.doc.slides.length <= 1) return this.toast('A deck needs at least one slide')
+ if (this.store.doc.slides.length <= 1) return this.toast(t('A deck needs at least one slide'))
const target = this.store.doc.slides[i]
// dependents: states of this slide, and element links pointing at it
const states = this.store.doc.slides.filter((s) => s.stateOf === target.id)
@@ -488,7 +491,7 @@ export class Editor {
states.length ? `${states.length} interactive state${states.length > 1 ? 's' : ''} will be deleted with it` : '',
linkCount ? `${linkCount} element link${linkCount > 1 ? 's' : ''} will be cleared` : '',
].filter(Boolean).join('; ')
- if (!window.confirm(`Delete this slide? ${parts}.`)) return
+ if (!window.confirm(t('Delete this slide? {parts}.', { parts }))) return
}
this.store.commit(() => {
this.store.doc.slides = this.store.doc.slides.filter((s) => !doomedIds.has(s.id))
@@ -580,11 +583,11 @@ export class Editor {
if (result === 'cancelled') return
this.store.setDirty(false)
this.toast(result === 'downloaded'
- ? 'This browser can’t rewrite files in place — a fresh copy went to Downloads'
- : 'Saved')
+ ? t('This browser can’t rewrite files in place — a fresh copy went to Downloads')
+ : t('Saved'))
} catch (err) {
console.error(err)
- this.toast('Save failed — see console')
+ this.toast(t('Save failed — see console'))
}
}
@@ -746,49 +749,49 @@ export class Editor {
const status = div('ed-about-status')
status.textContent =
this.lastAutoCheck?.status === 'current'
- ? `Checked automatically at launch — you're on the latest version (v${APP_VERSION}).`
+ ? t("Checked automatically at launch — you're on the latest version (v{v}).", { v: APP_VERSION })
: this.lastAutoCheck?.status === 'error'
- ? `Launch check couldn't reach the release server (${this.lastAutoCheck.message}). Check manually below.`
- : 'This file carries its own app — it works offline, forever, as is.'
+ ? t("Launch check couldn't reach the release server ({m}). Check manually below.", { m: this.lastAutoCheck.message })
+ : t('This file carries its own app — it works offline, forever, as is.')
const row = div('ed-about-row')
const checkB = document.createElement('button')
checkB.className = 'ed-btn'
- checkB.textContent = 'Check for updates'
+ checkB.textContent = t('Check for updates')
checkB.addEventListener('click', async () => {
checkB.disabled = true
- status.textContent = 'Checking…'
+ status.textContent = t('Checking…')
const result = await checkForUpdates()
checkB.disabled = false
if (result.status === 'current') {
- status.textContent = `You're on the latest version (v${result.version}).`
+ status.textContent = t("You're on the latest version (v{v}).", { v: result.version })
} else if (result.status === 'error') {
- status.textContent = `Couldn't check: ${result.message}`
+ status.textContent = t("Couldn't check: {m}", { m: result.message })
} else {
const { release } = result
status.textContent = ''
const line = div('ed-about-new')
- line.textContent = `Version ${release.version} is available.`
+ line.textContent = t('Version {v} is available.', { v: release.version })
status.appendChild(line)
if (release.notes) {
const notes = div('ed-about-notes')
notes.textContent = release.notes
status.appendChild(notes)
}
- const fail = (err: any) => { status.textContent = `Update failed: ${err?.message ?? err}` }
+ const fail = (err: any) => { status.textContent = t('Update failed: {m}', { m: String(err?.message ?? err) }) }
const done = () => {
status.textContent = ''
const ok = div('ed-about-new')
- ok.textContent = `Updated to v${release.version} on disk.`
+ ok.textContent = t('Updated to v{v} on disk.', { v: release.version })
status.appendChild(ok)
const note = div('ed-about-notes')
note.textContent = canUpdateInPlace()
- ? `This window is still running v${APP_VERSION} — reload to finish. A v${APP_VERSION} backup was downloaded.`
- : `This window is still running v${APP_VERSION}. If you overwrote the file that's open here, reload; otherwise open the file you saved.`
+ ? t('This window is still running v{v} — reload to finish. A v{v} backup was downloaded.', { v: APP_VERSION })
+ : t("This window is still running v{v}. If you overwrote the file that's open here, reload; otherwise open the file you saved.", { v: APP_VERSION })
status.appendChild(note)
const reloadB = document.createElement('button')
reloadB.className = 'ed-btn ed-btn-primary'
- reloadB.textContent = 'Reload into new version'
+ reloadB.textContent = t('Reload into new version')
reloadB.addEventListener('click', () => {
this.store.setDirty(false) // disk already holds this exact document
location.reload()
@@ -798,33 +801,33 @@ export class Editor {
const inPlaceB = document.createElement('button')
inPlaceB.className = 'ed-btn ed-btn-primary'
- inPlaceB.textContent = canUpdateInPlace() ? 'Update this file' : 'Update this file…'
+ inPlaceB.textContent = canUpdateInPlace() ? t('Update this file') : t('Update this file…')
inPlaceB.title = canUpdateInPlace()
- ? 'Downloads a backup of the current version, then rewrites this file on disk as the new version — document untouched.'
- : 'Verifies and builds the new version with this document inside, then asks where to save it — pick the file you have open to update it.'
+ ? t('Downloads a backup of the current version, then rewrites this file on disk as the new version — document untouched.')
+ : t('Verifies and builds the new version with this document inside, then asks where to save it — pick the file you have open to update it.')
inPlaceB.addEventListener('click', async () => {
inPlaceB.disabled = true
- inPlaceB.textContent = 'Verifying…'
+ inPlaceB.textContent = t('Verifying…')
try {
const written = await applyUpdateInPlace(release, this.store.doc)
if (written) done()
- else { inPlaceB.disabled = false; inPlaceB.textContent = 'Update this file…' }
+ else { inPlaceB.disabled = false; inPlaceB.textContent = t('Update this file…') }
} catch (err: any) { fail(err) }
})
status.appendChild(inPlaceB)
const getB = document.createElement('button')
getB.className = 'ed-btn'
- getB.textContent = 'Download updated copy'
- getB.title = 'Downloads the new version with this document inside. The file you have now is not touched.'
+ getB.textContent = t('Download updated copy')
+ getB.title = t('Downloads the new version with this document inside. The file you have now is not touched.')
getB.addEventListener('click', async () => {
getB.disabled = true
- getB.textContent = 'Verifying…'
+ getB.textContent = t('Verifying…')
try {
await applyUpdate(release, this.store.doc)
- getB.textContent = 'Downloaded ✓'
+ getB.textContent = t('Downloaded ✓')
const note = div('ed-about-notes')
- note.textContent = `This window keeps running v${APP_VERSION} until you open the downloaded file.`
+ note.textContent = t('This window keeps running v{v} until you open the downloaded file.', { v: APP_VERSION })
status.appendChild(note)
} catch (err: any) { fail(err) }
})
@@ -840,13 +843,32 @@ export class Editor {
autoCb.type = 'checkbox'
autoCb.checked = autoCheckEnabled()
autoCb.addEventListener('change', () => setAutoCheck(autoCb.checked))
- autoRow.append(autoCb, document.createTextNode(' Check for updates automatically at launch'))
+ autoRow.append(autoCb, document.createTextNode(' ' + t('Check for updates automatically at launch')))
box.appendChild(autoRow)
+ const langRow = document.createElement('label')
+ langRow.className = 'ed-about-auto'
+ const langSel = document.createElement('select')
+ for (const c of LOCALE_CHOICES) {
+ const o = document.createElement('option')
+ o.value = c.code
+ o.textContent = c.label
+ if (c.code === locale()) o.selected = true
+ langSel.appendChild(o)
+ }
+ langSel.addEventListener('change', () => {
+ setLocale(langSel.value)
+ close()
+ this.build()
+ this.rebuildSidebar()
+ })
+ langRow.append(document.createTextNode(t('Language') + ' '), langSel)
+ box.appendChild(langRow)
+
const fine = div('ed-about-fine')
fine.innerHTML =
- `Checks contact the release server and send nothing about you or this document — no ids, no telemetry.<br>` +
- `Includes reveal.js, Moveable, Selecto (MIT) · Apache ECharts (Apache-2.0) · zrender (BSD-3) · Fraunces typeface (OFL-1.1) — full notices travel in this file’s source.`
+ `${t('Checks contact the release server and send nothing about you or this document — no ids, no telemetry.')}<br>` +
+ t('Includes reveal.js, Moveable, Selecto (MIT) · Apache ECharts (Apache-2.0) · zrender (BSD-3) · Fraunces typeface (OFL-1.1) — full notices travel in this file’s source.')
box.appendChild(fine)
overlay.appendChild(box)
diff --git a/slides/src/editor/panels.ts b/slides/src/editor/panels.ts
index 25a3c9fa..3ec23f3e 100644
--- a/slides/src/editor/panels.ts
+++ b/slides/src/editor/panels.ts
@@ -7,6 +7,7 @@ import { uid, type ChartElement, type LineEnding, type ShapeElement, type Slide,
import { CHART_PRESETS } from '../charts'
import { FONT_CHOICES, firstFamily, injectFonts } from '../fonts'
import { ICONS } from '../icons'
+import { t } from '../i18n'
export class PropsPanel {
private burst = false
@@ -118,10 +119,10 @@ export class PropsPanel {
private buildSlidePanel() {
const slide = this.store.slide
- this.section('Slide')
- this.row('Background', this.color(slide.background, (v, fin) =>
+ this.section(t('Slide'))
+ this.row(t('Background'), this.color(slide.background, (v, fin) =>
this.edit(() => { this.store.slide.background = v }, fin)))
- this.row('Transition', this.select(
+ this.row(t('Transition'), this.select(
['none', 'fade', 'slide', 'zoom', 'morph'],
slide.transition,
(v) => this.edit(() => { this.store.slide.transition = v as TransitionKind }, true),
@@ -129,24 +130,24 @@ export class PropsPanel {
if (slide.transition === 'morph') {
const hint = document.createElement('p')
hint.className = 'ed-hint'
- hint.innerHTML = '<b>Morph</b> animates elements that appear on both this slide and the previous one (copy a slide, then move things around).'
+ hint.innerHTML = t('<b>Morph</b> animates elements that appear on both this slide and the previous one (copy a slide, then move things around).')
this.host.appendChild(hint)
}
// interactivity: naming, state-of, hover focus
- this.section('Interactivity')
+ this.section(t('Interactivity'))
const name = document.createElement('input')
name.type = 'text'
- name.placeholder = 'unnamed'
+ name.placeholder = t('unnamed')
name.value = slide.name ?? ''
name.addEventListener('change', () =>
this.edit(() => { this.store.slide.name = name.value || undefined }, true))
- this.row('Name', name)
+ this.row(t('Name'), name)
const stateSel = document.createElement('select')
const optNone = document.createElement('option')
optNone.value = ''
- optNone.textContent = 'no — normal slide'
+ optNone.textContent = t('no — normal slide')
stateSel.appendChild(optNone)
this.store.doc.slides.forEach((s, i) => {
if (s.stateOf || s.id === slide.id) return
@@ -161,23 +162,23 @@ export class PropsPanel {
this.store.slide.stateOf = stateSel.value || undefined
this.store.emit('slides')
}, true))
- this.row('State of', stateSel)
+ this.row(t('State of'), stateSel)
const stateHint = document.createElement('p')
stateHint.className = 'ed-hint'
stateHint.innerHTML =
- 'A <b>state</b> is hidden from arrow-key flow — viewers reach it by clicking a linked element. Shared element ids morph between states.'
+ t('A <b>state</b> is hidden from arrow-key flow — viewers reach it by clicking a linked element. Shared element ids morph between states.')
this.host.appendChild(stateHint)
if (slide.stateOf) {
const sync = document.createElement('button')
sync.className = 'ed-btn ed-btn-block'
- sync.innerHTML = `${ICONS.sync}<span>Sync from parent slide</span>`
- sync.title = 'Pull elements added to the parent into this state and adopt its ordering — your changes to shared elements are kept'
+ sync.innerHTML = `${ICONS.sync}<span>${t('Sync from parent slide')}</span>`
+ sync.title = t('Pull elements added to the parent into this state and adopt its ordering — your changes to shared elements are kept')
sync.addEventListener('click', () => this.syncStateFromParent())
this.host.appendChild(sync)
}
- this.row('Hover', this.select(
+ this.row(t('Hover'), this.select(
['none', 'focus-group', 'reveal'],
slide.hover?.type ?? 'none',
(v) => this.edit(() => {
@@ -186,7 +187,7 @@ export class PropsPanel {
: { ...(this.store.slide.hover ?? {}), type: v as 'focus-group' | 'reveal' }
}, true)))
if (slide.hover?.type === 'focus-group') {
- this.row('Hover dim', this.number(slide.hover.dim ?? 0.15, 0.01, (v, fin) =>
+ this.row(t('Hover dim'), this.number(slide.hover.dim ?? 0.15, 0.01, (v, fin) =>
this.edit(() => { if (this.store.slide.hover) this.store.slide.hover.dim = Math.min(Math.max(v, 0), 1) }, fin)))
}
if (slide.hover?.type === 'reveal') {
@@ -197,31 +198,31 @@ export class PropsPanel {
defIn.value = slide.hover.default ?? ''
defIn.addEventListener('change', () =>
this.edit(() => { if (this.store.slide.hover) this.store.slide.hover.default = defIn.value || undefined }, true))
- this.row('Default set', defIn)
+ this.row(t('Default set'), defIn)
if (sets.length) {
- this.row('Preview set', this.select(sets, this.store.hoverPreview ?? slide.hover.default ?? sets[0], (v) => {
+ this.row(t('Preview set'), this.select(sets, this.store.hoverPreview ?? slide.hover.default ?? sets[0], (v) => {
this.store.hoverPreview = v
this.store.emit('current') // re-render canvas without touching the doc
}))
const revealHint = document.createElement('p')
revealHint.className = 'ed-hint'
- revealHint.innerHTML = 'While presenting, hovering an element whose <b>group</b> matches a set name shows that set. Use Preview to edit each set.'
+ revealHint.innerHTML = t('While presenting, hovering an element whose <b>group</b> matches a set name shows that set. Use Preview to edit each set.')
this.host.appendChild(revealHint)
}
}
- this.section('Layout')
+ this.section(t('Layout'))
const applyLy = document.createElement('button')
applyLy.className = 'ed-btn ed-btn-block'
- applyLy.textContent = '⧉ Apply layout…'
- applyLy.title = 'Re-arrange this slide onto a layout — content moves by matching id, then role; extra elements are kept'
+ applyLy.textContent = t('⧉ Apply layout…')
+ applyLy.title = t('Re-arrange this slide onto a layout — content moves by matching id, then role; extra elements are kept')
applyLy.addEventListener('click', () =>
document.dispatchEvent(new CustomEvent('bento:apply-layout', { detail: { anchor: applyLy } })))
this.host.appendChild(applyLy)
const saveLy = document.createElement('button')
saveLy.className = 'ed-btn ed-btn-block'
- saveLy.textContent = '+ Save slide as layout…'
+ saveLy.textContent = t('+ Save slide as layout…')
saveLy.title = "Add this slide to the document's layout picker (New slide button)"
saveLy.addEventListener('click', () => {
const name = window.prompt('Layout name', this.store.slide.name ?? 'My layout')
@@ -234,24 +235,24 @@ export class PropsPanel {
})
this.host.appendChild(saveLy)
- this.section('Speaker notes')
+ this.section(t('Speaker notes'))
const notes = document.createElement('textarea')
notes.className = 'ed-notes'
- notes.placeholder = 'Notes for presenter view (press S while presenting)…'
+ notes.placeholder = t('Notes for presenter view (press S while presenting)…')
notes.value = slide.notes
notes.addEventListener('input', () => this.edit(() => { this.store.slide.notes = notes.value }, false))
notes.addEventListener('change', () => this.edit(() => { this.store.slide.notes = notes.value }, true))
this.host.appendChild(notes)
const notesHint = document.createElement('p')
notesHint.className = 'ed-hint'
- notesHint.innerHTML = 'Press <b>S</b> while presenting to open the speaker view — these notes beside the current and next slide, with a timer.'
+ notesHint.innerHTML = t('Press <b>S</b> while presenting to open the speaker view — these notes beside the current and next slide, with a timer.')
this.host.appendChild(notesHint)
}
private buildMultiPanel(els: SlideElement[]) {
this.section(`${els.length} elements`)
this.opsRow(els)
- this.section('Arrange')
+ this.section(t('Arrange'))
this.arrangeRows(els)
}
@@ -259,24 +260,24 @@ export class PropsPanel {
this.section({ text: 'Text', shape: 'Shape', image: 'Image', svg: 'Diagram', chart: 'Chart' }[el.type])
this.opsRow([el])
- this.section('Arrange')
+ this.section(t('Arrange'))
this.arrangeRows([el])
- this.section('Position & size')
+ this.section(t('Position & size'))
const geo = document.createElement('div')
geo.className = 'ed-grid2'
geo.append(
- this.mini('X', el.x, (v) => this.setNum(el.id, 'x', v)),
- this.mini('Y', el.y, (v) => this.setNum(el.id, 'y', v)),
- this.mini('W', el.w, (v) => this.setNum(el.id, 'w', Math.max(v, 1))),
- this.mini('H', el.h, (v) => this.setNum(el.id, 'h', Math.max(v, 1))),
- this.mini('Angle', el.rotation, (v) => this.setNum(el.id, 'rotation', v)),
- this.mini('Opacity', Math.round(el.opacity * 100), (v) =>
+ this.mini(t('X'), el.x, (v) => this.setNum(el.id, 'x', v)),
+ this.mini(t('Y'), el.y, (v) => this.setNum(el.id, 'y', v)),
+ this.mini(t('W'), el.w, (v) => this.setNum(el.id, 'w', Math.max(v, 1))),
+ this.mini(t('H'), el.h, (v) => this.setNum(el.id, 'h', Math.max(v, 1))),
+ this.mini(t('Angle'), el.rotation, (v) => this.setNum(el.id, 'rotation', v)),
+ this.mini(t('Opacity'), Math.round(el.opacity * 100), (v) =>
this.setNum(el.id, 'opacity', Math.min(Math.max(v / 100, 0), 1))),
)
this.host.appendChild(geo)
- this.row('Role', this.select(
+ this.row(t('Role'), this.select(
['none', 'title', 'subtitle', 'body', 'kicker'],
el.role ?? 'none',
(v) => this.mutate(el.id, (e) => {
@@ -286,7 +287,7 @@ export class PropsPanel {
const current = Object.entries(SHADOW_PRESETS).find(([, p]) => JSON.stringify(p) === JSON.stringify(el.shadow))?.[0]
?? (el.shadow ? 'custom' : 'none')
- this.row('Shadow', this.select(
+ this.row(t('Shadow'), this.select(
[...(current === 'custom' ? ['custom'] : []), 'none', ...Object.keys(SHADOW_PRESETS)],
current,
(v) => this.mutate(el.id, (e) => {
@@ -312,12 +313,12 @@ export class PropsPanel {
const grid = document.createElement('div')
grid.className = 'ed-grid2'
grid.append(
- this.mini('X', sh.x ?? 0, (v) => setShadow(i, { x: v })),
- this.mini('Y', sh.y ?? 0, (v) => setShadow(i, { y: v })),
- this.mini('Blur', sh.blur, (v) => setShadow(i, { blur: Math.max(v, 0) })),
+ this.mini(t('X'), sh.x ?? 0, (v) => setShadow(i, { x: v })),
+ this.mini(t('Y'), sh.y ?? 0, (v) => setShadow(i, { y: v })),
+ this.mini(t('Blur'), sh.blur, (v) => setShadow(i, { blur: Math.max(v, 0) })),
)
this.host.appendChild(grid)
- this.row('Color', this.colorAlpha(sh.color, (v, fin) => setShadow(i, { color: v }, fin)))
+ this.row(t('Color'), this.colorAlpha(sh.color, (v, fin) => setShadow(i, { color: v }, fin)))
})
@@ -330,13 +331,13 @@ export class PropsPanel {
const morph = document.createElement('p')
morph.className = 'ed-hint'
- morph.innerHTML = `Morph id: <code>${el.id}</code>`
+ morph.innerHTML = `${t('Morph id:')} <code>${el.id}</code>`
this.host.appendChild(morph)
}
/** fx + link — how the element behaves while presenting. */
private buildPresentingProps(el: SlideElement) {
- this.section('Presenting')
+ this.section(t('Presenting'))
const setFx = (patch: Partial<NonNullable<SlideElement['fx']>>) =>
this.mutate(el.id, (e) => {
const fx = { ...(e.fx ?? {}), ...patch }
@@ -344,13 +345,13 @@ export class PropsPanel {
else e.fx = fx
}, true)
- this.row('Enter', this.select(
+ this.row(t('Enter'), this.select(
['none', 'fade', 'fade-up'], el.fx?.enter ?? 'none',
(v) => setFx({ enter: v === 'none' ? undefined : (v as 'fade' | 'fade-up') })))
- this.row('Count up', this.select(
+ this.row(t('Count up'), this.select(
['off', 'on'], el.fx?.countUp ? 'on' : 'off',
(v) => setFx({ countUp: v === 'on' ? true : undefined })))
- this.row('Ambient', this.select(
+ this.row(t('Ambient'), this.select(
['none', 'kenburns'], el.fx?.ambient ?? 'none',
(v) => setFx(v === 'none' ? { ambient: undefined, ken: undefined } : { ambient: 'kenburns' })))
if (el.fx?.ambient === 'kenburns') {
@@ -358,7 +359,7 @@ export class PropsPanel {
const dir = ken.dir ?? 'drift'
const setKen = (patch: Partial<NonNullable<NonNullable<SlideElement['fx']>['ken']>>) =>
setFx({ ken: { ...ken, ...patch } })
- this.row('Zoom', this.select(
+ this.row(t('Zoom'), this.select(
['drift', 'zoom-out', 'zoom-in'],
dir === 'out' ? 'zoom-out' : dir === 'in' ? 'zoom-in' : 'drift',
(v) => {
@@ -366,17 +367,17 @@ export class PropsPanel {
// give each style its natural pace when switching
setFx({ ken: d === 'drift' ? undefined : { dir: d, scale: 1.06, duration: 2.5 } })
}))
- this.row('Zoom %', this.number(
+ this.row(t('Zoom %'), this.number(
Math.round(((ken.scale ?? (dir === 'drift' ? 1.1 : 1.06)) - 1) * 100), 1,
(v, fin) => { if (fin) setKen({ scale: 1 + Math.min(Math.max(v, 0), 100) / 100 }) }))
- this.row('Zoom secs', this.number(
+ this.row(t('Zoom secs'), this.number(
ken.duration ?? (dir === 'drift' ? 26 : 2.5), 0.1,
(v, fin) => { if (fin) setKen({ duration: Math.max(v, 0.1) }) }))
}
// continuous loop animation
const loop = el.fx?.loop
- this.row('Loop', this.select(
+ this.row(t('Loop'), this.select(
['none', 'dash-march', 'motion-path'],
loop?.type ?? 'none',
(v) => setFx({
@@ -385,21 +386,21 @@ export class PropsPanel {
: { type: 'motion-path', path: (loop as any)?.path ?? 'M 0 0 L 100 0', duration: (loop as any)?.duration ?? 3 },
})))
if (loop) {
- this.row('Loop secs', this.number(loop.duration ?? 2, 0.1, (v, fin) =>
+ this.row(t('Loop secs'), this.number(loop.duration ?? 2, 0.1, (v, fin) =>
this.mutate(el.id, (e) => { if (e.fx?.loop) e.fx.loop.duration = Math.max(v, 0.1) }, fin)))
if (loop.type === 'motion-path') {
const path = document.createElement('input')
path.type = 'text'
path.value = loop.path
- path.title = 'SVG path the element travels along, relative to its position'
+ path.title = t('SVG path the element travels along, relative to its position')
path.addEventListener('change', () =>
this.mutate(el.id, (e) => { if (e.fx?.loop?.type === 'motion-path') e.fx.loop.path = path.value }, true))
- this.row('Path', path)
+ this.row(t('Path'), path)
const editPath = document.createElement('button')
editPath.className = 'ed-btn ed-btn-block'
- editPath.textContent = '✎ Edit path on canvas'
- editPath.title = 'Drag anchor points on the slide; double-click adds and removes points'
+ editPath.textContent = t('✎ Edit path on canvas')
+ editPath.title = t('Drag anchor points on the slide; double-click adds and removes points')
editPath.addEventListener('click', () =>
document.dispatchEvent(new CustomEvent('bento:edit-path', { detail: { id: el.id } })))
this.host.appendChild(editPath)
@@ -409,7 +410,7 @@ export class PropsPanel {
// hover-reveal set membership
const soh = document.createElement('input')
soh.type = 'text'
- soh.placeholder = 'always visible'
+ soh.placeholder = t('always visible')
soh.value = el.showOnHover ?? ''
soh.title = "Only visible while an element with this group is hovered (slide hover: 'reveal')"
soh.addEventListener('change', () => {
@@ -421,25 +422,25 @@ export class PropsPanel {
this.store.hoverPreview = soh.value || null
this.store.emit('current')
})
- this.row('Show on hover', soh)
+ this.row(t('Show on hover'), soh)
// group tag (hover focus & interaction targeting)
const group = document.createElement('input')
group.type = 'text'
- group.placeholder = 'none'
+ group.placeholder = t('none')
group.value = el.group ?? ''
group.addEventListener('change', () =>
this.mutate(el.id, (e) => {
if (group.value) e.group = group.value
else delete e.group
}, true))
- this.row('Group', group)
+ this.row(t('Group'), group)
// link → slide picker
const sel = document.createElement('select')
const none = document.createElement('option')
none.value = ''
- none.textContent = 'none'
+ none.textContent = t('none')
sel.appendChild(none)
this.store.doc.slides.forEach((s, i) => {
const o = document.createElement('option')
@@ -453,14 +454,14 @@ export class PropsPanel {
if (sel.value) e.link = sel.value
else delete e.link
}, true))
- this.row('Link to', sel)
+ this.row(t('Link to'), sel)
// one-click interactivity: duplicate this slide as a hidden state
// (element ids preserved ⇒ it morphs) and link this element to it
const makeState = document.createElement('button')
makeState.className = 'ed-btn ed-btn-block'
- makeState.textContent = '+ New state linked from this element'
- makeState.title = 'Duplicates this slide as a hidden interactive state and links the selected element to it'
+ makeState.textContent = t('+ New state linked from this element')
+ makeState.title = t('Duplicates this slide as a hidden interactive state and links the selected element to it')
makeState.addEventListener('click', () => this.createLinkedState(el))
this.host.appendChild(makeState)
}
@@ -551,32 +552,32 @@ export class PropsPanel {
}
private buildTextProps(el: TextElement) {
- this.section('Typography')
+ this.section(t('Typography'))
const hint = document.createElement('p')
hint.className = 'ed-hint'
- hint.innerHTML = 'While editing: <b>⌘B</b>/<b>⌘I</b>/<b>⌘U</b> · markdown auto-converts — **bold*&#8203;* *italic*&#8203; `code` ~~strike~~ and "- " bullets; pasting markdown converts too. Escape with \\ or press ⌘Z right after to keep the literal characters.'
+ hint.innerHTML = t('While editing: <b>⌘B</b>/<b>⌘I</b>/<b>⌘U</b> · markdown auto-converts — **bold*&#8203;* *italic*&#8203; `code` ~~strike~~ and "- " bullets; pasting markdown converts too. Escape with \\ or press ⌘Z right after to keep the literal characters.')
this.host.appendChild(hint)
- this.row('Font', this.fontSelect(el))
+ this.row(t('Font'), this.fontSelect(el))
// Shown in POINTS (the unit office users know); the model stores slide-space
// px. 1pt = 4/3 px at the slide's 96dpi space, so 32px = 24pt exactly.
- this.row('Size (pt)', this.number(Math.round(el.fontSize * 0.75 * 10) / 10, 1, (v, fin) =>
+ this.row(t('Size (pt)'), this.number(Math.round(el.fontSize * 0.75 * 10) / 10, 1, (v, fin) =>
this.mutate(el.id, (e) => {
(e as TextElement).fontSize = Math.round(Math.max(v, 3) * (4 / 3) * 100) / 100
}, fin)))
- this.row('Weight', this.weightSelect(el))
- this.row('Color', this.color(el.color, (v, fin) =>
+ this.row(t('Weight'), this.weightSelect(el))
+ this.row(t('Color'), this.color(el.color, (v, fin) =>
this.mutate(el.id, (e) => { (e as TextElement).color = v }, fin)))
- this.row('Align', this.select(['left', 'center', 'right'], el.align, (v) =>
+ this.row(t('Align'), this.select(['left', 'center', 'right'], el.align, (v) =>
this.mutate(el.id, (e) => { (e as TextElement).align = v as TextElement['align'] }, true)))
- this.row('V-align', this.select(['top', 'middle', 'bottom'], el.valign, (v) =>
+ this.row(t('V-align'), this.select(['top', 'middle', 'bottom'], el.valign, (v) =>
this.mutate(el.id, (e) => { (e as TextElement).valign = v as TextElement['valign'] }, true)))
- this.row('Line height', this.number(el.lineHeight, 0.05, (v, fin) =>
+ this.row(t('Line height'), this.number(el.lineHeight, 0.05, (v, fin) =>
this.mutate(el.id, (e) => { (e as TextElement).lineHeight = Math.max(v, 0.5) }, fin)))
const embed = document.createElement('button')
embed.className = 'ed-btn ed-btn-block'
- embed.textContent = '+ Embed font file…'
- embed.title = 'Bundle a .woff2/.woff/.ttf/.otf into this file and use it here'
+ embed.textContent = t('+ Embed font file…')
+ embed.title = t('Bundle a .woff2/.woff/.ttf/.otf into this file and use it here')
embed.addEventListener('click', () => this.embedFont(el))
this.host.appendChild(embed)
}
@@ -645,9 +646,9 @@ export class PropsPanel {
}
private buildShapeProps(el: ShapeElement) {
- this.section('Fill & stroke')
+ this.section(t('Fill & stroke'))
const grad = el.fillGradient
- this.row('Fill style', this.select(['solid', 'gradient'], grad ? 'gradient' : 'solid', (v) =>
+ this.row(t('Fill style'), this.select(['solid', 'gradient'], grad ? 'gradient' : 'solid', (v) =>
this.mutate(el.id, (e) => {
const s = e as ShapeElement
if (v === 'gradient') {
@@ -665,10 +666,10 @@ export class PropsPanel {
}, true)))
if (!grad) {
- this.row('Fill', this.colorAlpha(el.fill, (v, fin) =>
+ this.row(t('Fill'), this.colorAlpha(el.fill, (v, fin) =>
this.mutate(el.id, (e) => { (e as ShapeElement).fill = v }, fin)))
} else {
- this.row('Grad. angle', this.number(grad.angle, 1, (v, fin) =>
+ this.row(t('Grad. angle'), this.number(grad.angle, 1, (v, fin) =>
this.mutate(el.id, (e) => {
const g = (e as ShapeElement).fillGradient
if (g) g.angle = v
@@ -681,7 +682,7 @@ export class PropsPanel {
const g = (e as ShapeElement).fillGradient
if (g?.stops[i]) g.stops[i].at = Math.min(Math.max(v / 100, 0), 1)
}, fin))
- at.title = 'Position %'
+ at.title = t('Position %')
const color = this.colorAlpha(stop.color, (v, fin) =>
this.mutate(el.id, (e) => {
const g = (e as ShapeElement).fillGradient
@@ -692,7 +693,7 @@ export class PropsPanel {
const del = document.createElement('button')
del.className = 'ed-btn ed-btn-icon'
del.textContent = '✕'
- del.title = 'Remove stop'
+ del.title = t('Remove stop')
del.addEventListener('click', () =>
this.mutate(el.id, (e) => {
const g = (e as ShapeElement).fillGradient
@@ -704,7 +705,7 @@ export class PropsPanel {
})
const add = document.createElement('button')
add.className = 'ed-btn ed-btn-block'
- add.textContent = '+ Add stop'
+ add.textContent = t('+ Add stop')
add.addEventListener('click', () =>
this.mutate(el.id, (e) => {
const g = (e as ShapeElement).fillGradient
@@ -716,11 +717,11 @@ export class PropsPanel {
this.host.appendChild(add)
}
- this.row('Stroke', this.colorAlpha(el.stroke === 'transparent' ? 'rgba(30, 42, 58, 0)' : el.stroke, (v, fin) =>
+ this.row(t('Stroke'), this.colorAlpha(el.stroke === 'transparent' ? 'rgba(30, 42, 58, 0)' : el.stroke, (v, fin) =>
this.mutate(el.id, (e) => { (e as ShapeElement).stroke = v }, fin)))
- this.row('Stroke width', this.number(el.strokeWidth, 0.5, (v, fin) =>
+ this.row(t('Stroke width'), this.number(el.strokeWidth, 0.5, (v, fin) =>
this.mutate(el.id, (e) => { (e as ShapeElement).strokeWidth = Math.max(v, 0) }, fin)))
- this.row('Line style', this.select(
+ this.row(t('Line style'), this.select(
['solid', 'dashed', 'dotted'],
el.strokeStyle ?? (el.strokeDash ? 'dashed' : 'solid'),
(v) => this.mutate(el.id, (e) => {
@@ -730,20 +731,20 @@ export class PropsPanel {
}, true)))
if (el.shape === 'line') {
const ENDINGS = ['none', 'arrow', 'dot', 'bar']
- this.row('Start tip', this.select(ENDINGS, el.lineStart ?? 'none', (v) =>
+ this.row(t('Start tip'), this.select(ENDINGS, el.lineStart ?? 'none', (v) =>
this.mutate(el.id, (e) => { (e as ShapeElement).lineStart = v === 'none' ? undefined : (v as LineEnding) }, true)))
- this.row('End tip', this.select(ENDINGS, el.lineEnd ?? 'none', (v) =>
+ this.row(t('End tip'), this.select(ENDINGS, el.lineEnd ?? 'none', (v) =>
this.mutate(el.id, (e) => { (e as ShapeElement).lineEnd = v === 'none' ? undefined : (v as LineEnding) }, true)))
}
if (el.shape === 'rect') {
- this.row('Corner radius', this.number(el.radius, 1, (v, fin) =>
+ this.row(t('Corner radius'), this.number(el.radius, 1, (v, fin) =>
this.mutate(el.id, (e) => { (e as ShapeElement).radius = Math.max(v, 0) }, fin)))
}
}
private buildChartProps(el: ChartElement) {
- this.section('Data')
- this.row('Preset', this.select(Object.keys(CHART_PRESETS), el.preset ?? 'bar', (v) =>
+ this.section(t('Data'))
+ this.row(t('Preset'), this.select(Object.keys(CHART_PRESETS), el.preset ?? 'bar', (v) =>
this.mutate(el.id, (e) => {
const c = e as ChartElement
c.preset = v
@@ -752,7 +753,7 @@ export class PropsPanel {
const hint = document.createElement('p')
hint.className = 'ed-hint'
- hint.innerHTML = 'The full <b>ECharts option</b> as JSON (pure data — use template-string formatters like <code>{b}: {c}</code>, never functions). Tooltips and zoom run while presenting.'
+ hint.innerHTML = t('The full <b>ECharts option</b> as JSON (pure data — use template-string formatters like <code>{b}: {c}</code>, never functions). Tooltips and zoom run while presenting.')
this.host.appendChild(hint)
const ta = document.createElement('textarea')
@@ -773,10 +774,10 @@ export class PropsPanel {
}
private buildImageProps(el: SlideElement) {
- this.section('Image')
- this.row('Fit', this.select(['contain', 'cover', 'fill'], (el as any).fit, (v) =>
+ this.section(t('Image'))
+ this.row(t('Fit'), this.select(['contain', 'cover', 'fill'], (el as any).fit, (v) =>
this.mutate(el.id, (e) => { (e as any).fit = v }, true)))
- this.row('Corner radius', this.number((el as any).radius, 1, (v, fin) =>
+ this.row(t('Corner radius'), this.number((el as any).radius, 1, (v, fin) =>
this.mutate(el.id, (e) => { (e as any).radius = Math.max(v, 0) }, fin)))
}
@@ -786,8 +787,8 @@ export class PropsPanel {
const row = document.createElement('div')
row.className = 'ed-ops'
row.append(
- this.opBtn(ICONS.copy, 'Duplicate', () => this.duplicate(els)),
- this.opBtn(ICONS.trash, 'Delete', () => this.deleteEls(els)),
+ this.opBtn(ICONS.copy, t('Duplicate'), () => this.duplicate(els)),
+ this.opBtn(ICONS.trash, t('Delete'), () => this.deleteEls(els)),
)
this.host.appendChild(row)
}
@@ -842,12 +843,12 @@ export class PropsPanel {
g.className = 'ed-btn ed-btn-block'
const allSame = els.length > 1 && els.every((e) => e.groupId && e.groupId === els[0].groupId)
if (allSame || (grouped && els.length === 1)) {
- g.textContent = '⛓ Ungroup'
- g.title = 'Dissolve the group (⇧⌘G)'
+ g.textContent = t('⛓ Ungroup')
+ g.title = t('Dissolve the group (⇧⌘G)')
g.addEventListener('click', () => this.ungroup(els))
} else {
- g.textContent = '⛓ Group'
- g.title = 'Elements select and move as one; Alt-click reaches a member (⌘G)'
+ g.textContent = t('⛓ Group')
+ g.title = t('Elements select and move as one; Alt-click reaches a member (⌘G)')
g.addEventListener('click', () => this.group(els))
}
this.host.appendChild(g)
@@ -1045,7 +1046,7 @@ export class PropsPanel {
alpha.max = '100'
alpha.step = '1'
alpha.value = String(Math.round(parsed.a * 100))
- alpha.title = 'Opacity %'
+ alpha.title = t('Opacity %')
const emit = (final: boolean) => {
const raw = parseFloat(alpha.value)
const a = Number.isFinite(raw) ? Math.min(Math.max(raw / 100, 0), 1) : 1
@@ -1069,14 +1070,14 @@ export class PropsPanel {
if (!WEIGHTS.some(([n]) => n === current)) {
const o = document.createElement('option')
o.value = String(current)
- o.textContent = `Custom (${current})`
+ o.textContent = t('Custom ({n})', { n: current })
o.selected = true
sel.appendChild(o)
}
for (const [n, name] of WEIGHTS) {
const o = document.createElement('option')
o.value = String(n)
- o.textContent = name
+ o.textContent = t(name)
o.style.fontWeight = String(n)
if (n === current) o.selected = true
sel.appendChild(o)
@@ -1091,7 +1092,7 @@ export class PropsPanel {
for (const opt of options) {
const o = document.createElement('option')
o.value = opt
- o.textContent = opt
+ o.textContent = t(opt)
if (opt === value) o.selected = true
sel.appendChild(o)
}
diff --git a/slides/src/i18n.ts b/slides/src/i18n.ts
new file mode 100644
index 00000000..47b10590
--- /dev/null
+++ b/slides/src/i18n.ts
@@ -0,0 +1,86 @@
+// Internationalization, Bento-sized: a ~1KB t() with English-string-as-key
+// (gettext philosophy — the source stays readable, fallback is free), catalogs
+// compiled into the bundle (self-containment: nothing is fetched), and locale
+// resolution that follows the VIEWER (navigator.language, with a per-browser
+// override from the About dialog). Language never enters the document format —
+// a deck authored in Tokyo opens with French chrome in Paris.
+//
+// Catalogs live in src/i18n/<locale>.ts as flat Record<english, translation>.
+// Missing keys fall back to English automatically. {name} placeholders are
+// interpolated after lookup. Plurals: we sidestep via wording ("Slides: {n}")
+// — revisit with Intl.PluralRules if a real plural ever appears.
+
+import { ja } from './i18n/ja'
+import { zhHans } from './i18n/zh-Hans'
+import { es } from './i18n/es'
+import { fr } from './i18n/fr'
+import { de } from './i18n/de'
+
+export type Catalog = Record<string, string>
+
+const CATALOGS: Record<string, Catalog> = {
+ ja,
+ 'zh-Hans': zhHans,
+ zh: zhHans, // zh, zh-CN, zh-SG → simplified
+ es,
+ fr,
+ de,
+}
+
+/** Locales offered in the About picker (label in its own language). */
+export const LOCALE_CHOICES: Array<{ code: string; label: string }> = [
+ { code: 'en', label: 'English' },
+ { code: 'ja', label: '日本語' },
+ { code: 'zh-Hans', label: '简体中文' },
+ { code: 'es', label: 'Español' },
+ { code: 'fr', label: 'Français' },
+ { code: 'de', label: 'Deutsch' },
+]
+
+/** Accented pseudo-locale (dev builds only): exposes unswept strings and
+ * layouts that break under longer text. */
+const pseudo = (s: string): string =>
+ '⟦' +
+ s.replace(/[a-zA-Z]/g, (c) => {
+ const map: Record<string, string> = {
+ a: 'à', e: 'ē', i: 'ï', o: 'ő', u: 'ū', c: 'ĉ', n: 'ñ', s: 'š', y: 'ý',
+ A: 'Å', E: 'Ê', I: 'Ì', O: 'Ø', U: 'Ü', C: 'Ç', N: 'Ñ', S: 'Š', Y: 'Ÿ',
+ }
+ return map[c] ?? c
+ }) +
+ '⟧'
+
+function resolve(): string {
+ const saved = localStorage.getItem('bento-lang')
+ if (saved) return saved
+ const nav = navigator.language || 'en'
+ if (CATALOGS[nav]) return nav
+ const base = nav.split('-')[0]
+ if (base === 'zh') return 'zh-Hans'
+ return CATALOGS[base] ? base : 'en'
+}
+
+let current = resolve()
+
+export const locale = (): string => current
+
+/** Persist the override and switch. Callers re-render their own UI. */
+export function setLocale(code: string): void {
+ if (code === 'en') localStorage.removeItem('bento-lang')
+ else localStorage.setItem('bento-lang', code)
+ current = code
+}
+
+/** Translate an English source string, then interpolate {placeholders}. */
+export function t(en: string, vars?: Record<string, string | number>): string {
+ let out =
+ current === 'x-pseudo' ? pseudo(en) : (CATALOGS[current]?.[en] ?? en)
+ if (vars) {
+ for (const [k, v] of Object.entries(vars)) out = out.replaceAll(`{${k}}`, String(v))
+ }
+ return out
+}
+
+// dev convenience: window.bento.i18n exposes locale switching for testing;
+// the pseudo locale is reachable by setLocale('x-pseudo') in any build.
+export const i18nApi = { t, locale, setLocale, choices: LOCALE_CHOICES }
diff --git a/slides/src/i18n/de.ts b/slides/src/i18n/de.ts
new file mode 100644
index 00000000..da6193b5
--- /dev/null
+++ b/slides/src/i18n/de.ts
@@ -0,0 +1,235 @@
+// German — machine-drafted, native review welcome
+import type { Catalog } from '../i18n'
+
+export const de: Catalog = {
+ "<b>Morph</b> animates elements that appear on both this slide and the previous one (copy a slide, then move things around).": "<b>Morph</b> animiert Elemente, die auf dieser und der vorherigen Folie vorkommen (Folie duplizieren, dann Dinge verschieben).",
+ "A <b>state</b> is hidden from arrow-key flow — viewers reach it by clicking a linked element. Shared element ids morph between states.": "Ein <b>Zustand</b> liegt außerhalb des Pfeiltasten-Flusses — erreichbar per Klick auf ein verlinktes Element. Gemeinsame IDs morphen zwischen Zuständen.",
+ "A deck needs at least one slide": "Eine Präsentation braucht mindestens eine Folie",
+ "About Bento Slides — version, updates, licenses": "Über Bento Slides — Version, Updates, Lizenzen",
+ "Align": "Ausrichten",
+ "Ambient": "Ambiente",
+ "Angle": "Winkel",
+ "Arrange": "Anordnen",
+ "Arrow": "Pfeil",
+ "Background": "Hintergrund",
+ "Black": "Black",
+ "Blur": "Weichzeichnung",
+ "Bold": "Fett",
+ "Built-in": "Integriert",
+ "Bundle a .woff2/.woff/.ttf/.otf into this file and use it here": "Eine .woff2/.woff/.ttf/.otf in diese Datei einbetten und hier verwenden",
+ "Change the name used for your new comments and replies": "Namen für neue Kommentare und Antworten ändern",
+ "Chart": "Diagramm",
+ "Check for updates": "Nach Updates suchen",
+ "Check for updates automatically at launch": "Beim Start automatisch nach Updates suchen",
+ "Checked automatically at launch — you're on the latest version (v{v}).": "Beim Start automatisch geprüft — Sie haben die neueste Version (v{v}).",
+ "Checking…": "Prüfe…",
+ "Checks contact the release server and send nothing about you or this document — no ids, no telemetry.": "Prüfungen kontaktieren nur den Release-Server und senden nichts über Sie oder dieses Dokument — keine IDs, keine Telemetrie.",
+ "Click to reset": "Klicken zum Zurücksetzen",
+ "Color": "Farbe",
+ "Comment (C) — click an element or a spot on the slide": "Kommentar (C) — Element oder Stelle auf der Folie anklicken",
+ "Comment · element": "Kommentar · Element",
+ "Comment · point ({x}, {y})": "Kommentar · Punkt ({x}, {y})",
+ "Comment · slide": "Kommentar · Folie",
+ "Comment:": "Kommentar:",
+ "Corner radius": "Eckenradius",
+ "Couldn't check: {m}": "Prüfung fehlgeschlagen: {m}",
+ "Count up": "Hochzählen",
+ "Custom ({n})": "Benutzerdefiniert ({n})",
+ "Data": "Daten",
+ "Default set": "Standardgruppe",
+ "Delete": "Löschen",
+ "Delete slide": "Folie löschen",
+ "Delete this layout": "Dieses Layout löschen",
+ "Delete this slide? {parts}.": "Diese Folie löschen? {parts}.",
+ "Dissolve the group (⇧⌘G)": "Gruppe auflösen (⇧⌘G)",
+ "Download updated copy": "Aktualisierte Kopie herunterladen",
+ "Downloaded ✓": "Heruntergeladen ✓",
+ "Downloads a backup of the current version, then rewrites this file on disk as the new version — document untouched.": "Lädt ein Backup der aktuellen Version herunter und schreibt diese Datei dann als neue Version — das Dokument bleibt unverändert.",
+ "Downloads the new version with this document inside. The file you have now is not touched.": "Lädt die neue Version mit diesem Dokument herunter. Ihre aktuelle Datei bleibt unberührt.",
+ "Drag anchor points on the slide; double-click adds and removes points": "Ankerpunkte auf der Folie ziehen; Doppelklick fügt hinzu oder entfernt",
+ "Drag to resize · double-click to reset": "Ziehen zum Anpassen · Doppelklick zum Zurücksetzen",
+ "Duplicate": "Duplizieren",
+ "Duplicate slide": "Folie duplizieren",
+ "Duplicates this slide as a hidden interactive state and links the selected element to it": "Dupliziert diese Folie als versteckten interaktiven Zustand und verknüpft das ausgewählte Element damit",
+ "Elements select and move as one; Alt-click reaches a member (⌘G)": "Elemente werden gemeinsam ausgewählt und bewegt; Alt-Klick erreicht ein Mitglied (⌘G)",
+ "Ellipse": "Ellipse",
+ "End of deck": "Ende der Präsentation",
+ "End tip": "Endspitze",
+ "Enter": "Einblendung",
+ "Export PDF (print)": "PDF exportieren (Drucken)",
+ "Extra bold": "Extrafett",
+ "Extra light": "Extraleicht",
+ "Fill": "Füllung",
+ "Fill & stroke": "Füllung und Kontur",
+ "Fill style": "Füllstil",
+ "Fit": "Anpassung",
+ "Font": "Schrift",
+ "Grad. angle": "Verlaufswinkel",
+ "Group": "Gruppe",
+ "H": "H",
+ "Hover": "Hover",
+ "Hover dim": "Hover-Abdunkelung",
+ "Hover set:": "Hover-Gruppe:",
+ "Image": "Bild",
+ "Includes reveal.js, Moveable, Selecto (MIT) · Apache ECharts (Apache-2.0) · zrender (BSD-3) · Fraunces typeface (OFL-1.1) — full notices travel in this file’s source.": "Enthält reveal.js, Moveable, Selecto (MIT) · Apache ECharts (Apache-2.0) · zrender (BSD-3) · Fraunces-Schrift (OFL-1.1) — vollständige Hinweise stehen im Quelltext dieser Datei.",
+ "Insert slide here": "Folie hier einfügen",
+ "Interactivity": "Interaktivität",
+ "Language": "Sprache",
+ "Launch check couldn't reach the release server ({m}). Check manually below.": "Startprüfung konnte den Release-Server nicht erreichen ({m}). Unten manuell prüfen.",
+ "Layout": "Layout",
+ "Light": "Leicht",
+ "Line": "Linie",
+ "Line height": "Zeilenhöhe",
+ "Line style": "Linienstil",
+ "Link to": "Verlinken mit",
+ "Loop": "Schleife",
+ "Loop secs": "Schleifen-Sek.",
+ "Medium": "Medium",
+ "Morph id:": "Morph-ID:",
+ "Name": "Name",
+ "New slide": "Neue Folie",
+ "New slide from a layout": "Neue Folie aus einem Layout",
+ "Next": "Nächste",
+ "Notes": "Notizen",
+ "Notes for presenter view (press S while presenting)…": "Notizen für die Referentenansicht (S während der Präsentation)…",
+ "Opacity": "Deckkraft",
+ "Opacity %": "Deckkraft %",
+ "Open comment(s)": "Kommentar(e) öffnen",
+ "Path": "Pfad",
+ "Position %": "Position %",
+ "Position & size": "Position und Größe",
+ "Present": "Präsentieren",
+ "Present from current slide": "Ab aktueller Folie präsentieren",
+ "Presenting": "Präsentation",
+ "Preset": "Vorlage",
+ "Press <b>S</b> while presenting to open the speaker view — these notes beside the current and next slide, with a timer.": "Drücken Sie <b>S</b> während der Präsentation für die Referentenansicht — diese Notizen neben aktueller und nächster Folie, mit Timer.",
+ "Preview set": "Vorschaugruppe",
+ "Pull elements added to the parent into this state and adopt its ordering — your changes to shared elements are kept": "Übernimmt neue Elemente der Elternfolie in diesen Zustand samt Reihenfolge — Ihre Änderungen an gemeinsamen Elementen bleiben erhalten",
+ "Re-arrange this slide onto a layout — content moves by matching id, then role; extra elements are kept": "Ordnet diese Folie nach einem Layout neu — Inhalte werden per ID, dann per Rolle zugeordnet; zusätzliche Elemente bleiben",
+ "Rectangle": "Rechteck",
+ "Redo (⇧⌘Z)": "Wiederholen (⇧⌘Z)",
+ "Regular": "Regulär",
+ "Reload into new version": "Neu laden in die neue Version",
+ "Remove stop": "Stopp entfernen",
+ "Reopen": "Wieder öffnen",
+ "Reply": "Antworten",
+ "Reply…": "Antworten…",
+ "Reset zoom to fit (⌘0)": "Zoom zurücksetzen (⌘0)",
+ "Resolve": "Erledigen",
+ "Role": "Rolle",
+ "SVG path the element travels along, relative to its position": "SVG-Pfad, dem das Element folgt, relativ zu seiner Position",
+ "Save": "Speichern",
+ "Save a copy — pick a new file, leave this one untouched": "Kopie speichern — neue Datei wählen, diese bleibt unverändert",
+ "Save failed — see console": "Speichern fehlgeschlagen — siehe Konsole",
+ "Save — rewrite this file in place (⌘S)": "Speichern — Datei direkt überschreiben (⌘S)",
+ "Saved": "Gespeichert",
+ "Semibold": "Halbfett",
+ "Shadow": "Schatten",
+ "Shape": "Form",
+ "Show on hover": "Bei Hover zeigen",
+ "Size (pt)": "Größe (pt)",
+ "Slide": "Folie",
+ "Speaker notes": "Referentennotizen",
+ "Speaker view": "Referentenansicht",
+ "Start tip": "Anfangsspitze",
+ "State of": "Zustand von",
+ "Stroke": "Kontur",
+ "Stroke width": "Konturstärke",
+ "Sync from parent slide": "Von der Elternfolie synchronisieren",
+ "Text": "Text",
+ "The full <b>ECharts option</b> as JSON (pure data — use template-string formatters like <code>{b}: {c}</code>, never functions). Tooltips and zoom run while presenting.": "Die vollständige <b>ECharts-Option</b> als JSON (reine Daten — Vorlagen wie <code>{b}: {c}</code>, niemals Funktionen). Tooltips und Zoom laufen beim Präsentieren.",
+ "Thin": "Dünn",
+ "This browser can’t rewrite files in place — a fresh copy went to Downloads": "Dieser Browser kann Dateien nicht direkt überschreiben — eine neue Kopie liegt in Downloads",
+ "This document": "Dieses Dokument",
+ "This file carries its own app — it works offline, forever, as is.": "Diese Datei trägt ihre eigene App — sie funktioniert offline, für immer, so wie sie ist.",
+ "This window is still running v{v} — reload to finish. A v{v} backup was downloaded.": "Dieses Fenster läuft noch mit v{v} — zum Abschließen neu laden. Ein v{v}-Backup wurde heruntergeladen.",
+ "This window is still running v{v}. If you overwrote the file that's open here, reload; otherwise open the file you saved.": "Dieses Fenster läuft noch mit v{v}. Wenn Sie die geöffnete Datei überschrieben haben, neu laden; andernfalls die gespeicherte Datei öffnen.",
+ "This window keeps running v{v} until you open the downloaded file.": "Dieses Fenster bleibt bei v{v}, bis Sie die heruntergeladene Datei öffnen.",
+ "Toggle properties (])": "Eigenschaften ein-/ausblenden (])",
+ "Toggle slide list ([)": "Folienliste ein-/ausblenden ([)",
+ "Transition": "Übergang",
+ "Triangle": "Dreieck",
+ "Typography": "Typografie",
+ "Undo (⌘Z)": "Rückgängig (⌘Z)",
+ "Unsaved changes": "Ungespeicherte Änderungen",
+ "Untitled": "Ohne Titel",
+ "Up to date (v{v}) — checked at launch": "Aktuell (v{v}) — beim Start geprüft",
+ "Up to date — v{v}": "Aktuell — v{v}",
+ "Update available: v{v} — click the peach button to update": "Update verfügbar: v{v} — zum Aktualisieren auf den pfirsichfarbenen Button klicken",
+ "Update check failed: {m} — click to retry": "Update-Prüfung fehlgeschlagen: {m} — klicken zum Wiederholen",
+ "Update failed: {m}": "Update fehlgeschlagen: {m}",
+ "Update this file": "Diese Datei aktualisieren",
+ "Update this file…": "Diese Datei aktualisieren…",
+ "Updated to v{v} on disk.": "Auf v{v} auf der Festplatte aktualisiert.",
+ "V-align": "Vert. Ausrichtung",
+ "Verifies and builds the new version with this document inside, then asks where to save it — pick the file you have open to update it.": "Verifiziert und erstellt die neue Version mit diesem Dokument und fragt nach dem Speicherort — wählen Sie die geöffnete Datei, um sie zu aktualisieren.",
+ "Verifying…": "Verifiziere…",
+ "Version {v} is available — click to update": "Version {v} verfügbar — klicken zum Aktualisieren",
+ "Version {v} is available.": "Version {v} ist verfügbar.",
+ "W": "B",
+ "Weight": "Strichstärke",
+ "While editing: <b>⌘B</b>/<b>⌘I</b>/<b>⌘U</b> · markdown auto-converts — **bold*&#8203;* *italic*&#8203; `code` ~~strike~~ and \"- \" bullets; pasting markdown converts too. Escape with \\ or press ⌘Z right after to keep the literal characters.": "Beim Bearbeiten: <b>⌘B</b>/<b>⌘I</b>/<b>⌘U</b> · Markdown wird beim Tippen umgewandelt — **fett*&#8203;* *kursiv*&#8203; `Code` ~~durchgestrichen~~ und „- “-Listen; Einfügen wandelt ebenfalls um. Mit \\ escapen oder direkt danach ⌘Z für die Originalzeichen.",
+ "While presenting, hovering an element whose <b>group</b> matches a set name shows that set. Use Preview to edit each set.": "Beim Präsentieren zeigt das Überfahren eines Elements, dessen <b>group</b> einem Gruppennamen entspricht, diese Gruppe. Mit der Vorschau bearbeiten.",
+ "X": "X",
+ "Y": "Y",
+ "You're on the latest version (v{v}).": "Sie haben die neueste Version (v{v}).",
+ "Your name (shown on comments):": "Ihr Name (bei Kommentaren sichtbar):",
+ "Your name (shown on new comments):": "Ihr Name (bei neuen Kommentaren sichtbar):",
+ "Zoom": "Zoom",
+ "Zoom %": "Zoom %",
+ "Zoom in (⌘+)": "Vergrößern (⌘+)",
+ "Zoom out (⌘−)": "Verkleinern (⌘−)",
+ "Zoom secs": "Zoom-Sek.",
+ "always visible": "immer sichtbar",
+ "body": "Fließtext",
+ "bottom": "unten",
+ "center": "zentriert",
+ "contain": "einpassen",
+ "cover": "füllen",
+ "custom": "benutzerdefiniert",
+ "dash-march": "Strich-Lauf",
+ "dashed": "gestrichelt",
+ "dotted": "gepunktet",
+ "drift": "Drift",
+ "fade": "Überblendung",
+ "fade-up": "Einblenden von unten",
+ "fill": "strecken",
+ "focus-group": "Fokusgruppe",
+ "gradient": "Verlauf",
+ "just now": "gerade eben",
+ "kenburns": "Ken Burns",
+ "kicker": "Dachzeile",
+ "left": "links",
+ "middle": "Mitte",
+ "morph": "Morph",
+ "motion-path": "Bewegungspfad",
+ "no — normal slide": "nein — normale Folie",
+ "none": "keine",
+ "off": "aus",
+ "on": "an",
+ "reveal": "aufdecken",
+ "right": "rechts",
+ "slide": "gleiten",
+ "solid": "durchgezogen",
+ "subtitle": "Untertitel",
+ "title": "Titel",
+ "top": "oben",
+ "unnamed": "unbenannt",
+ "you: {name} ✎": "Sie: {name} ✎",
+ "zoom": "Zoom",
+ "zoom-in": "hineinzoomen",
+ "zoom-out": "herauszoomen",
+ "{n}d ago": "vor {n} T",
+ "{n}h ago": "vor {n} Std",
+ "{n}m ago": "vor {n} Min",
+ "— no notes for this slide —": "— keine Notizen zu dieser Folie —",
+ "⛓ Group": "⛓ Gruppieren",
+ "⛓ Ungroup": "⛓ Gruppierung aufheben",
+ "✎ Edit path on canvas": "✎ Pfad auf der Leinwand bearbeiten",
+ "⧉ Apply layout…": "⧉ Layout anwenden…",
+ "+ Add stop": "+ Stopp hinzufügen",
+ "+ Embed font file…": "+ Schriftdatei einbetten…",
+ "+ New state linked from this element": "+ Neuer Zustand, verlinkt von diesem Element",
+ "+ Save slide as layout…": "+ Folie als Layout speichern…",
+ "💬 whole slide": "💬 ganze Folie",
+}
diff --git a/slides/src/i18n/es.ts b/slides/src/i18n/es.ts
new file mode 100644
index 00000000..66b3b313
--- /dev/null
+++ b/slides/src/i18n/es.ts
@@ -0,0 +1,235 @@
+// Spanish — machine-drafted, native review welcome
+import type { Catalog } from '../i18n'
+
+export const es: Catalog = {
+ "<b>Morph</b> animates elements that appear on both this slide and the previous one (copy a slide, then move things around).": "<b>Morph</b> anima los elementos presentes en esta diapositiva y en la anterior (duplica una diapositiva y mueve cosas).",
+ "A <b>state</b> is hidden from arrow-key flow — viewers reach it by clicking a linked element. Shared element ids morph between states.": "Un <b>estado</b> queda fuera del flujo de flechas — se llega haciendo clic en un elemento enlazado. Los ids compartidos se transforman entre estados.",
+ "A deck needs at least one slide": "Una presentación necesita al menos una diapositiva",
+ "About Bento Slides — version, updates, licenses": "Acerca de Bento Slides — versión, actualizaciones, licencias",
+ "Align": "Alinear",
+ "Ambient": "Ambiente",
+ "Angle": "Ángulo",
+ "Arrange": "Organizar",
+ "Arrow": "Flecha",
+ "Background": "Fondo",
+ "Black": "Black",
+ "Blur": "Desenfoque",
+ "Bold": "Negrita",
+ "Built-in": "Integrados",
+ "Bundle a .woff2/.woff/.ttf/.otf into this file and use it here": "Incrusta un .woff2/.woff/.ttf/.otf en este archivo y úsalo aquí",
+ "Change the name used for your new comments and replies": "Cambiar el nombre para tus nuevos comentarios y respuestas",
+ "Chart": "Gráfico",
+ "Check for updates": "Buscar actualizaciones",
+ "Check for updates automatically at launch": "Buscar actualizaciones automáticamente al iniciar",
+ "Checked automatically at launch — you're on the latest version (v{v}).": "Comprobado automáticamente al iniciar — tienes la última versión (v{v}).",
+ "Checking…": "Comprobando…",
+ "Checks contact the release server and send nothing about you or this document — no ids, no telemetry.": "Las comprobaciones contactan el servidor de versiones sin enviar nada sobre ti ni este documento — sin IDs, sin telemetría.",
+ "Click to reset": "Clic para reiniciar",
+ "Color": "Color",
+ "Comment (C) — click an element or a spot on the slide": "Comentario (C) — haz clic en un elemento o un punto de la diapositiva",
+ "Comment · element": "Comentario · elemento",
+ "Comment · point ({x}, {y})": "Comentario · punto ({x}, {y})",
+ "Comment · slide": "Comentario · diapositiva",
+ "Comment:": "Comentario:",
+ "Corner radius": "Radio de esquina",
+ "Couldn't check: {m}": "No se pudo comprobar: {m}",
+ "Count up": "Contador",
+ "Custom ({n})": "Personalizado ({n})",
+ "Data": "Datos",
+ "Default set": "Grupo predeterminado",
+ "Delete": "Eliminar",
+ "Delete slide": "Eliminar diapositiva",
+ "Delete this layout": "Eliminar este diseño",
+ "Delete this slide? {parts}.": "¿Eliminar esta diapositiva? {parts}.",
+ "Dissolve the group (⇧⌘G)": "Deshacer el grupo (⇧⌘G)",
+ "Download updated copy": "Descargar copia actualizada",
+ "Downloaded ✓": "Descargado ✓",
+ "Downloads a backup of the current version, then rewrites this file on disk as the new version — document untouched.": "Descarga una copia de seguridad de la versión actual y reescribe este archivo con la nueva versión — el documento no cambia.",
+ "Downloads the new version with this document inside. The file you have now is not touched.": "Descarga la nueva versión con este documento dentro. Tu archivo actual no se toca.",
+ "Drag anchor points on the slide; double-click adds and removes points": "Arrastra los puntos de anclaje; doble clic añade o elimina puntos",
+ "Drag to resize · double-click to reset": "Arrastra para redimensionar · doble clic para restablecer",
+ "Duplicate": "Duplicar",
+ "Duplicate slide": "Duplicar diapositiva",
+ "Duplicates this slide as a hidden interactive state and links the selected element to it": "Duplica esta diapositiva como estado interactivo oculto y enlaza el elemento seleccionado",
+ "Elements select and move as one; Alt-click reaches a member (⌘G)": "Los elementos se seleccionan y mueven como uno; Alt-clic alcanza un miembro (⌘G)",
+ "Ellipse": "Elipse",
+ "End of deck": "Fin de la presentación",
+ "End tip": "Punta final",
+ "Enter": "Entrada",
+ "Export PDF (print)": "Exportar PDF (imprimir)",
+ "Extra bold": "Extra negrita",
+ "Extra light": "Extra fina",
+ "Fill": "Relleno",
+ "Fill & stroke": "Relleno y trazo",
+ "Fill style": "Estilo de relleno",
+ "Fit": "Ajuste",
+ "Font": "Fuente",
+ "Grad. angle": "Ángulo grad.",
+ "Group": "Grupo",
+ "H": "Al",
+ "Hover": "Hover",
+ "Hover dim": "Atenuación hover",
+ "Hover set:": "Grupo hover:",
+ "Image": "Imagen",
+ "Includes reveal.js, Moveable, Selecto (MIT) · Apache ECharts (Apache-2.0) · zrender (BSD-3) · Fraunces typeface (OFL-1.1) — full notices travel in this file’s source.": "Incluye reveal.js, Moveable, Selecto (MIT) · Apache ECharts (Apache-2.0) · zrender (BSD-3) · tipografía Fraunces (OFL-1.1) — los avisos completos viajan en el código de este archivo.",
+ "Insert slide here": "Insertar diapositiva aquí",
+ "Interactivity": "Interactividad",
+ "Language": "Idioma",
+ "Launch check couldn't reach the release server ({m}). Check manually below.": "La comprobación inicial no alcanzó el servidor ({m}). Comprueba manualmente abajo.",
+ "Layout": "Diseño",
+ "Light": "Fina",
+ "Line": "Línea",
+ "Line height": "Interlineado",
+ "Line style": "Estilo de línea",
+ "Link to": "Enlazar a",
+ "Loop": "Bucle",
+ "Loop secs": "Segs. de bucle",
+ "Medium": "Media",
+ "Morph id:": "Id de morph:",
+ "Name": "Nombre",
+ "New slide": "Nueva diapositiva",
+ "New slide from a layout": "Nueva diapositiva desde un diseño",
+ "Next": "Siguiente",
+ "Notes": "Notas",
+ "Notes for presenter view (press S while presenting)…": "Notas para la vista de presentador (pulsa S al presentar)…",
+ "Opacity": "Opacidad",
+ "Opacity %": "Opacidad %",
+ "Open comment(s)": "Abrir comentario(s)",
+ "Path": "Trazado",
+ "Position %": "Posición %",
+ "Position & size": "Posición y tamaño",
+ "Present": "Presentar",
+ "Present from current slide": "Presentar desde la diapositiva actual",
+ "Presenting": "Presentación",
+ "Preset": "Preajuste",
+ "Press <b>S</b> while presenting to open the speaker view — these notes beside the current and next slide, with a timer.": "Pulsa <b>S</b> al presentar para abrir la vista de presentador — estas notas junto a la diapositiva actual y la siguiente, con temporizador.",
+ "Preview set": "Grupo de vista previa",
+ "Pull elements added to the parent into this state and adopt its ordering — your changes to shared elements are kept": "Trae a este estado los elementos añadidos al padre y adopta su orden — tus cambios en elementos compartidos se conservan",
+ "Re-arrange this slide onto a layout — content moves by matching id, then role; extra elements are kept": "Reorganiza esta diapositiva según un diseño — el contenido se asigna por id y luego por rol; los elementos extra se conservan",
+ "Rectangle": "Rectángulo",
+ "Redo (⇧⌘Z)": "Rehacer (⇧⌘Z)",
+ "Regular": "Regular",
+ "Reload into new version": "Recargar en la nueva versión",
+ "Remove stop": "Quitar parada",
+ "Reopen": "Reabrir",
+ "Reply": "Responder",
+ "Reply…": "Responder…",
+ "Reset zoom to fit (⌘0)": "Restablecer zoom para ajustar (⌘0)",
+ "Resolve": "Resolver",
+ "Role": "Rol",
+ "SVG path the element travels along, relative to its position": "Trazado SVG que recorre el elemento, relativo a su posición",
+ "Save": "Guardar",
+ "Save a copy — pick a new file, leave this one untouched": "Guardar una copia — elige un archivo nuevo y deja este intacto",
+ "Save failed — see console": "Error al guardar — mira la consola",
+ "Save — rewrite this file in place (⌘S)": "Guardar — reescribe este archivo en el sitio (⌘S)",
+ "Saved": "Guardado",
+ "Semibold": "Seminegrita",
+ "Shadow": "Sombra",
+ "Shape": "Forma",
+ "Show on hover": "Mostrar al pasar",
+ "Size (pt)": "Tamaño (pt)",
+ "Slide": "Diapositiva",
+ "Speaker notes": "Notas del orador",
+ "Speaker view": "Vista de presentador",
+ "Start tip": "Punta inicial",
+ "State of": "Estado de",
+ "Stroke": "Trazo",
+ "Stroke width": "Grosor de trazo",
+ "Sync from parent slide": "Sincronizar desde la diapositiva padre",
+ "Text": "Texto",
+ "The full <b>ECharts option</b> as JSON (pure data — use template-string formatters like <code>{b}: {c}</code>, never functions). Tooltips and zoom run while presenting.": "La <b>opción de ECharts</b> completa como JSON (datos puros — usa plantillas como <code>{b}: {c}</code>, nunca funciones). Los tooltips y el zoom funcionan al presentar.",
+ "Thin": "Muy fina",
+ "This browser can’t rewrite files in place — a fresh copy went to Downloads": "Este navegador no puede reescribir archivos en el sitio — una copia nueva fue a Descargas",
+ "This document": "Este documento",
+ "This file carries its own app — it works offline, forever, as is.": "Este archivo lleva su propia aplicación — funciona sin conexión, para siempre, tal cual.",
+ "This window is still running v{v} — reload to finish. A v{v} backup was downloaded.": "Esta ventana sigue en v{v} — recarga para terminar. Se descargó una copia de seguridad v{v}.",
+ "This window is still running v{v}. If you overwrote the file that's open here, reload; otherwise open the file you saved.": "Esta ventana sigue en v{v}. Si sobrescribiste el archivo abierto aquí, recarga; si no, abre el archivo que guardaste.",
+ "This window keeps running v{v} until you open the downloaded file.": "Esta ventana seguirá en v{v} hasta que abras el archivo descargado.",
+ "Toggle properties (])": "Mostrar/ocultar propiedades (])",
+ "Toggle slide list ([)": "Mostrar/ocultar lista de diapositivas ([)",
+ "Transition": "Transición",
+ "Triangle": "Triángulo",
+ "Typography": "Tipografía",
+ "Undo (⌘Z)": "Deshacer (⌘Z)",
+ "Unsaved changes": "Cambios sin guardar",
+ "Untitled": "Sin título",
+ "Up to date (v{v}) — checked at launch": "Actualizado (v{v}) — comprobado al iniciar",
+ "Up to date — v{v}": "Actualizado — v{v}",
+ "Update available: v{v} — click the peach button to update": "Actualización disponible: v{v} — haz clic en el botón melocotón para actualizar",
+ "Update check failed: {m} — click to retry": "Falló la comprobación: {m} — clic para reintentar",
+ "Update failed: {m}": "Falló la actualización: {m}",
+ "Update this file": "Actualizar este archivo",
+ "Update this file…": "Actualizar este archivo…",
+ "Updated to v{v} on disk.": "Actualizado a v{v} en disco.",
+ "V-align": "Alineación vert.",
+ "Verifies and builds the new version with this document inside, then asks where to save it — pick the file you have open to update it.": "Verifica y construye la nueva versión con este documento dentro, y pregunta dónde guardarla — elige el archivo que tienes abierto para actualizarlo.",
+ "Verifying…": "Verificando…",
+ "Version {v} is available — click to update": "Versión {v} disponible — clic para actualizar",
+ "Version {v} is available.": "Versión {v} disponible.",
+ "W": "An",
+ "Weight": "Peso",
+ "While editing: <b>⌘B</b>/<b>⌘I</b>/<b>⌘U</b> · markdown auto-converts — **bold*&#8203;* *italic*&#8203; `code` ~~strike~~ and \"- \" bullets; pasting markdown converts too. Escape with \\ or press ⌘Z right after to keep the literal characters.": "Al editar: <b>⌘B</b>/<b>⌘I</b>/<b>⌘U</b> · el markdown se convierte al teclear — **negrita*&#8203;* *cursiva*&#8203; `código` ~~tachado~~ y viñetas con «- »; pegar también convierte. Escapa con \\ o pulsa ⌘Z justo después para conservar los caracteres.",
+ "While presenting, hovering an element whose <b>group</b> matches a set name shows that set. Use Preview to edit each set.": "Al presentar, pasar sobre un elemento cuyo <b>group</b> coincide con un grupo muestra ese grupo. Usa la vista previa para editar cada uno.",
+ "X": "X",
+ "Y": "Y",
+ "You're on the latest version (v{v}).": "Tienes la última versión (v{v}).",
+ "Your name (shown on comments):": "Tu nombre (visible en los comentarios):",
+ "Your name (shown on new comments):": "Tu nombre (visible en los nuevos comentarios):",
+ "Zoom": "Zoom",
+ "Zoom %": "Zoom %",
+ "Zoom in (⌘+)": "Acercar (⌘+)",
+ "Zoom out (⌘−)": "Alejar (⌘−)",
+ "Zoom secs": "Segs. de zoom",
+ "always visible": "siempre visible",
+ "body": "cuerpo",
+ "bottom": "abajo",
+ "center": "centro",
+ "contain": "contener",
+ "cover": "cubrir",
+ "custom": "personalizado",
+ "dash-march": "marcha de guiones",
+ "dashed": "discontinua",
+ "dotted": "punteada",
+ "drift": "deriva",
+ "fade": "fundido",
+ "fade-up": "fundido ascendente",
+ "fill": "estirar",
+ "focus-group": "grupo de foco",
+ "gradient": "degradado",
+ "just now": "ahora mismo",
+ "kenburns": "Ken Burns",
+ "kicker": "antetítulo",
+ "left": "izquierda",
+ "middle": "medio",
+ "morph": "morph",
+ "motion-path": "trayectoria",
+ "no — normal slide": "no — diapositiva normal",
+ "none": "ninguno",
+ "off": "no",
+ "on": "sí",
+ "reveal": "revelar",
+ "right": "derecha",
+ "slide": "deslizar",
+ "solid": "continua",
+ "subtitle": "subtítulo",
+ "title": "título",
+ "top": "arriba",
+ "unnamed": "sin nombre",
+ "you: {name} ✎": "tú: {name} ✎",
+ "zoom": "zoom",
+ "zoom-in": "acercar",
+ "zoom-out": "alejar",
+ "{n}d ago": "hace {n} d",
+ "{n}h ago": "hace {n} h",
+ "{n}m ago": "hace {n} min",
+ "— no notes for this slide —": "— sin notas para esta diapositiva —",
+ "⛓ Group": "⛓ Agrupar",
+ "⛓ Ungroup": "⛓ Desagrupar",
+ "✎ Edit path on canvas": "✎ Editar trazado en el lienzo",
+ "⧉ Apply layout…": "⧉ Aplicar diseño…",
+ "+ Add stop": "+ Añadir parada",
+ "+ Embed font file…": "+ Incrustar fuente…",
+ "+ New state linked from this element": "+ Nuevo estado enlazado desde este elemento",
+ "+ Save slide as layout…": "+ Guardar diapositiva como diseño…",
+ "💬 whole slide": "💬 toda la diapositiva",
+}
diff --git a/slides/src/i18n/fr.ts b/slides/src/i18n/fr.ts
new file mode 100644
index 00000000..2d095c02
--- /dev/null
+++ b/slides/src/i18n/fr.ts
@@ -0,0 +1,235 @@
+// French — machine-drafted, native review welcome
+import type { Catalog } from '../i18n'
+
+export const fr: Catalog = {
+ "<b>Morph</b> animates elements that appear on both this slide and the previous one (copy a slide, then move things around).": "<b>Morph</b> anime les éléments présents sur cette diapositive et la précédente (dupliquez une diapositive puis déplacez des éléments).",
+ "A <b>state</b> is hidden from arrow-key flow — viewers reach it by clicking a linked element. Shared element ids morph between states.": "Un <b>état</b> est hors du flux des flèches — on l'atteint en cliquant un élément lié. Les ids partagés se transforment entre états.",
+ "A deck needs at least one slide": "Une présentation doit contenir au moins une diapositive",
+ "About Bento Slides — version, updates, licenses": "À propos de Bento Slides — version, mises à jour, licences",
+ "Align": "Aligner",
+ "Ambient": "Ambiance",
+ "Angle": "Angle",
+ "Arrange": "Disposition",
+ "Arrow": "Flèche",
+ "Background": "Arrière-plan",
+ "Black": "Black",
+ "Blur": "Flou",
+ "Bold": "Gras",
+ "Built-in": "Intégrés",
+ "Bundle a .woff2/.woff/.ttf/.otf into this file and use it here": "Incorporer un .woff2/.woff/.ttf/.otf dans ce fichier et l'utiliser ici",
+ "Change the name used for your new comments and replies": "Changer le nom utilisé pour vos nouveaux commentaires et réponses",
+ "Chart": "Graphique",
+ "Check for updates": "Rechercher des mises à jour",
+ "Check for updates automatically at launch": "Rechercher automatiquement les mises à jour au démarrage",
+ "Checked automatically at launch — you're on the latest version (v{v}).": "Vérifié automatiquement au démarrage — vous avez la dernière version (v{v}).",
+ "Checking…": "Vérification…",
+ "Checks contact the release server and send nothing about you or this document — no ids, no telemetry.": "Les vérifications contactent le serveur de versions sans rien envoyer sur vous ni ce document — pas d'ID, pas de télémétrie.",
+ "Click to reset": "Cliquer pour réinitialiser",
+ "Color": "Couleur",
+ "Comment (C) — click an element or a spot on the slide": "Commentaire (C) — cliquez sur un élément ou un point de la diapositive",
+ "Comment · element": "Commentaire · élément",
+ "Comment · point ({x}, {y})": "Commentaire · point ({x}, {y})",
+ "Comment · slide": "Commentaire · diapositive",
+ "Comment:": "Commentaire :",
+ "Corner radius": "Rayon d'angle",
+ "Couldn't check: {m}": "Vérification impossible : {m}",
+ "Count up": "Compteur",
+ "Custom ({n})": "Personnalisé ({n})",
+ "Data": "Données",
+ "Default set": "Groupe par défaut",
+ "Delete": "Supprimer",
+ "Delete slide": "Supprimer la diapositive",
+ "Delete this layout": "Supprimer cette disposition",
+ "Delete this slide? {parts}.": "Supprimer cette diapositive ? {parts}.",
+ "Dissolve the group (⇧⌘G)": "Dissoudre le groupe (⇧⌘G)",
+ "Download updated copy": "Télécharger la copie à jour",
+ "Downloaded ✓": "Téléchargé ✓",
+ "Downloads a backup of the current version, then rewrites this file on disk as the new version — document untouched.": "Télécharge une sauvegarde de la version actuelle, puis réécrit ce fichier avec la nouvelle version — document intact.",
+ "Downloads the new version with this document inside. The file you have now is not touched.": "Télécharge la nouvelle version avec ce document à l'intérieur. Votre fichier actuel n'est pas modifié.",
+ "Drag anchor points on the slide; double-click adds and removes points": "Glissez les points d'ancrage ; double-clic pour ajouter ou retirer",
+ "Drag to resize · double-click to reset": "Glisser pour redimensionner · double-clic pour réinitialiser",
+ "Duplicate": "Dupliquer",
+ "Duplicate slide": "Dupliquer la diapositive",
+ "Duplicates this slide as a hidden interactive state and links the selected element to it": "Duplique cette diapositive en état interactif masqué et y relie l'élément sélectionné",
+ "Elements select and move as one; Alt-click reaches a member (⌘G)": "Les éléments se sélectionnent et bougent ensemble ; Alt-clic atteint un membre (⌘G)",
+ "Ellipse": "Ellipse",
+ "End of deck": "Fin de la présentation",
+ "End tip": "Embout final",
+ "Enter": "Entrée",
+ "Export PDF (print)": "Exporter en PDF (imprimer)",
+ "Extra bold": "Extra gras",
+ "Extra light": "Extra fin",
+ "Fill": "Remplissage",
+ "Fill & stroke": "Remplissage et contour",
+ "Fill style": "Style de remplissage",
+ "Fit": "Ajustement",
+ "Font": "Police",
+ "Grad. angle": "Angle dégradé",
+ "Group": "Groupe",
+ "H": "H",
+ "Hover": "Survol",
+ "Hover dim": "Atténuation au survol",
+ "Hover set:": "Groupe de survol :",
+ "Image": "Image",
+ "Includes reveal.js, Moveable, Selecto (MIT) · Apache ECharts (Apache-2.0) · zrender (BSD-3) · Fraunces typeface (OFL-1.1) — full notices travel in this file’s source.": "Inclut reveal.js, Moveable, Selecto (MIT) · Apache ECharts (Apache-2.0) · zrender (BSD-3) · police Fraunces (OFL-1.1) — les mentions complètes voyagent dans la source de ce fichier.",
+ "Insert slide here": "Insérer une diapositive ici",
+ "Interactivity": "Interactivité",
+ "Language": "Langue",
+ "Launch check couldn't reach the release server ({m}). Check manually below.": "La vérification au démarrage n'a pas atteint le serveur ({m}). Vérifiez manuellement ci-dessous.",
+ "Layout": "Disposition",
+ "Light": "Fin",
+ "Line": "Ligne",
+ "Line height": "Interligne",
+ "Line style": "Style de ligne",
+ "Link to": "Lier à",
+ "Loop": "Boucle",
+ "Loop secs": "Secondes de boucle",
+ "Medium": "Medium",
+ "Morph id:": "Id de morph :",
+ "Name": "Nom",
+ "New slide": "Nouvelle diapositive",
+ "New slide from a layout": "Nouvelle diapositive depuis une disposition",
+ "Next": "Suivante",
+ "Notes": "Notes",
+ "Notes for presenter view (press S while presenting)…": "Notes pour la vue présentateur (touche S pendant la présentation)…",
+ "Opacity": "Opacité",
+ "Opacity %": "Opacité %",
+ "Open comment(s)": "Ouvrir le(s) commentaire(s)",
+ "Path": "Tracé",
+ "Position %": "Position %",
+ "Position & size": "Position et taille",
+ "Present": "Présenter",
+ "Present from current slide": "Présenter depuis la diapositive actuelle",
+ "Presenting": "Présentation",
+ "Preset": "Préréglage",
+ "Press <b>S</b> while presenting to open the speaker view — these notes beside the current and next slide, with a timer.": "Appuyez sur <b>S</b> pendant la présentation pour la vue présentateur — ces notes à côté de la diapositive actuelle et de la suivante, avec minuteur.",
+ "Preview set": "Groupe d'aperçu",
+ "Pull elements added to the parent into this state and adopt its ordering — your changes to shared elements are kept": "Rapatrie dans cet état les éléments ajoutés au parent et adopte son ordre — vos modifications des éléments partagés sont conservées",
+ "Re-arrange this slide onto a layout — content moves by matching id, then role; extra elements are kept": "Réorganise cette diapositive selon une disposition — le contenu correspond par id puis par rôle ; les éléments en plus restent",
+ "Rectangle": "Rectangle",
+ "Redo (⇧⌘Z)": "Rétablir (⇧⌘Z)",
+ "Regular": "Normal",
+ "Reload into new version": "Recharger dans la nouvelle version",
+ "Remove stop": "Retirer l'étape",
+ "Reopen": "Rouvrir",
+ "Reply": "Répondre",
+ "Reply…": "Répondre…",
+ "Reset zoom to fit (⌘0)": "Réinitialiser le zoom (⌘0)",
+ "Resolve": "Résoudre",
+ "Role": "Rôle",
+ "SVG path the element travels along, relative to its position": "Tracé SVG suivi par l'élément, relatif à sa position",
+ "Save": "Enregistrer",
+ "Save a copy — pick a new file, leave this one untouched": "Enregistrer une copie — choisir un nouveau fichier, celui-ci reste intact",
+ "Save failed — see console": "Échec de l'enregistrement — voir la console",
+ "Save — rewrite this file in place (⌘S)": "Enregistrer — réécrit ce fichier sur place (⌘S)",
+ "Saved": "Enregistré",
+ "Semibold": "Demi-gras",
+ "Shadow": "Ombre",
+ "Shape": "Forme",
+ "Show on hover": "Afficher au survol",
+ "Size (pt)": "Taille (pt)",
+ "Slide": "Diapositive",
+ "Speaker notes": "Notes de l'orateur",
+ "Speaker view": "Vue présentateur",
+ "Start tip": "Embout initial",
+ "State of": "État de",
+ "Stroke": "Contour",
+ "Stroke width": "Épaisseur de contour",
+ "Sync from parent slide": "Synchroniser depuis la diapositive parente",
+ "Text": "Texte",
+ "The full <b>ECharts option</b> as JSON (pure data — use template-string formatters like <code>{b}: {c}</code>, never functions). Tooltips and zoom run while presenting.": "L'<b>option ECharts</b> complète en JSON (données pures — modèles comme <code>{b}: {c}</code>, jamais de fonctions). Infobulles et zoom actifs en présentation.",
+ "Thin": "Très fin",
+ "This browser can’t rewrite files in place — a fresh copy went to Downloads": "Ce navigateur ne peut pas réécrire les fichiers sur place — une copie est allée dans Téléchargements",
+ "This document": "Ce document",
+ "This file carries its own app — it works offline, forever, as is.": "Ce fichier embarque sa propre application — il fonctionne hors ligne, pour toujours, tel quel.",
+ "This window is still running v{v} — reload to finish. A v{v} backup was downloaded.": "Cette fenêtre tourne encore en v{v} — rechargez pour terminer. Une sauvegarde v{v} a été téléchargée.",
+ "This window is still running v{v}. If you overwrote the file that's open here, reload; otherwise open the file you saved.": "Cette fenêtre tourne encore en v{v}. Si vous avez écrasé le fichier ouvert ici, rechargez ; sinon ouvrez le fichier enregistré.",
+ "This window keeps running v{v} until you open the downloaded file.": "Cette fenêtre reste en v{v} jusqu'à l'ouverture du fichier téléchargé.",
+ "Toggle properties (])": "Afficher/masquer les propriétés (])",
+ "Toggle slide list ([)": "Afficher/masquer la liste ([)",
+ "Transition": "Transition",
+ "Triangle": "Triangle",
+ "Typography": "Typographie",
+ "Undo (⌘Z)": "Annuler (⌘Z)",
+ "Unsaved changes": "Modifications non enregistrées",
+ "Untitled": "Sans titre",
+ "Up to date (v{v}) — checked at launch": "À jour (v{v}) — vérifié au démarrage",
+ "Up to date — v{v}": "À jour — v{v}",
+ "Update available: v{v} — click the peach button to update": "Mise à jour disponible : v{v} — cliquez sur le bouton pêche pour mettre à jour",
+ "Update check failed: {m} — click to retry": "Échec de la vérification : {m} — cliquez pour réessayer",
+ "Update failed: {m}": "Échec de la mise à jour : {m}",
+ "Update this file": "Mettre à jour ce fichier",
+ "Update this file…": "Mettre à jour ce fichier…",
+ "Updated to v{v} on disk.": "Mis à jour en v{v} sur le disque.",
+ "V-align": "Alignement vert.",
+ "Verifies and builds the new version with this document inside, then asks where to save it — pick the file you have open to update it.": "Vérifie et construit la nouvelle version avec ce document, puis demande où l'enregistrer — choisissez le fichier ouvert pour le mettre à jour.",
+ "Verifying…": "Vérification…",
+ "Version {v} is available — click to update": "Version {v} disponible — cliquez pour mettre à jour",
+ "Version {v} is available.": "La version {v} est disponible.",
+ "W": "L",
+ "Weight": "Graisse",
+ "While editing: <b>⌘B</b>/<b>⌘I</b>/<b>⌘U</b> · markdown auto-converts — **bold*&#8203;* *italic*&#8203; `code` ~~strike~~ and \"- \" bullets; pasting markdown converts too. Escape with \\ or press ⌘Z right after to keep the literal characters.": "En édition : <b>⌘B</b>/<b>⌘I</b>/<b>⌘U</b> · le markdown se convertit à la frappe — **gras*&#8203;* *italique*&#8203; `code` ~~barré~~ et puces « - » ; le collage convertit aussi. Échappez avec \\ ou ⌘Z juste après pour garder les caractères.",
+ "While presenting, hovering an element whose <b>group</b> matches a set name shows that set. Use Preview to edit each set.": "En présentation, survoler un élément dont le <b>group</b> correspond à un nom de groupe affiche ce groupe. Utilisez l'aperçu pour éditer chacun.",
+ "X": "X",
+ "Y": "Y",
+ "You're on the latest version (v{v}).": "Vous avez la dernière version (v{v}).",
+ "Your name (shown on comments):": "Votre nom (affiché sur les commentaires) :",
+ "Your name (shown on new comments):": "Votre nom (affiché sur les nouveaux commentaires) :",
+ "Zoom": "Zoom",
+ "Zoom %": "Zoom %",
+ "Zoom in (⌘+)": "Zoomer (⌘+)",
+ "Zoom out (⌘−)": "Dézoomer (⌘−)",
+ "Zoom secs": "Secondes de zoom",
+ "always visible": "toujours visible",
+ "body": "corps",
+ "bottom": "bas",
+ "center": "centre",
+ "contain": "contenir",
+ "cover": "couvrir",
+ "custom": "personnalisé",
+ "dash-march": "pointillés défilants",
+ "dashed": "tirets",
+ "dotted": "pointillés",
+ "drift": "dérive",
+ "fade": "fondu",
+ "fade-up": "fondu montant",
+ "fill": "étirer",
+ "focus-group": "groupe de focus",
+ "gradient": "dégradé",
+ "just now": "à l'instant",
+ "kenburns": "Ken Burns",
+ "kicker": "surtitre",
+ "left": "gauche",
+ "middle": "milieu",
+ "morph": "morph",
+ "motion-path": "trajectoire",
+ "no — normal slide": "non — diapositive normale",
+ "none": "aucun",
+ "off": "non",
+ "on": "oui",
+ "reveal": "révéler",
+ "right": "droite",
+ "slide": "glisser",
+ "solid": "continue",
+ "subtitle": "sous-titre",
+ "title": "titre",
+ "top": "haut",
+ "unnamed": "sans nom",
+ "you: {name} ✎": "vous : {name} ✎",
+ "zoom": "zoom",
+ "zoom-in": "zoom avant",
+ "zoom-out": "zoom arrière",
+ "{n}d ago": "il y a {n} j",
+ "{n}h ago": "il y a {n} h",
+ "{n}m ago": "il y a {n} min",
+ "— no notes for this slide —": "— pas de notes pour cette diapositive —",
+ "⛓ Group": "⛓ Grouper",
+ "⛓ Ungroup": "⛓ Dégrouper",
+ "✎ Edit path on canvas": "✎ Modifier le tracé sur la toile",
+ "⧉ Apply layout…": "⧉ Appliquer une disposition…",
+ "+ Add stop": "+ Ajouter une étape",
+ "+ Embed font file…": "+ Incorporer une police…",
+ "+ New state linked from this element": "+ Nouvel état lié depuis cet élément",
+ "+ Save slide as layout…": "+ Enregistrer comme disposition…",
+ "💬 whole slide": "💬 toute la diapositive",
+}
diff --git a/slides/src/i18n/ja.ts b/slides/src/i18n/ja.ts
new file mode 100644
index 00000000..4a45831e
--- /dev/null
+++ b/slides/src/i18n/ja.ts
@@ -0,0 +1,235 @@
+// Japanese — machine-drafted, native review welcome
+import type { Catalog } from '../i18n'
+
+export const ja: Catalog = {
+ "<b>Morph</b> animates elements that appear on both this slide and the previous one (copy a slide, then move things around).": "<b>モーフ</b>は、このスライドと前のスライドの両方にある要素をアニメーションします(スライドを複製してから配置を変えてみてください)。",
+ "A <b>state</b> is hidden from arrow-key flow — viewers reach it by clicking a linked element. Shared element ids morph between states.": "<b>ステート</b>は矢印キーの流れに現れません — リンクされた要素のクリックで到達します。共有 id の要素はステート間でモーフします。",
+ "A deck needs at least one slide": "デッキには最低1枚のスライドが必要です",
+ "About Bento Slides — version, updates, licenses": "Bento Slides について — バージョン・更新・ライセンス",
+ "Align": "整列",
+ "Ambient": "アンビエント",
+ "Angle": "角度",
+ "Arrange": "配置",
+ "Arrow": "矢印",
+ "Background": "背景",
+ "Black": "ブラック",
+ "Blur": "ぼかし",
+ "Bold": "ボールド",
+ "Built-in": "組み込み",
+ "Bundle a .woff2/.woff/.ttf/.otf into this file and use it here": ".woff2/.woff/.ttf/.otf をこのファイルに埋め込んで使用",
+ "Change the name used for your new comments and replies": "新しいコメントと返信に使う名前を変更",
+ "Chart": "グラフ",
+ "Check for updates": "更新を確認",
+ "Check for updates automatically at launch": "起動時に自動で更新を確認",
+ "Checked automatically at launch — you're on the latest version (v{v}).": "起動時に自動確認済み — 最新バージョンです (v{v})。",
+ "Checking…": "確認中…",
+ "Checks contact the release server and send nothing about you or this document — no ids, no telemetry.": "確認はリリースサーバーへの接続のみで、あなたやこのドキュメントの情報は一切送信しません — ID もテレメトリーもなし。",
+ "Click to reset": "クリックでリセット",
+ "Color": "色",
+ "Comment (C) — click an element or a spot on the slide": "コメント (C) — 要素またはスライド上の位置をクリック",
+ "Comment · element": "コメント · 要素",
+ "Comment · point ({x}, {y})": "コメント · 位置 ({x}, {y})",
+ "Comment · slide": "コメント · スライド",
+ "Comment:": "コメント:",
+ "Corner radius": "角丸",
+ "Couldn't check: {m}": "確認できませんでした: {m}",
+ "Count up": "カウントアップ",
+ "Custom ({n})": "カスタム ({n})",
+ "Data": "データ",
+ "Default set": "既定セット",
+ "Delete": "削除",
+ "Delete slide": "スライドを削除",
+ "Delete this layout": "このレイアウトを削除",
+ "Delete this slide? {parts}.": "このスライドを削除しますか? {parts}。",
+ "Dissolve the group (⇧⌘G)": "グループを解除 (⇧⌘G)",
+ "Download updated copy": "更新版をダウンロード",
+ "Downloaded ✓": "ダウンロード完了 ✓",
+ "Downloads a backup of the current version, then rewrites this file on disk as the new version — document untouched.": "現在のバージョンのバックアップをダウンロードしてから、このファイルを新バージョンに書き換えます — ドキュメントはそのまま。",
+ "Downloads the new version with this document inside. The file you have now is not touched.": "このドキュメントを含む新バージョンをダウンロードします。現在のファイルは変更されません。",
+ "Drag anchor points on the slide; double-click adds and removes points": "スライド上のアンカーをドラッグ。ダブルクリックで追加・削除",
+ "Drag to resize · double-click to reset": "ドラッグでサイズ変更 · ダブルクリックでリセット",
+ "Duplicate": "複製",
+ "Duplicate slide": "スライドを複製",
+ "Duplicates this slide as a hidden interactive state and links the selected element to it": "このスライドを隠しステートとして複製し、選択要素からリンクします",
+ "Elements select and move as one; Alt-click reaches a member (⌘G)": "要素を一体として選択・移動。Alt クリックで個別選択 (⌘G)",
+ "Ellipse": "楕円",
+ "End of deck": "デッキの最後",
+ "End tip": "終端",
+ "Enter": "出現",
+ "Export PDF (print)": "PDF 書き出し(印刷)",
+ "Extra bold": "エクストラボールド",
+ "Extra light": "エクストラライト",
+ "Fill": "塗り",
+ "Fill & stroke": "塗りと線",
+ "Fill style": "塗りスタイル",
+ "Fit": "フィット",
+ "Font": "フォント",
+ "Grad. angle": "グラデ角度",
+ "Group": "グループ",
+ "H": "H",
+ "Hover": "ホバー",
+ "Hover dim": "ホバー減光",
+ "Hover set:": "ホバーセット:",
+ "Image": "画像",
+ "Includes reveal.js, Moveable, Selecto (MIT) · Apache ECharts (Apache-2.0) · zrender (BSD-3) · Fraunces typeface (OFL-1.1) — full notices travel in this file’s source.": "reveal.js・Moveable・Selecto (MIT) · Apache ECharts (Apache-2.0) · zrender (BSD-3) · Fraunces 書体 (OFL-1.1) を含みます — 完全な表記はこのファイルのソース内にあります。",
+ "Insert slide here": "ここにスライドを挿入",
+ "Interactivity": "インタラクティブ",
+ "Language": "言語",
+ "Launch check couldn't reach the release server ({m}). Check manually below.": "起動時の確認でリリースサーバーに接続できませんでした ({m})。下から手動で確認してください。",
+ "Layout": "レイアウト",
+ "Light": "ライト",
+ "Line": "直線",
+ "Line height": "行間",
+ "Line style": "線種",
+ "Link to": "リンク先",
+ "Loop": "ループ",
+ "Loop secs": "ループ秒",
+ "Medium": "ミディアム",
+ "Morph id:": "モーフ id:",
+ "Name": "名前",
+ "New slide": "新規スライド",
+ "New slide from a layout": "レイアウトから新規スライド",
+ "Next": "次",
+ "Notes": "ノート",
+ "Notes for presenter view (press S while presenting)…": "発表者ビュー用ノート(発表中に S キー)…",
+ "Opacity": "不透明度",
+ "Opacity %": "不透明度 %",
+ "Open comment(s)": "コメントを開く",
+ "Path": "パス",
+ "Position %": "位置 %",
+ "Position & size": "位置とサイズ",
+ "Present": "プレゼン",
+ "Present from current slide": "現在のスライドから開始",
+ "Presenting": "プレゼン設定",
+ "Preset": "プリセット",
+ "Press <b>S</b> while presenting to open the speaker view — these notes beside the current and next slide, with a timer.": "発表中に <b>S</b> を押すと発表者ビューが開きます — 現在と次のスライドの横にこのノートとタイマーを表示。",
+ "Preview set": "プレビューセット",
+ "Pull elements added to the parent into this state and adopt its ordering — your changes to shared elements are kept": "親に追加された要素をこのステートに取り込み、順序を揃えます — 共有要素へのあなたの変更は保持されます",
+ "Re-arrange this slide onto a layout — content moves by matching id, then role; extra elements are kept": "このスライドをレイアウトに再配置します — コンテンツは id、次に役割で対応付け。追加した要素は残ります",
+ "Rectangle": "長方形",
+ "Redo (⇧⌘Z)": "やり直す (⇧⌘Z)",
+ "Regular": "レギュラー",
+ "Reload into new version": "再読込して新バージョンへ",
+ "Remove stop": "ストップを削除",
+ "Reopen": "再オープン",
+ "Reply": "返信",
+ "Reply…": "返信…",
+ "Reset zoom to fit (⌘0)": "ズームをフィットに戻す (⌘0)",
+ "Resolve": "解決",
+ "Role": "役割",
+ "SVG path the element travels along, relative to its position": "要素が辿る SVG パス(要素位置からの相対)",
+ "Save": "保存",
+ "Save a copy — pick a new file, leave this one untouched": "コピーを保存 — 新しいファイルを選び、現在のファイルは保持",
+ "Save failed — see console": "保存に失敗 — コンソールを確認",
+ "Save — rewrite this file in place (⌘S)": "保存 — このファイルを直接書き換え (⌘S)",
+ "Saved": "保存しました",
+ "Semibold": "セミボールド",
+ "Shadow": "シャドウ",
+ "Shape": "図形",
+ "Show on hover": "ホバー時に表示",
+ "Size (pt)": "サイズ (pt)",
+ "Slide": "スライド",
+ "Speaker notes": "スピーカーノート",
+ "Speaker view": "発表者ビュー",
+ "Start tip": "始端",
+ "State of": "ステート元",
+ "Stroke": "線",
+ "Stroke width": "線幅",
+ "Sync from parent slide": "親スライドから同期",
+ "Text": "テキスト",
+ "The full <b>ECharts option</b> as JSON (pure data — use template-string formatters like <code>{b}: {c}</code>, never functions). Tooltips and zoom run while presenting.": "<b>ECharts オプション</b>全体を JSON で(純データ — <code>{b}: {c}</code> のようなテンプレート文字列を使用、関数は不可)。ツールチップとズームはプレゼン中に動作。",
+ "Thin": "シン",
+ "This browser can’t rewrite files in place — a fresh copy went to Downloads": "このブラウザはファイルの直接書き換えに未対応 — 新しいコピーをダウンロードしました",
+ "This document": "このドキュメント",
+ "This file carries its own app — it works offline, forever, as is.": "このファイルはアプリを内蔵しています — オフラインでも、ずっと、このまま動きます。",
+ "This window is still running v{v} — reload to finish. A v{v} backup was downloaded.": "このウィンドウはまだ v{v} で動作中 — 再読込で完了します。v{v} のバックアップをダウンロード済み。",
+ "This window is still running v{v}. If you overwrote the file that's open here, reload; otherwise open the file you saved.": "このウィンドウはまだ v{v} で動作中。開いているファイルを上書きした場合は再読込を。別に保存した場合はそのファイルを開いてください。",
+ "This window keeps running v{v} until you open the downloaded file.": "ダウンロードしたファイルを開くまで、このウィンドウは v{v} のままです。",
+ "Toggle properties (])": "プロパティを表示/隠す (])",
+ "Toggle slide list ([)": "スライド一覧を表示/隠す ([)",
+ "Transition": "トランジション",
+ "Triangle": "三角形",
+ "Typography": "タイポグラフィ",
+ "Undo (⌘Z)": "元に戻す (⌘Z)",
+ "Unsaved changes": "未保存の変更",
+ "Untitled": "無題",
+ "Up to date (v{v}) — checked at launch": "最新です (v{v}) — 起動時に確認済み",
+ "Up to date — v{v}": "最新です — v{v}",
+ "Update available: v{v} — click the peach button to update": "更新があります: v{v} — ピーチ色のボタンをクリックで更新",
+ "Update check failed: {m} — click to retry": "更新確認に失敗: {m} — クリックで再試行",
+ "Update failed: {m}": "更新に失敗: {m}",
+ "Update this file": "このファイルを更新",
+ "Update this file…": "このファイルを更新…",
+ "Updated to v{v} on disk.": "ディスク上で v{v} に更新しました。",
+ "V-align": "垂直揃え",
+ "Verifies and builds the new version with this document inside, then asks where to save it — pick the file you have open to update it.": "このドキュメントを含む新バージョンを検証・生成し、保存先を尋ねます — 開いているファイルを選べば更新されます。",
+ "Verifying…": "検証中…",
+ "Version {v} is available — click to update": "バージョン {v} があります — クリックで更新",
+ "Version {v} is available.": "バージョン {v} が利用可能です。",
+ "W": "W",
+ "Weight": "ウェイト",
+ "While editing: <b>⌘B</b>/<b>⌘I</b>/<b>⌘U</b> · markdown auto-converts — **bold*&#8203;* *italic*&#8203; `code` ~~strike~~ and \"- \" bullets; pasting markdown converts too. Escape with \\ or press ⌘Z right after to keep the literal characters.": "編集中: <b>⌘B</b>/<b>⌘I</b>/<b>⌘U</b> · マークダウンは入力時に自動変換 — **太字*&#8203;* *斜体*&#8203; `コード` ~~取り消し~~ と「- 」の箇条書き。貼り付けも変換されます。\\ でエスケープ、変換直後の ⌘Z で文字をそのまま残せます。",
+ "While presenting, hovering an element whose <b>group</b> matches a set name shows that set. Use Preview to edit each set.": "プレゼン中、<b>group</b> がセット名と一致する要素にホバーするとそのセットが表示されます。各セットの編集にはプレビューを使用。",
+ "X": "X",
+ "Y": "Y",
+ "You're on the latest version (v{v}).": "最新バージョンです (v{v})。",
+ "Your name (shown on comments):": "あなたの名前(コメントに表示):",
+ "Your name (shown on new comments):": "あなたの名前(新しいコメントに表示):",
+ "Zoom": "ズーム",
+ "Zoom %": "ズーム %",
+ "Zoom in (⌘+)": "ズームイン (⌘+)",
+ "Zoom out (⌘−)": "ズームアウト (⌘−)",
+ "Zoom secs": "ズーム秒",
+ "always visible": "常に表示",
+ "body": "本文",
+ "bottom": "下",
+ "center": "中央",
+ "contain": "収める",
+ "cover": "覆う",
+ "custom": "カスタム",
+ "dash-march": "破線マーチ",
+ "dashed": "破線",
+ "dotted": "点線",
+ "drift": "ドリフト",
+ "fade": "フェード",
+ "fade-up": "フェードアップ",
+ "fill": "引き伸ばし",
+ "focus-group": "フォーカスグループ",
+ "gradient": "グラデーション",
+ "just now": "たった今",
+ "kenburns": "ケンバーンズ",
+ "kicker": "キッカー",
+ "left": "左",
+ "middle": "中央",
+ "morph": "モーフ",
+ "motion-path": "モーションパス",
+ "no — normal slide": "いいえ — 通常のスライド",
+ "none": "なし",
+ "off": "オフ",
+ "on": "オン",
+ "reveal": "リビール",
+ "right": "右",
+ "slide": "スライド",
+ "solid": "実線",
+ "subtitle": "サブタイトル",
+ "title": "タイトル",
+ "top": "上",
+ "unnamed": "名称未設定",
+ "you: {name} ✎": "あなた: {name} ✎",
+ "zoom": "ズーム",
+ "zoom-in": "ズームイン",
+ "zoom-out": "ズームアウト",
+ "{n}d ago": "{n}日前",
+ "{n}h ago": "{n}時間前",
+ "{n}m ago": "{n}分前",
+ "— no notes for this slide —": "— このスライドにノートはありません —",
+ "⛓ Group": "⛓ グループ化",
+ "⛓ Ungroup": "⛓ グループ解除",
+ "✎ Edit path on canvas": "✎ キャンバスでパスを編集",
+ "⧉ Apply layout…": "⧉ レイアウトを適用…",
+ "+ Add stop": "+ ストップを追加",
+ "+ Embed font file…": "+ フォントを埋め込む…",
+ "+ New state linked from this element": "+ この要素からリンクする新ステート",
+ "+ Save slide as layout…": "+ スライドをレイアウトとして保存…",
+ "💬 whole slide": "💬 スライド全体",
+}
diff --git a/slides/src/i18n/zh-Hans.ts b/slides/src/i18n/zh-Hans.ts
new file mode 100644
index 00000000..c0c444a0
--- /dev/null
+++ b/slides/src/i18n/zh-Hans.ts
@@ -0,0 +1,235 @@
+// Simplified Chinese — machine-drafted, native review welcome
+import type { Catalog } from '../i18n'
+
+export const zhHans: Catalog = {
+ "<b>Morph</b> animates elements that appear on both this slide and the previous one (copy a slide, then move things around).": "<b>变形</b>会为同时出现在此幻灯片和上一张中的元素做动画(复制一张幻灯片,然后移动内容试试)。",
+ "A <b>state</b> is hidden from arrow-key flow — viewers reach it by clicking a linked element. Shared element ids morph between states.": "<b>状态</b>不出现在方向键流程中 — 观众通过点击链接元素到达。共享 id 的元素会在状态间变形。",
+ "A deck needs at least one slide": "演示文稿至少需要一张幻灯片",
+ "About Bento Slides — version, updates, licenses": "关于 Bento Slides — 版本、更新、许可证",
+ "Align": "对齐",
+ "Ambient": "氛围",
+ "Angle": "角度",
+ "Arrange": "排列",
+ "Arrow": "箭头",
+ "Background": "背景",
+ "Black": "特黑",
+ "Blur": "模糊",
+ "Bold": "粗体",
+ "Built-in": "内置",
+ "Bundle a .woff2/.woff/.ttf/.otf into this file and use it here": "将 .woff2/.woff/.ttf/.otf 嵌入此文件并在此使用",
+ "Change the name used for your new comments and replies": "更改新评论和回复所用的名字",
+ "Chart": "图表",
+ "Check for updates": "检查更新",
+ "Check for updates automatically at launch": "启动时自动检查更新",
+ "Checked automatically at launch — you're on the latest version (v{v}).": "已在启动时自动检查 — 您已是最新版本 (v{v})。",
+ "Checking…": "检查中…",
+ "Checks contact the release server and send nothing about you or this document — no ids, no telemetry.": "检查仅连接发布服务器,不发送任何关于您或此文档的信息 — 无 ID,无遥测。",
+ "Click to reset": "点击重置",
+ "Color": "颜色",
+ "Comment (C) — click an element or a spot on the slide": "评论 (C) — 点击元素或幻灯片上的位置",
+ "Comment · element": "评论 · 元素",
+ "Comment · point ({x}, {y})": "评论 · 位置 ({x}, {y})",
+ "Comment · slide": "评论 · 幻灯片",
+ "Comment:": "评论:",
+ "Corner radius": "圆角",
+ "Couldn't check: {m}": "无法检查:{m}",
+ "Count up": "数字递增",
+ "Custom ({n})": "自定义 ({n})",
+ "Data": "数据",
+ "Default set": "默认组",
+ "Delete": "删除",
+ "Delete slide": "删除幻灯片",
+ "Delete this layout": "删除此版式",
+ "Delete this slide? {parts}.": "删除此幻灯片?{parts}。",
+ "Dissolve the group (⇧⌘G)": "取消编组 (⇧⌘G)",
+ "Download updated copy": "下载更新副本",
+ "Downloaded ✓": "已下载 ✓",
+ "Downloads a backup of the current version, then rewrites this file on disk as the new version — document untouched.": "先下载当前版本的备份,然后将此文件改写为新版本 — 文档内容不变。",
+ "Downloads the new version with this document inside. The file you have now is not touched.": "下载包含此文档的新版本。当前文件不会被改动。",
+ "Drag anchor points on the slide; double-click adds and removes points": "在幻灯片上拖动锚点;双击可添加或删除",
+ "Drag to resize · double-click to reset": "拖动调整大小 · 双击重置",
+ "Duplicate": "复制",
+ "Duplicate slide": "复制幻灯片",
+ "Duplicates this slide as a hidden interactive state and links the selected element to it": "将此幻灯片复制为隐藏的交互状态,并从所选元素链接过去",
+ "Elements select and move as one; Alt-click reaches a member (⌘G)": "元素作为整体选择和移动;Alt 点击可选中单个成员 (⌘G)",
+ "Ellipse": "椭圆",
+ "End of deck": "演示结束",
+ "End tip": "终点样式",
+ "Enter": "入场",
+ "Export PDF (print)": "导出 PDF(打印)",
+ "Extra bold": "特粗",
+ "Extra light": "特细",
+ "Fill": "填充",
+ "Fill & stroke": "填充与描边",
+ "Fill style": "填充样式",
+ "Fit": "适应",
+ "Font": "字体",
+ "Grad. angle": "渐变角度",
+ "Group": "编组",
+ "H": "高",
+ "Hover": "悬停",
+ "Hover dim": "悬停变暗",
+ "Hover set:": "悬停组:",
+ "Image": "图片",
+ "Includes reveal.js, Moveable, Selecto (MIT) · Apache ECharts (Apache-2.0) · zrender (BSD-3) · Fraunces typeface (OFL-1.1) — full notices travel in this file’s source.": "包含 reveal.js、Moveable、Selecto (MIT) · Apache ECharts (Apache-2.0) · zrender (BSD-3) · Fraunces 字体 (OFL-1.1) — 完整声明位于此文件源码中。",
+ "Insert slide here": "在此插入幻灯片",
+ "Interactivity": "交互",
+ "Language": "语言",
+ "Launch check couldn't reach the release server ({m}). Check manually below.": "启动检查无法连接发布服务器 ({m})。请在下方手动检查。",
+ "Layout": "版式",
+ "Light": "细体",
+ "Line": "直线",
+ "Line height": "行高",
+ "Line style": "线型",
+ "Link to": "链接到",
+ "Loop": "循环",
+ "Loop secs": "循环秒数",
+ "Medium": "中等",
+ "Morph id:": "变形 id:",
+ "Name": "名称",
+ "New slide": "新建幻灯片",
+ "New slide from a layout": "从版式新建幻灯片",
+ "Next": "下一张",
+ "Notes": "备注",
+ "Notes for presenter view (press S while presenting)…": "演讲者视图备注(演示时按 S)…",
+ "Opacity": "不透明度",
+ "Opacity %": "不透明度 %",
+ "Open comment(s)": "打开评论",
+ "Path": "路径",
+ "Position %": "位置 %",
+ "Position & size": "位置与大小",
+ "Present": "演示",
+ "Present from current slide": "从当前幻灯片开始演示",
+ "Presenting": "演示设置",
+ "Preset": "预设",
+ "Press <b>S</b> while presenting to open the speaker view — these notes beside the current and next slide, with a timer.": "演示时按 <b>S</b> 打开演讲者视图 — 在当前和下一张幻灯片旁显示这些备注和计时器。",
+ "Preview set": "预览组",
+ "Pull elements added to the parent into this state and adopt its ordering — your changes to shared elements are kept": "将父级新增的元素并入此状态并采用其顺序 — 您对共享元素的更改会保留",
+ "Re-arrange this slide onto a layout — content moves by matching id, then role; extra elements are kept": "按版式重排此幻灯片 — 内容先按 id、再按角色匹配;额外元素保留",
+ "Rectangle": "矩形",
+ "Redo (⇧⌘Z)": "重做 (⇧⌘Z)",
+ "Regular": "常规",
+ "Reload into new version": "重新加载进入新版本",
+ "Remove stop": "删除色标",
+ "Reopen": "重新打开",
+ "Reply": "回复",
+ "Reply…": "回复…",
+ "Reset zoom to fit (⌘0)": "重置缩放以适应 (⌘0)",
+ "Resolve": "解决",
+ "Role": "角色",
+ "SVG path the element travels along, relative to its position": "元素沿其移动的 SVG 路径(相对其位置)",
+ "Save": "保存",
+ "Save a copy — pick a new file, leave this one untouched": "保存副本 — 选择新文件,当前文件保持不变",
+ "Save failed — see console": "保存失败 — 请查看控制台",
+ "Save — rewrite this file in place (⌘S)": "保存 — 就地改写此文件 (⌘S)",
+ "Saved": "已保存",
+ "Semibold": "半粗",
+ "Shadow": "阴影",
+ "Shape": "形状",
+ "Show on hover": "悬停时显示",
+ "Size (pt)": "字号 (pt)",
+ "Slide": "幻灯片",
+ "Speaker notes": "演讲者备注",
+ "Speaker view": "演讲者视图",
+ "Start tip": "起点样式",
+ "State of": "所属状态",
+ "Stroke": "描边",
+ "Stroke width": "描边宽度",
+ "Sync from parent slide": "从父幻灯片同步",
+ "Text": "文本",
+ "The full <b>ECharts option</b> as JSON (pure data — use template-string formatters like <code>{b}: {c}</code>, never functions). Tooltips and zoom run while presenting.": "完整的 <b>ECharts 配置</b>(纯数据 JSON — 使用 <code>{b}: {c}</code> 这样的模板字符串,不能用函数)。提示框和缩放在演示时生效。",
+ "Thin": "极细",
+ "This browser can’t rewrite files in place — a fresh copy went to Downloads": "此浏览器无法就地改写文件 — 新副本已存入下载",
+ "This document": "此文档",
+ "This file carries its own app — it works offline, forever, as is.": "此文件自带应用 — 离线可用,永久如此。",
+ "This window is still running v{v} — reload to finish. A v{v} backup was downloaded.": "此窗口仍在运行 v{v} — 重新加载以完成。已下载 v{v} 备份。",
+ "This window is still running v{v}. If you overwrote the file that's open here, reload; otherwise open the file you saved.": "此窗口仍在运行 v{v}。若覆盖了当前打开的文件请重新加载;否则请打开您保存的文件。",
+ "This window keeps running v{v} until you open the downloaded file.": "在打开下载的文件之前,此窗口将继续运行 v{v}。",
+ "Toggle properties (])": "显示/隐藏属性面板 (])",
+ "Toggle slide list ([)": "显示/隐藏幻灯片列表 ([)",
+ "Transition": "切换效果",
+ "Triangle": "三角形",
+ "Typography": "排版",
+ "Undo (⌘Z)": "撤销 (⌘Z)",
+ "Unsaved changes": "未保存的更改",
+ "Untitled": "未命名",
+ "Up to date (v{v}) — checked at launch": "已是最新 (v{v}) — 启动时已检查",
+ "Up to date — v{v}": "已是最新 — v{v}",
+ "Update available: v{v} — click the peach button to update": "有可用更新:v{v} — 点击桃色按钮更新",
+ "Update check failed: {m} — click to retry": "更新检查失败:{m} — 点击重试",
+ "Update failed: {m}": "更新失败:{m}",
+ "Update this file": "更新此文件",
+ "Update this file…": "更新此文件…",
+ "Updated to v{v} on disk.": "已在磁盘上更新到 v{v}。",
+ "V-align": "垂直对齐",
+ "Verifies and builds the new version with this document inside, then asks where to save it — pick the file you have open to update it.": "验证并生成包含此文档的新版本,然后询问保存位置 — 选择当前打开的文件即可更新。",
+ "Verifying…": "验证中…",
+ "Version {v} is available — click to update": "版本 {v} 可用 — 点击更新",
+ "Version {v} is available.": "版本 {v} 可用。",
+ "W": "宽",
+ "Weight": "字重",
+ "While editing: <b>⌘B</b>/<b>⌘I</b>/<b>⌘U</b> · markdown auto-converts — **bold*&#8203;* *italic*&#8203; `code` ~~strike~~ and \"- \" bullets; pasting markdown converts too. Escape with \\ or press ⌘Z right after to keep the literal characters.": "编辑时:<b>⌘B</b>/<b>⌘I</b>/<b>⌘U</b> · Markdown 输入时自动转换 — **粗体*&#8203;* *斜体*&#8203; `代码` ~~删除线~~ 和「- 」列表;粘贴同样转换。用 \\ 转义,或在转换后立即按 ⌘Z 保留原字符。",
+ "While presenting, hovering an element whose <b>group</b> matches a set name shows that set. Use Preview to edit each set.": "演示时,悬停 <b>group</b> 与某组名匹配的元素会显示该组。用预览编辑各组。",
+ "X": "X",
+ "Y": "Y",
+ "You're on the latest version (v{v}).": "您已是最新版本 (v{v})。",
+ "Your name (shown on comments):": "您的名字(显示在评论中):",
+ "Your name (shown on new comments):": "您的名字(显示在新评论中):",
+ "Zoom": "缩放",
+ "Zoom %": "缩放 %",
+ "Zoom in (⌘+)": "放大 (⌘+)",
+ "Zoom out (⌘−)": "缩小 (⌘−)",
+ "Zoom secs": "缩放秒数",
+ "always visible": "始终可见",
+ "body": "正文",
+ "bottom": "下",
+ "center": "居中",
+ "contain": "包含",
+ "cover": "覆盖",
+ "custom": "自定义",
+ "dash-march": "虚线行进",
+ "dashed": "虚线",
+ "dotted": "点线",
+ "drift": "漂移",
+ "fade": "淡入淡出",
+ "fade-up": "上浮淡入",
+ "fill": "拉伸",
+ "focus-group": "焦点组",
+ "gradient": "渐变",
+ "just now": "刚刚",
+ "kenburns": "肯·伯恩斯",
+ "kicker": "眉题",
+ "left": "左",
+ "middle": "居中",
+ "morph": "变形",
+ "motion-path": "运动路径",
+ "no — normal slide": "否 — 普通幻灯片",
+ "none": "无",
+ "off": "关",
+ "on": "开",
+ "reveal": "悬停显示",
+ "right": "右",
+ "slide": "幻灯片",
+ "solid": "实线",
+ "subtitle": "副标题",
+ "title": "标题",
+ "top": "上",
+ "unnamed": "未命名",
+ "you: {name} ✎": "你:{name} ✎",
+ "zoom": "缩放",
+ "zoom-in": "放大",
+ "zoom-out": "缩小",
+ "{n}d ago": "{n} 天前",
+ "{n}h ago": "{n} 小时前",
+ "{n}m ago": "{n} 分钟前",
+ "— no notes for this slide —": "— 此幻灯片没有备注 —",
+ "⛓ Group": "⛓ 编组",
+ "⛓ Ungroup": "⛓ 取消编组",
+ "✎ Edit path on canvas": "✎ 在画布上编辑路径",
+ "⧉ Apply layout…": "⧉ 应用版式…",
+ "+ Add stop": "+ 添加色标",
+ "+ Embed font file…": "+ 嵌入字体文件…",
+ "+ New state linked from this element": "+ 从此元素链接的新状态",
+ "+ Save slide as layout…": "+ 将幻灯片存为版式…",
+ "💬 whole slide": "💬 整张幻灯片",
+}
diff --git a/slides/src/main.ts b/slides/src/main.ts
index 3c70a766..4a14fa95 100644
--- a/slides/src/main.ts
+++ b/slides/src/main.ts
@@ -5,6 +5,7 @@ import './styles.css'
import { anim } from './anim'
import { capturePristine, readEmbeddedDoc, serializeFile } from './save'
import { APP_VERSION, checkForUpdates, buildUpdatedFile, applyUpdate } from './update'
+import { i18nApi } from './i18n'
import { parseDoc } from './model'
import { starterDoc } from './starterdeck'
import { injectFonts } from './fonts'
@@ -60,6 +61,8 @@ if (location.hash === '#present') {
},
/** animation engine, exposed for scripting/diagnostics */
anim,
+ /** i18n: t/locale/setLocale/choices — setLocale('x-pseudo') audits the sweep */
+ i18n: i18nApi,
/**
* Self-update surface (all user/tooling-initiated, never automatic):
* check() fetches + signature-verifies the release manifest; build()
diff --git a/slides/src/present.ts b/slides/src/present.ts
index e611f3f4..1ec2bd31 100644
--- a/slides/src/present.ts
+++ b/slides/src/present.ts
@@ -8,6 +8,7 @@ import { anim, resetXform } from './anim'
import { chartSnapshotSvg, mountChart } from './charts'
import type { BentoDoc, GradientFill, ShapeElement, Slide, SlideElement } from './model'
import { applyElementFrame, gradientLineCoords, renderSlide } from './render'
+import { t } from './i18n'
const MORPH_DURATION = 0.65
const MORPH_EASE = 'power2.inOut'
@@ -135,7 +136,7 @@ export function startPresentation(
frame.appendChild(inner)
} else {
frame.classList.add('end')
- frame.textContent = 'End of deck'
+ frame.textContent = t('End of deck')
}
return frame
}
@@ -152,7 +153,7 @@ export function startPresentation(
nxtBox.innerHTML = ''
nxtBox.appendChild(d.importNode(svSlide(nxt, 300), true))
const notes = d.querySelector('.sv-notes')
- if (notes) notes.textContent = doc.slides[cur]?.notes || '— no notes for this slide —'
+ if (notes) notes.textContent = doc.slides[cur]?.notes || t('— no notes for this slide —')
const count = d.querySelector('.sv-count')
if (count) count.textContent = `${visibleIndex(cur)} / ${visibleTotal}`
}
@@ -165,15 +166,15 @@ export function startPresentation(
if (!speaker) return // popup blocked
;(window as unknown as Record<string, unknown>).__bentoSpeaker = speaker // diagnostics
const d = speaker.document
- d.title = `${doc.title} — Speaker view`
+ d.title = `${doc.title} — ${t('Speaker view')}`
for (const st of document.querySelectorAll('style')) d.head.appendChild(d.importNode(st, true))
d.body.className = 'bento-speaker'
d.body.innerHTML =
- '<div class="sv-top"><div class="sv-timer" title="Click to reset">00:00</div>' +
+ `<div class="sv-top"><div class="sv-timer" title="${t('Click to reset')}">00:00</div>` +
'<div class="sv-clock"></div><div class="sv-count"></div></div>' +
'<div class="sv-main"><div class="sv-current"></div>' +
- '<div class="sv-side"><div><div class="sv-label">Next</div><div class="sv-nextbox"></div></div>' +
- '<div class="sv-notes-wrap"><div class="sv-label">Notes</div><div class="sv-notes"></div></div></div></div>'
+ `<div class="sv-side"><div><div class="sv-label">${t('Next')}</div><div class="sv-nextbox"></div></div>` +
+ `<div class="sv-notes-wrap"><div class="sv-label">${t('Notes')}</div><div class="sv-notes"></div></div></div></div>`
speakerStart = performance.now()
d.querySelector('.sv-timer')?.addEventListener('click', () => { speakerStart = performance.now() })
clearInterval(speakerTimer)