mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-09-30 14:32:30 +00:00
Complete Commonlib rc.6 integration and setup workflows
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
|
||||
import { englishMessageTranslator } from "@vrtmrz/livesync-commonlib/context";
|
||||
import { $msg, setLang, translateLiveSyncMessage } from "@/common/translation";
|
||||
import { SUPPORTED_I18N_LANGS } from "@/common/rosetta";
|
||||
|
||||
describe("LiveSync-owned translation catalogue", () => {
|
||||
afterEach(() => setLang("def"));
|
||||
|
||||
it("selects a translated language without delegating catalogue ownership to Commonlib", () => {
|
||||
setLang("es");
|
||||
|
||||
expect(translateLiveSyncMessage("moduleCheckRemoteSize.optionIncreaseLimit", { newMax: "800" })).toBe(
|
||||
"aumentar a 800MB"
|
||||
);
|
||||
expect(SUPPORTED_I18N_LANGS).toContain("es");
|
||||
});
|
||||
|
||||
it("retains typed placeholder substitution", () => {
|
||||
expect($msg("moduleCheckRemoteSize.optionIncreaseLimit", { newMax: "800" }, "def")).toBe("increase to 800MB");
|
||||
});
|
||||
|
||||
it("uses Commonlib's canonical English when the application catalogue has no translation", () => {
|
||||
setLang("es");
|
||||
|
||||
expect(translateLiveSyncMessage("Active Remote Type")).toBe(englishMessageTranslator("Active Remote Type"));
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user