mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-08-27 22:07:07 +00:00
refactor(i18n): route remaining Obsidian UI text through the message catalogue
Continues the source-key migration inside the application boundary introduced in 1.0.0, where LiveSync owns its catalogue and consumes Commonlib as a published package. - Replace hardcoded user-visible strings in the Obsidian UI (Setup Wizard dialogues, P2P panes, Customisation Sync panes, Global History, the JSON conflict pane and the remote-configuration menu) with `$msg` calls, keeping the English source string as the key. - Wire up strings whose translations already existed in the catalogue but were still rendered as literals, for example the whole Intro dialogue. - Add the new entries to `src/common/messagesYAML/en.yaml` and `es.yaml`, then regenerate `messagesJson/` and `combinedMessages.prod.ts` through the documented `i18n:bake` pipeline. - No Commonlib gitlink or catalogue is involved; every change is LiveSync-owned. Regenerating the catalogue also normalises three pre-existing entries each in `ko.json` and `zh.json`, where the committed JSON kept a trailing space before a newline that YAML cannot represent. Verified with tsc-check, tsc-check:apps, svelte-check and lint. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
import { decryptString } from "@vrtmrz/livesync-commonlib/compat/encryption/stringEncryption";
|
||||
import type { GuestDialogProps } from "@/modules/services/LiveSyncUI/svelteDialog";
|
||||
import { TYPE_CANCELLED, type UseSetupURIResultType } from "./setupDialogTypes";
|
||||
import { $msg as translateMessage } from "@/common/translation";
|
||||
|
||||
type Props = GuestDialogProps<UseSetupURIResultType, string>;
|
||||
const { setResult, getInitialData }: Props = $props();
|
||||
@@ -34,7 +35,7 @@
|
||||
error = "";
|
||||
if (!seemsValid) return;
|
||||
if (!passphrase) {
|
||||
error = "Passphrase is required.";
|
||||
error = translateMessage("Passphrase is required.");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
@@ -47,7 +48,7 @@
|
||||
// Logger("Settings imported successfully", LOG_LEVEL_NOTICE);
|
||||
return;
|
||||
} catch (e) {
|
||||
error = "Failed to parse Setup-URI.";
|
||||
error = translateMessage("Failed to parse Setup-URI.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -56,14 +57,17 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<DialogHeader title="Enter Setup URI" />
|
||||
<DialogHeader title={translateMessage("Enter Setup URI")} />
|
||||
<Guidance
|
||||
>Please enter the Setup URI that was generated during server installation or on another device, along with the vault
|
||||
passphrase.<br />
|
||||
Note that you can generate a new Setup URI by running the "Copy settings as a new Setup URI" command in the command palette.</Guidance
|
||||
>{translateMessage(
|
||||
"Please enter the Setup URI that was generated during server installation or on another device, along with the vault passphrase."
|
||||
)}<br />
|
||||
{translateMessage(
|
||||
'Note that you can generate a new Setup URI by running the "Copy settings as a new Setup URI" command in the command palette.'
|
||||
)}</Guidance
|
||||
>
|
||||
|
||||
<InputRow label="Setup-URI">
|
||||
<InputRow label={translateMessage("Setup-URI")}>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="obsidian://setuplivesync?settings=...."
|
||||
@@ -74,12 +78,12 @@
|
||||
required
|
||||
/>
|
||||
</InputRow>
|
||||
<InfoNote visible={seemsValid}>The Setup-URI is valid and ready to use.</InfoNote>
|
||||
<InfoNote visible={seemsValid}>{translateMessage("The Setup-URI is valid and ready to use.")}</InfoNote>
|
||||
<InfoNote warning visible={!seemsValid && setupURI.trim() != ""}>
|
||||
The Setup-URI does not appear to be valid. Please check that you have copied it correctly.
|
||||
{translateMessage("The Setup-URI does not appear to be valid. Please check that you have copied it correctly.")}
|
||||
</InfoNote>
|
||||
<InputRow label="Passphrase">
|
||||
<Password placeholder="Enter your passphrase" bind:value={passphrase} required />
|
||||
<InputRow label={translateMessage("Passphrase")}>
|
||||
<Password placeholder={translateMessage("Enter your passphrase")} bind:value={passphrase} required />
|
||||
</InputRow>
|
||||
<InfoNote error visible={error.trim() != ""}>
|
||||
{error}
|
||||
@@ -87,10 +91,10 @@
|
||||
|
||||
<UserDecisions>
|
||||
<Decision
|
||||
title="Test Settings and Continue"
|
||||
title={translateMessage("Test Settings and Continue")}
|
||||
important={true}
|
||||
disabled={!canProceed}
|
||||
commit={() => processSetupURI()}
|
||||
/>
|
||||
<Decision title="Cancel" commit={() => setResult(TYPE_CANCELLED)} />
|
||||
<Decision title={translateMessage("Cancel")} commit={() => setResult(TYPE_CANCELLED)} />
|
||||
</UserDecisions>
|
||||
|
||||
Reference in New Issue
Block a user