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 { tr } from "../i18n/index.ts";
|
||||
import { mount, unmount } from 'svelte';
|
||||
import { get } from 'svelte/store';
|
||||
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow';
|
||||
@@ -60,13 +61,13 @@ export async function activate(api: PluginApi) {
|
||||
const web = ready && /^https?:\/\//.test(current?.url || '');
|
||||
return [
|
||||
{ separator: true },
|
||||
{ label: 'Move to new window', icon: 'external', disabled: !ready, run: () => run('moveToWindow', { pinned }) },
|
||||
{ label: 'Split right', icon: 'split-right', disabled: !ready, run: () => split('right') },
|
||||
{ label: 'Split down', icon: 'split-down', disabled: !ready, run: () => split('down') },
|
||||
{ label: tr("Move to new window"), icon: 'external', disabled: !ready, run: () => run('moveToWindow', { pinned }) },
|
||||
{ label: tr("Split right"), icon: 'split-right', disabled: !ready, run: () => split('right') },
|
||||
{ label: tr("Split down"), icon: 'split-down', disabled: !ready, run: () => split('down') },
|
||||
{ separator: true },
|
||||
{ label: 'Find…', icon: 'search', shortcut: 'Ctrl+F', disabled: !ready, run: () => { api.openView(id); void saved.control?.find(); } },
|
||||
{ label: 'Open in default browser', icon: 'external', disabled: !web, run: () => run('openExternal') },
|
||||
{ label: 'Bookmark', icon: 'bookmark', disabled: !web, run: () => run('bookmark') },
|
||||
{ label: tr("Find…"), icon: 'search', shortcut: 'Ctrl+F', disabled: !ready, run: () => { api.openView(id); void saved.control?.find(); } },
|
||||
{ label: tr("Open in default browser"), icon: 'external', disabled: !web, run: () => run('openExternal') },
|
||||
{ label: tr("Bookmark"), icon: 'bookmark', disabled: !web, run: () => run('bookmark') },
|
||||
];
|
||||
}, mount: container => {
|
||||
let runtimeId = '';
|
||||
@@ -106,12 +107,12 @@ export async function activate(api: PluginApi) {
|
||||
});
|
||||
api.registerTabDrop?.(async data => {
|
||||
const payload = JSON.parse(data);
|
||||
if (!payload || typeof payload.tabId !== 'string' || typeof payload.transferToken !== 'string') throw new Error('Invalid browser tab transfer.');
|
||||
if (!payload || typeof payload.tabId !== 'string' || typeof payload.transferToken !== 'string') throw new Error(tr("Invalid browser tab transfer."));
|
||||
const existing = owners.get(payload.tabId);
|
||||
if (existing) { api.openView(existing.view); return; }
|
||||
const snapshot = await request('adoptTab', { tabId: payload.tabId, transferToken: payload.transferToken });
|
||||
const current = snapshot.tabs.find(tab => tab.id === payload.tabId);
|
||||
if (!current) throw new Error('The browser tab is unavailable.');
|
||||
if (!current) throw new Error(tr("The browser tab is unavailable."));
|
||||
await open(current.profileId, current.url, undefined, current.id, payload.pinned === true);
|
||||
});
|
||||
const incoming = new URLSearchParams(location.search).get('browserTab');
|
||||
|
||||
Reference in New Issue
Block a user