Bento, the office suite that fits in a file
TypeScript mit-licenseofficeoffice-365office-suiteoffice-toolsoffice365open-sourcepowerpointself-hostedsingle-page-appslidesslideshareslideshowslideshow-galleryslideshow-makerslideshows
Say when a language pack is out of date
nyblnetec8092760c17
diff --git a/slides/src/editor/editor.ts b/slides/src/editor/editor.tsindex 4ed66bed..9cc724d5 100644--- a/slides/src/editor/editor.ts+++ b/slides/src/editor/editor.ts@@ -24,7 +24,7 @@ import { openSpeakerWindow, speakerIdleBody } from '../screens'import { borderPoint, boxCenter, lineEndpoints, setLineEndpoints, sideMidpoint } from './lineedit'import { ICONS } from '../icons'import { t, setLocale, locale, localeChoices, LOCALE_CHOICES } from '../i18n'-import { availablePacks, fetchPack, markFileSaved, packsInFile, stageForFile, unstageFromFile } from '../packs'+import { availablePacks, fetchPack, markFileSaved, packCoverage, packsInFile, stageForFile, unstageFromFile } from '../packs'import { appConfig } from '../../../kernel/src/app.ts'import { disconnectOnline, joinFromDoc, mintCollab, mintInvite, onlineTransport, rotateKeys, sharingOn, startSharing, stopSharing } from '../sync/online'@@ -1057,6 +1057,20 @@ export class Editor {p.pending ? t('Added when you next save') : t('Saved in this file'),[rm],)+ // Say how much English this pack will actually show. A pack is frozen+ // at the version it was built for while the app keeps gaining strings,+ // so a translated deck slowly reverts — silently, per string. Naming+ // the number turns "why is some of this English?" into a fact, and the+ // sentence says it fixes itself so nobody goes hunting for a button.+ const cov = packCoverage(p)+ if (cov.missing > 0) {+ const warn = div('ed-lang-warn')+ warn.textContent = t(+ 'Built for v{v} — {n} phrases still show in English. Updating Bento refreshes it.',+ { v: p.version ?? '?', n: String(cov.missing) },+ )+ listHost.appendChild(warn)+ }}const all = await availablePacks()diff --git a/slides/src/i18n/de.ts b/slides/src/i18n/de.tsindex 3b21716a..7e10c0a9 100644--- a/slides/src/i18n/de.ts+++ b/slides/src/i18n/de.ts@@ -691,4 +691,5 @@ export const de: Catalog = {"Take out of the file — applies when you next save": "Aus der Datei entfernen — gilt ab dem nächsten Speichern","Goes into the deck itself, so it travels with the file. Written when you next save.": "Kommt in die Präsentation selbst und reist mit der Datei mit. Wird beim nächsten Speichern geschrieben.","Put it in the deck — written when you next save.": "In die Präsentation legen — wird beim nächsten Speichern geschrieben.",+ "Built for v{v} — {n} phrases still show in English. Updating Bento refreshes it.": "Für v{v} erstellt — {n} Textstellen erscheinen weiterhin auf Englisch. Ein Bento-Update frischt sie auf.",}diff --git a/slides/src/i18n/es.ts b/slides/src/i18n/es.tsindex 866f0a20..aa482249 100644--- a/slides/src/i18n/es.ts+++ b/slides/src/i18n/es.ts@@ -691,4 +691,5 @@ export const es: Catalog = {"Take out of the file — applies when you next save": "Quitar del archivo: se aplica al guardar","Goes into the deck itself, so it travels with the file. Written when you next save.": "Va dentro de la presentación, así viaja con el archivo. Se escribe al guardar.","Put it in the deck — written when you next save.": "Ponerlo en la presentación: se escribe al guardar.",+ "Built for v{v} — {n} phrases still show in English. Updating Bento refreshes it.": "Creado para la v{v}: {n} frases siguen en inglés. Actualizar Bento lo soluciona.",}diff --git a/slides/src/i18n/fr.ts b/slides/src/i18n/fr.tsindex 2372d38a..10b0c859 100644--- a/slides/src/i18n/fr.ts+++ b/slides/src/i18n/fr.ts@@ -691,4 +691,5 @@ export const fr: Catalog = {"Take out of the file — applies when you next save": "Retirer du fichier — appliqué au prochain enregistrement","Goes into the deck itself, so it travels with the file. Written when you next save.": "Va dans la présentation elle-même, pour voyager avec le fichier. Écrite au prochain enregistrement.","Put it in the deck — written when you next save.": "La placer dans la présentation — écrite au prochain enregistrement.",+ "Built for v{v} — {n} phrases still show in English. Updating Bento refreshes it.": "Conçu pour la v{v} — {n} expressions restent en anglais. Mettre Bento à jour les actualise.",}diff --git a/slides/src/i18n/it.ts b/slides/src/i18n/it.tsindex c4e9354a..ea24d516 100644--- a/slides/src/i18n/it.ts+++ b/slides/src/i18n/it.ts@@ -691,4 +691,5 @@ export const it: Catalog = {"Take out of the file — applies when you next save": "Togli dal file — vale dal prossimo salvataggio","Goes into the deck itself, so it travels with the file. Written when you next save.": "Va nella presentazione stessa, così viaggia con il file. Scritta al prossimo salvataggio.","Put it in the deck — written when you next save.": "Mettila nella presentazione — scritta al prossimo salvataggio.",+ "Built for v{v} — {n} phrases still show in English. Updating Bento refreshes it.": "Creato per la v{v} — {n} frasi restano in inglese. Aggiornare Bento le rinfresca.",}diff --git a/slides/src/i18n/ja.ts b/slides/src/i18n/ja.tsindex 6780a96f..0dbc20c3 100644--- a/slides/src/i18n/ja.ts+++ b/slides/src/i18n/ja.ts@@ -691,4 +691,5 @@ export const ja: Catalog = {"Take out of the file — applies when you next save": "ファイルから削除 — 次回の保存時に反映","Goes into the deck itself, so it travels with the file. Written when you next save.": "デッキ自体に入り、ファイルと一緒に配布されます。次回の保存時に書き込まれます。","Put it in the deck — written when you next save.": "デッキに入れます — 次回の保存時に書き込まれます。",+ "Built for v{v} — {n} phrases still show in English. Updating Bento refreshes it.": "v{v} 用に作られています — {n} 個の語句はまだ英語で表示されます。Bento を更新すると解消します。",}diff --git a/slides/src/i18n/packed.ts b/slides/src/i18n/packed.tsindex b54f3436..5971e8db 100644--- a/slides/src/i18n/packed.ts+++ b/slides/src/i18n/packed.ts@@ -697,4 +697,5 @@ export const PACKED: Record<string, ReadonlyArray<string | 0>> = {"Take out of the file — applies when you next save": ["ファイルから削除 — 次回の保存時に反映","从文件中移除 — 下次保存时生效","從檔案中移除 — 下次儲存時生效","Quitar del archivo: se aplica al guardar","Retirer du fichier — appliqué au prochain enregistrement","Aus der Datei entfernen — gilt ab dem nächsten Speichern","Togli dal file — vale dal prossimo salvataggio","Tirar do arquivo — vale a partir do próximo salvamento"],"Goes into the deck itself, so it travels with the file. Written when you next save.": ["デッキ自体に入り、ファイルと一緒に配布されます。次回の保存時に書き込まれます。","放入演示文稿本身,随文件一起传递。下次保存时写入。","放入簡報本身,隨檔案一起傳遞。下次儲存時寫入。","Va dentro de la presentación, así viaja con el archivo. Se escribe al guardar.","Va dans la présentation elle-même, pour voyager avec le fichier. Écrite au prochain enregistrement.","Kommt in die Präsentation selbst und reist mit der Datei mit. Wird beim nächsten Speichern geschrieben.","Va nella presentazione stessa, così viaggia con il file. Scritta al prossimo salvataggio.","Vai para dentro da apresentação, então viaja com o arquivo. Gravado no próximo salvamento."],"Put it in the deck — written when you next save.": ["デッキに入れます — 次回の保存時に書き込まれます。","放入演示文稿 — 下次保存时写入。","放入簡報 — 下次儲存時寫入。","Ponerlo en la presentación: se escribe al guardar.","La placer dans la présentation — écrite au prochain enregistrement.","In die Präsentation legen — wird beim nächsten Speichern geschrieben.","Mettila nella presentazione — scritta al prossimo salvataggio.","Colocar na apresentação — gravado no próximo salvamento."],+ "Built for v{v} — {n} phrases still show in English. Updating Bento refreshes it.": ["v{v} 用に作られています — {n} 個の語句はまだ英語で表示されます。Bento を更新すると解消します。","为 v{v} 构建 — 仍有 {n} 条文本显示为英文。更新 Bento 即可刷新。","為 v{v} 建置 — 仍有 {n} 條文字顯示為英文。更新 Bento 即可重新整理。","Creado para la v{v}: {n} frases siguen en inglés. Actualizar Bento lo soluciona.","Conçu pour la v{v} — {n} expressions restent en anglais. Mettre Bento à jour les actualise.","Für v{v} erstellt — {n} Textstellen erscheinen weiterhin auf Englisch. Ein Bento-Update frischt sie auf.","Creato per la v{v} — {n} frasi restano in inglese. Aggiornare Bento le rinfresca.","Criado para a v{v} — {n} frases ainda aparecem em inglês. Atualizar o Bento resolve."],}diff --git a/slides/src/i18n/pt.ts b/slides/src/i18n/pt.tsindex 1e3cab67..d3112217 100644--- a/slides/src/i18n/pt.ts+++ b/slides/src/i18n/pt.ts@@ -689,4 +689,5 @@ export const pt: Catalog = {"Take out of the file — applies when you next save": "Tirar do arquivo — vale a partir do próximo salvamento","Goes into the deck itself, so it travels with the file. Written when you next save.": "Vai para dentro da apresentação, então viaja com o arquivo. Gravado no próximo salvamento.","Put it in the deck — written when you next save.": "Colocar na apresentação — gravado no próximo salvamento.",+ "Built for v{v} — {n} phrases still show in English. Updating Bento refreshes it.": "Criado para a v{v} — {n} frases ainda aparecem em inglês. Atualizar o Bento resolve.",}diff --git a/slides/src/i18n/zh-Hans.ts b/slides/src/i18n/zh-Hans.tsindex 6ce74aa2..72fbc769 100644--- a/slides/src/i18n/zh-Hans.ts+++ b/slides/src/i18n/zh-Hans.ts@@ -691,4 +691,5 @@ export const zhHans: Catalog = {"Take out of the file — applies when you next save": "从文件中移除 — 下次保存时生效","Goes into the deck itself, so it travels with the file. Written when you next save.": "放入演示文稿本身,随文件一起传递。下次保存时写入。","Put it in the deck — written when you next save.": "放入演示文稿 — 下次保存时写入。",+ "Built for v{v} — {n} phrases still show in English. Updating Bento refreshes it.": "为 v{v} 构建 — 仍有 {n} 条文本显示为英文。更新 Bento 即可刷新。",}diff --git a/slides/src/i18n/zh-Hant.ts b/slides/src/i18n/zh-Hant.tsindex 7fa57da8..a5858d14 100644--- a/slides/src/i18n/zh-Hant.ts+++ b/slides/src/i18n/zh-Hant.ts@@ -691,4 +691,5 @@ export const zhHant: Catalog = {"Take out of the file — applies when you next save": "從檔案中移除 — 下次儲存時生效","Goes into the deck itself, so it travels with the file. Written when you next save.": "放入簡報本身,隨檔案一起傳遞。下次儲存時寫入。","Put it in the deck — written when you next save.": "放入簡報 — 下次儲存時寫入。",+ "Built for v{v} — {n} phrases still show in English. Updating Bento refreshes it.": "為 v{v} 建置 — 仍有 {n} 條文字顯示為英文。更新 Bento 即可重新整理。",}diff --git a/slides/src/packs.ts b/slides/src/packs.tsindex ba6f9491..519ab6fc 100644--- a/slides/src/packs.ts+++ b/slides/src/packs.ts@@ -20,6 +20,7 @@import { addPack, removePack, type LanguagePack } from '../../kernel/src/i18n.ts'import { readShellBlocks, type ShellBlock } from '../../kernel/src/save.ts'+import { PACKED } from './i18n/packed'/*** Where the release channel publishes the pack index and the packs.@@ -71,6 +72,23 @@ export function readPacksFromShell(): number {return n}+/**+ * How much of the app's CURRENT interface a pack actually covers.+ *+ * Measured, not inferred from the version number. A pack built for an older+ * release may still cover everything — if that release added no strings, the+ * version differs and nothing is missing — while a same-version pack could be+ * incomplete. What the reader cares about is how much English they will see,+ * so count that directly. PACKED's keys are exactly the strings the running+ * app asks for.+ */+export function packCoverage(pack: LanguagePack): { missing: number; total: number } {+ const keys = Object.keys(PACKED)+ let missing = 0+ for (const k of keys) if (!pack.strings[k]) missing+++ return { missing, total: keys.length }+}+/** Packs in the file, flagged if they are still waiting for a save. */export function packsInFile(): Array<LanguagePack & { pending: boolean }> {return [...inFile.values()].map((p) => ({ ...p, pending: pending.has(p.lang) }))diff --git a/slides/src/styles.css b/slides/src/styles.cssindex 0dbd26c7..ee1a83b2 100644--- a/slides/src/styles.css+++ b/slides/src/styles.css@@ -1978,3 +1978,8 @@ input.ed-toggle { width: 16px; height: 16px; accent-color: #5E7699; cursor: poin}.ed-lang-acts { display: flex; gap: 6px; flex: 0 0 auto; }.ed-lang-acts .ed-btn { white-space: nowrap; }+.ed-lang-warn {+ font-size: 11.5px; line-height: 1.5; color: var(--muted);+ background: var(--bg); border-left: 2px solid var(--line);+ padding: 5px 8px; margin: 0 0 6px; border-radius: 0 5px 5px 0;+}