Send the remaining interface text through the catalog and audit it
Phase 4f. - scripts/i18nAudit.mjs runs in pnpm check. It fails for a key that the catalog does not have, a catalog key that the code does not use, and a row without all four languages. - message() marks a key that a variable carries to the translation call later: table formats, formula errors, and browser status messages. - 53 new rows with French, Japanese, and Simplified Chinese text for the status and error messages of the workbench, the tree, Settings, theme import, images, the built-in browser, and code blocks. The backlinks toggle now translates too. - 13 unused rows are gone. - Errors of the plugin API stay in English. docs/development.md has the rule in "Interface text". pnpm check, pnpm test (350 of 350), and the full smoke suite pass, except two tests that failed one time under load and passed on retry and 3 of 3 times alone.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { message, tr } from "../i18n/index.ts";
|
||||
import type { Snapshot } from './client';
|
||||
|
||||
type Transport = (command: string, args?: Record<string, unknown>) => Promise<unknown>;
|
||||
@@ -32,9 +33,9 @@ export class TabSession {
|
||||
}
|
||||
}
|
||||
private failure(operation: string, error: unknown, tabId = this.value.tabId, phase: 'ready' | 'disconnected' = 'disconnected') {
|
||||
this.update({ phase, message: phase === 'ready' ? 'The browser could not complete this request. Check the error details.' : connectionLost(error)
|
||||
? 'This tab lost its browser connection. Select Reconnect to restore the page.'
|
||||
: 'The browser could not complete this request. Check the details, then select Reconnect.',
|
||||
this.update({ phase, message: phase === 'ready' ? message('The browser could not complete this request. Check the error details.') : connectionLost(error)
|
||||
? message('This tab lost its browser connection. Select Reconnect to restore the page.')
|
||||
: message('The browser could not complete this request. Check the details, then select Reconnect.'),
|
||||
detail: { operation, reason: String(error), tabId, time: new Date().toISOString() } });
|
||||
}
|
||||
connect(): Promise<void> {
|
||||
@@ -44,7 +45,7 @@ export class TabSession {
|
||||
return this.pending;
|
||||
}
|
||||
private async restore() {
|
||||
this.update({ phase: 'connecting', message: this.value.tabId ? 'Reconnecting browser…' : 'Opening browser…' });
|
||||
this.update({ phase: 'connecting', message: this.value.tabId ? message('Reconnecting browser…') : message('Opening browser…') });
|
||||
let operation = 'state';
|
||||
// The host discards a failed transport before the next request.
|
||||
for (let attempt = 0; attempt < 2; attempt++) {
|
||||
@@ -66,7 +67,7 @@ export class TabSession {
|
||||
if (current.tabs.some(tab => tab.id === result.tabId)) {
|
||||
this.observe(current); this.update({ phase: 'ready', message: '' }); return;
|
||||
}
|
||||
if (attempt === 1) throw new Error('The runtime restarted twice while opening this tab.');
|
||||
if (attempt === 1) throw new Error(tr("The runtime restarted twice while opening this tab."));
|
||||
} catch (error) {
|
||||
if (this.closed) return;
|
||||
if (attempt === 0 && connectionLost(error)) continue;
|
||||
|
||||
Reference in New Issue
Block a user