mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-08-28 06:17: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:
@@ -17,6 +17,7 @@
|
||||
import type { GuestDialogProps } from "@/modules/services/LiveSyncUI/svelteDialog";
|
||||
import { copyTo, pickEncryptionSettings } from "@vrtmrz/livesync-commonlib/compat/common/utils";
|
||||
import { TYPE_CANCELLED, type SetupRemoteE2EEResultType } from "./setupDialogTypes";
|
||||
import { $msg as translateMessage } from "@/common/translation";
|
||||
|
||||
type Props = GuestDialogProps<SetupRemoteE2EEResultType, EncryptionSettings>;
|
||||
const { setResult, getInitialData }: Props = $props();
|
||||
@@ -47,30 +48,31 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<DialogHeader title="End-to-End Encryption" />
|
||||
<Guidance>Please configure your end-to-end encryption settings.</Guidance>
|
||||
<InputRow label="End-to-End Encryption">
|
||||
<DialogHeader title={translateMessage("End-to-End Encryption")} />
|
||||
<Guidance>{translateMessage("Please configure your end-to-end encryption settings.")}</Guidance>
|
||||
<InputRow label={translateMessage("End-to-End Encryption")}>
|
||||
<input type="checkbox" bind:checked={encryptionSettings.encrypt} />
|
||||
<Password
|
||||
name="e2ee-passphrase"
|
||||
placeholder="Enter your passphrase"
|
||||
placeholder={translateMessage("Enter your passphrase")}
|
||||
bind:value={encryptionSettings.passphrase}
|
||||
disabled={!encryptionSettings.encrypt}
|
||||
required={encryptionSettings.encrypt}
|
||||
/>
|
||||
</InputRow>
|
||||
<InfoNote title="Strongly Recommended">
|
||||
Enabling end-to-end encryption ensures that your data is encrypted on your device before being sent to the remote
|
||||
server. This means that even if someone gains access to the server, they won't be able to read your data without the
|
||||
passphrase. Make sure to remember your passphrase, as it will be required to decrypt your data on other devices.
|
||||
<InfoNote title={translateMessage("Strongly Recommended")}>
|
||||
{translateMessage(
|
||||
"Enabling end-to-end encryption ensures that your data is encrypted on your device before being sent to the remote server. This means that even if someone gains access to the server, they won't be able to read your data without the passphrase. Make sure to remember your passphrase, as it will be required to decrypt your data on other devices."
|
||||
)}
|
||||
<br />
|
||||
Also, please note that if you are using Peer-to-Peer synchronization, this configuration will be used when you switch
|
||||
to other methods and connect to a remote server in the future.
|
||||
{translateMessage(
|
||||
"Also, please note that if you are using Peer-to-Peer synchronization, this configuration will be used when you switch to other methods and connect to a remote server in the future."
|
||||
)}
|
||||
</InfoNote>
|
||||
<InfoNote warning>
|
||||
This setting must be the same even when connecting to multiple synchronisation destinations.
|
||||
{translateMessage("This setting must be the same even when connecting to multiple synchronisation destinations.")}
|
||||
</InfoNote>
|
||||
<InputRow label="Obfuscate Properties">
|
||||
<InputRow label={translateMessage("Obfuscate Properties")}>
|
||||
<input
|
||||
type="checkbox"
|
||||
bind:checked={encryptionSettings.usePathObfuscation}
|
||||
@@ -79,14 +81,13 @@
|
||||
</InputRow>
|
||||
|
||||
<InfoNote>
|
||||
Obfuscating properties (e.g., path of file, size, creation and modification dates) adds an additional layer of
|
||||
security by making it harder to identify the structure and names of your files and folders on the remote server.
|
||||
This helps protect your privacy and makes it more difficult for unauthorized users to infer information about your
|
||||
data.
|
||||
{translateMessage(
|
||||
"Obfuscating properties (e.g., path of file, size, creation and modification dates) adds an additional layer of security by making it harder to identify the structure and names of your files and folders on the remote server. This helps protect your privacy and makes it more difficult for unauthorized users to infer information about your data."
|
||||
)}
|
||||
</InfoNote>
|
||||
|
||||
<ExtraItems title="Advanced">
|
||||
<InputRow label="Encryption Algorithm">
|
||||
<ExtraItems title={translateMessage("Advanced")}>
|
||||
<InputRow label={translateMessage("Encryption Algorithm")}>
|
||||
<select bind:value={encryptionSettings.E2EEAlgorithm} disabled={!encryptionSettings.encrypt}>
|
||||
{#each Object.values(E2EEAlgorithms) as alg}
|
||||
<option value={alg}>{E2EEAlgorithmNames[alg] ?? alg}</option>
|
||||
@@ -94,30 +95,33 @@
|
||||
</select>
|
||||
</InputRow>
|
||||
<InfoNote>
|
||||
In most cases, you should stick with the default algorithm ({E2EEAlgorithmNames[
|
||||
DEFAULT_SETTINGS.E2EEAlgorithm
|
||||
]}), This setting is only required if you have an existing Vault encrypted in a different format.
|
||||
{translateMessage(
|
||||
"In most cases, you should stick with the default algorithm (${algorithm}), This setting is only required if you have an existing Vault encrypted in a different format.",
|
||||
{ algorithm: E2EEAlgorithmNames[DEFAULT_SETTINGS.E2EEAlgorithm] }
|
||||
)}
|
||||
</InfoNote>
|
||||
<InfoNote warning>
|
||||
Changing the encryption algorithm will prevent access to any data previously encrypted with a different
|
||||
algorithm. Ensure that all your devices are configured to use the same algorithm to maintain access to your
|
||||
data.
|
||||
{translateMessage(
|
||||
"Changing the encryption algorithm will prevent access to any data previously encrypted with a different algorithm. Ensure that all your devices are configured to use the same algorithm to maintain access to your data."
|
||||
)}
|
||||
</InfoNote>
|
||||
</ExtraItems>
|
||||
|
||||
<InfoNote warning>
|
||||
<p>
|
||||
Please be aware that the End-to-End Encryption passphrase is not validated until the synchronisation process
|
||||
actually commences. This is a security measure designed to protect your data.
|
||||
{translateMessage(
|
||||
"Please be aware that the End-to-End Encryption passphrase is not validated until the synchronisation process actually commences. This is a security measure designed to protect your data."
|
||||
)}
|
||||
</p>
|
||||
<p>
|
||||
Therefore, we ask that you exercise extreme caution when configuring server information manually. If an
|
||||
incorrect passphrase is entered, the data on the server will become corrupted. <br /><br />
|
||||
Please understand that this is intended behaviour.
|
||||
{translateMessage(
|
||||
"Therefore, we ask that you exercise extreme caution when configuring server information manually. If an incorrect passphrase is entered, the data on the server will become corrupted."
|
||||
)} <br /><br />
|
||||
{translateMessage("Please understand that this is intended behaviour.")}
|
||||
</p>
|
||||
</InfoNote>
|
||||
|
||||
<UserDecisions>
|
||||
<Decision title="Proceed" important disabled={!e2eeValid} commit={() => commit()} />
|
||||
<Decision title="Cancel" commit={() => setResult(TYPE_CANCELLED)} />
|
||||
<Decision title={translateMessage("Proceed")} important disabled={!e2eeValid} commit={() => commit()} />
|
||||
<Decision title={translateMessage("Cancel")} commit={() => setResult(TYPE_CANCELLED)} />
|
||||
</UserDecisions>
|
||||
|
||||
Reference in New Issue
Block a user