mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-08-29 06:47:06 +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:
@@ -14,6 +14,7 @@
|
||||
TYPE_NEW,
|
||||
TYPE_COMPATIBLE_EXISTING,
|
||||
} from "./setupDialogTypes";
|
||||
import { $msg as translateMessage } from "@/common/translation";
|
||||
|
||||
type Props = {
|
||||
setResult: (result: OutroAskUserModeResultType) => void;
|
||||
@@ -25,58 +26,66 @@
|
||||
});
|
||||
const proceedMessage = $derived.by(() => {
|
||||
if (userType === TYPE_NEW) {
|
||||
return "Proceed to the next step.";
|
||||
return translateMessage("Proceed to the next step.");
|
||||
} else if (userType === TYPE_EXISTING) {
|
||||
return "Proceed to the next step.";
|
||||
return translateMessage("Proceed to the next step.");
|
||||
} else if (userType === TYPE_COMPATIBLE_EXISTING) {
|
||||
return "Apply the settings";
|
||||
return translateMessage("Apply the settings");
|
||||
} else {
|
||||
return "Please select an option to proceed";
|
||||
return translateMessage("Please select an option to proceed");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<DialogHeader title="Mostly Complete: Decision Required" />
|
||||
<DialogHeader title={translateMessage("Mostly Complete: Decision Required")} />
|
||||
<Guidance>
|
||||
The connection to the server has been configured successfully. As the next step, <strong
|
||||
>the local database, that is to say the synchronisation information, must be reconstituted.</strong
|
||||
{translateMessage("The connection to the server has been configured successfully. As the next step,")} <strong
|
||||
>{translateMessage(
|
||||
"the local database, that is to say the synchronisation information, must be reconstituted."
|
||||
)}</strong
|
||||
>
|
||||
</Guidance>
|
||||
<Instruction>
|
||||
<Question>Please select your situation.</Question>
|
||||
<Question>{translateMessage("Please select your situation.")}</Question>
|
||||
<Option
|
||||
title="I am setting up a new server for the first time / I want to reset my existing server."
|
||||
title={translateMessage(
|
||||
"I am setting up a new server for the first time / I want to reset my existing server."
|
||||
)}
|
||||
bind:value={userType}
|
||||
selectedValue={TYPE_NEW}
|
||||
>
|
||||
<InfoNote>
|
||||
Selecting this option will result in the current data on this device being used to initialise the server.
|
||||
Any existing data on the server will be completely overwritten.
|
||||
{translateMessage(
|
||||
"Selecting this option will result in the current data on this device being used to initialise the server. Any existing data on the server will be completely overwritten."
|
||||
)}
|
||||
</InfoNote>
|
||||
</Option>
|
||||
<Option
|
||||
title="My remote server is already set up. I want to join this device."
|
||||
title={translateMessage("My remote server is already set up. I want to join this device.")}
|
||||
bind:value={userType}
|
||||
selectedValue={TYPE_EXISTING}
|
||||
>
|
||||
<InfoNote>
|
||||
Selecting this option will result in this device joining the existing server. You need to fetching the
|
||||
existing synchronisation data from the server to this device.
|
||||
{translateMessage(
|
||||
"Selecting this option will result in this device joining the existing server. You need to fetching the existing synchronisation data from the server to this device."
|
||||
)}
|
||||
</InfoNote>
|
||||
</Option>
|
||||
<Option
|
||||
title="The remote is already set up, and the configuration is compatible (or got compatible by this operation)."
|
||||
title={translateMessage(
|
||||
"The remote is already set up, and the configuration is compatible (or got compatible by this operation)."
|
||||
)}
|
||||
bind:value={userType}
|
||||
selectedValue={TYPE_COMPATIBLE_EXISTING}
|
||||
>
|
||||
<InfoNote warning>
|
||||
Unless you are certain, selecting this options is bit dangerous. It assumes that the server configuration is
|
||||
compatible with this device. If this is not the case, data loss may occur. Please ensure you know what you
|
||||
are doing.
|
||||
{translateMessage(
|
||||
"Unless you are certain, selecting this options is bit dangerous. It assumes that the server configuration is compatible with this device. If this is not the case, data loss may occur. Please ensure you know what you are doing."
|
||||
)}
|
||||
</InfoNote>
|
||||
</Option>
|
||||
</Instruction>
|
||||
<UserDecisions>
|
||||
<Decision title={proceedMessage} important={true} disabled={!canProceed} commit={() => setResult(userType)} />
|
||||
<Decision title="No, please take me back" commit={() => setResult(TYPE_CANCELLED)} />
|
||||
<Decision title={translateMessage("No, please take me back")} commit={() => setResult(TYPE_CANCELLED)} />
|
||||
</UserDecisions>
|
||||
|
||||
Reference in New Issue
Block a user