mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-08-28 22:37:08 +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:
@@ -18,11 +18,11 @@
|
||||
let userType = $state<IntroResultType>(TYPE_CANCELLED);
|
||||
let proceedTitle = $derived.by(() => {
|
||||
if (userType === TYPE_NEW_USER) {
|
||||
return "Yes, I want to set up a new synchronisation";
|
||||
return translateMessage("Yes, I want to set up a new synchronisation");
|
||||
} else if (userType === TYPE_EXISTING_USER) {
|
||||
return "Yes, I want to add this device to my existing synchronisation";
|
||||
return translateMessage("Yes, I want to add this device to my existing synchronisation");
|
||||
} else {
|
||||
return "Please select an option to proceed";
|
||||
return translateMessage("Please select an option to proceed");
|
||||
}
|
||||
});
|
||||
const canProceed = $derived.by(() => {
|
||||
@@ -30,31 +30,41 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
<DialogHeader title="Welcome to Self-hosted LiveSync" />
|
||||
<Guidance>We will now guide you through a few questions to simplify the synchronisation setup.</Guidance>
|
||||
<DialogHeader title={translateMessage("Welcome to Self-hosted LiveSync")} />
|
||||
<Guidance
|
||||
>{translateMessage(
|
||||
"We will now guide you through a few questions to simplify the synchronisation setup."
|
||||
)}</Guidance
|
||||
>
|
||||
<InfoNote>
|
||||
{translateMessage(
|
||||
"This first setup has several short steps because it confirms encryption, the connection method, and which device provides the initial data. Once it is complete, additional devices can reuse a Setup URI."
|
||||
)}
|
||||
</InfoNote>
|
||||
<Instruction>
|
||||
<Question>First, please select the option that best describes your current situation.</Question>
|
||||
<Question>{translateMessage("First, please select the option that best describes your current situation.")}</Question>
|
||||
<Options>
|
||||
<Option selectedValue={TYPE_NEW_USER} title="I am setting this up for the first time" bind:value={userType}>
|
||||
(Select this if you are configuring this device as the first synchronisation device.) This option is
|
||||
suitable if you are new to LiveSync and want to set it up from scratch.
|
||||
<Option
|
||||
selectedValue={TYPE_NEW_USER}
|
||||
title={translateMessage("I am setting this up for the first time")}
|
||||
bind:value={userType}
|
||||
>
|
||||
{translateMessage(
|
||||
"(Select this if you are configuring this device as the first synchronisation device.) This option is suitable if you are new to LiveSync and want to set it up from scratch."
|
||||
)}
|
||||
</Option>
|
||||
<Option
|
||||
selectedValue={TYPE_EXISTING_USER}
|
||||
title="I am adding a device to an existing synchronisation setup"
|
||||
title={translateMessage("I am adding a device to an existing synchronisation setup")}
|
||||
bind:value={userType}
|
||||
>
|
||||
(Select this if you are already using synchronisation on another computer or smartphone.) This option is
|
||||
suitable if you are new to LiveSync and want to set it up from scratch.
|
||||
{translateMessage(
|
||||
"(Select this if you are already using synchronisation on another computer or smartphone.) This option is suitable if you are new to LiveSync and want to set it up from scratch."
|
||||
)}
|
||||
</Option>
|
||||
</Options>
|
||||
</Instruction>
|
||||
<UserDecisions>
|
||||
<Decision title={proceedTitle} important={canProceed} 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