fix(i18n): overhaul Japanese translations, localise pending UI labels, and update documentation

- Overhaul Japanese translation catalogue and synchronize with current documentation
- Localise pending UI labels across dialogues, panels, and settings
- Add Japanese translation mapping for provisional LiveSync messages
- Update and refine all Japanese documentation files
- Strip weak ETag prefix in ObsHttpHandler for object storage compatibility
This commit is contained in:
Chihiro WATANABE committed 2026-11-04 10:38:55 +09:00
1 parent 0fe7d82f46
commit 5ffa3b76ed
32 files changed
+6154 -1549

No files matched your search

@@ -39,19 +39,19 @@
{/each}
<li>
<label>
<button on:click={() => add()}>Add</button>
<button on:click={() => add()}>{translateMessage("Add")}</button>
</label>
</li>
<li class="buttons">
<button
on:click={() => apply(patterns)}
disabled={statusName.some((e) => e === CHECK_NG) || modified.every((e) => e === "")}
>Apply
>{translateMessage("Apply")}
</button>
<button
on:click={() => revert()}
disabled={statusName.some((e) => e === CHECK_NG) || modified.every((e) => e === "")}
>Revert
>{translateMessage("Revert")}
</button>
</li>
</ul>
@@ -585,7 +585,7 @@ describe("ObsidianLiveSyncSettingTab pending-setting initialisation", () => {
);
expect(loggerMocks.Logger).toHaveBeenCalledWith(
expect.stringContaining(
"Rebuild both databases from a complete authoritative Vault and Fetch on the other devices."
"then Rebuild both databases from a complete authoritative Vault and Fetch on the other devices."
),
LOG_LEVEL_NOTICE
);
@@ -98,7 +98,7 @@ export function panePatches(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElemen
el.setText(`Current adapter: ${useIndexedDBAdapter ? "IndexedDB" : "IDB"}`);
if (!useIndexedDBAdapter) {
setting.addButton((button) => {
button.setButtonText("Switch to IndexedDB").onClick(async () => {
button.setButtonText($msg("Switch to IndexedDB")).onClick(async () => {
Logger("Migrating all data to IndexedDB...", LOG_LEVEL_NOTICE);
await migrateAllToIndexedDB();
Logger(
@@ -109,7 +109,7 @@ export function panePatches(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElemen
});
} else {
setting.addButton((button) => {
button.setButtonText("Switch to IDB").onClick(async () => {
button.setButtonText($msg("Switch to IDB")).onClick(async () => {
Logger("Migrating all data to IDB...", LOG_LEVEL_NOTICE);
await migrateAllToIDB();
Logger(
@@ -253,21 +253,21 @@ export function paneSyncSettings(
new Setting(paneEl)
.setName($msg("obsidianLiveSyncSettingTab.nameEnableHiddenFileSync"))
.addButton((button) => {
button.setButtonText("Merge").onClick(async () => {
button.setButtonText($msg("Merge")).onClick(async () => {
this.closeSetting();
// this.resetEditingSettings();
await this.services.setting.enableOptionalFeature("MERGE");
});
})
.addButton((button) => {
button.setButtonText("Fetch").onClick(async () => {
button.setButtonText($msg("Fetch")).onClick(async () => {
this.closeSetting();
// this.resetEditingSettings();
await this.services.setting.enableOptionalFeature("FETCH");
});
})
.addButton((button) => {
button.setButtonText("Overwrite").onClick(async () => {
button.setButtonText($msg("Overwrite")).onClick(async () => {
this.closeSetting();
// this.resetEditingSettings();
await this.services.setting.enableOptionalFeature("OVERWRITE");
@@ -13,7 +13,8 @@ import {
type AllBooleanItemKey as CommonlibAllBooleanItemKey,
} from "@vrtmrz/livesync-commonlib/compat/common/settingConstants";
import type { ConfigurationItem } from "@vrtmrz/livesync-commonlib/compat/common/types";
import type { MessageTranslator } from "@vrtmrz/livesync-commonlib/context";
import type { AllMessageKeys } from "@/common/rosetta";
import type { LiveSyncMessageTranslator } from "@/common/translation";
import { translateLiveSyncMessage } from "@/common/translation";
import {
DEFAULT_SYNC_GUARD_SETTINGS,
@@ -52,13 +53,19 @@ export const SettingInformation: Partial<Record<AllSettingItemKey, Configuration
// site has to remember the second argument.
/** `getConfig` with the LiveSync catalogue applied by default. */
export function getConfig(key: AllSettingItemKey, translate: MessageTranslator = translateLiveSyncMessage) {
if (isSyncGuardSettingKey(key)) return syncGuardSettingInformation[key];
export function getConfig(key: AllSettingItemKey, translate: LiveSyncMessageTranslator = translateLiveSyncMessage) {
if (isSyncGuardSettingKey(key)) {
const info = syncGuardSettingInformation[key];
return {
name: translate(info.name as AllMessageKeys),
desc: info.desc ? translate(info.desc as AllMessageKeys) : undefined,
};
}
return getCommonlibConfig(key, translate);
}
/** `getConfName` with the LiveSync catalogue applied by default. See `getConfig`. */
export function getConfName(key: AllSettingItemKey, translate: MessageTranslator = translateLiveSyncMessage) {
if (isSyncGuardSettingKey(key)) return syncGuardSettingInformation[key].name;
export function getConfName(key: AllSettingItemKey, translate: LiveSyncMessageTranslator = translateLiveSyncMessage) {
if (isSyncGuardSettingKey(key)) return translate(syncGuardSettingInformation[key].name as AllMessageKeys);
return getCommonlibConfName(key, translate);
}
@@ -25,6 +25,13 @@ describe("setting manifest labels", () => {
});
});
it("renders LiveSync provisional settings in Japanese", () => {
setLang("ja");
expect(getConfName("batchSaveInLiveSync")).toBe("LiveSync モードでデータベース更新をバッチ処理");
expect(getConfName("syncGuardEnabled")).toBe("SyncGuard を有効化");
});
it("passes through labels which Commonlib owns but the catalogue does not carry", () => {
setLang("zh-tw");