fix: load plugin strings on guest pages, plugin wording and drop unused keys

This commit is contained in:
LukeGus committed 2026-10-09 07:37:51 -05:00
1 parent f803bfc140
commit 406766eddd
19 files changed
+81 -292

No files matched your search

+16
View File
@@ -24,6 +24,7 @@ import {
visibleRailItems,
} from "@/sidebar/rail-items";
import { getTabType, resetTabTypes } from "@/shell/tab-registry";
import i18n from "@/i18n/i18n";
function summary(
id: string,
@@ -263,6 +264,21 @@ describe("plugin loader", () => {
expect(isPluginFrontendActive("alpha")).toBe(true);
});
it("loads plugin strings on guest pages", async () => {
modules.guest = railPlugin("guest");
plugins = [summary("guest", { locales: ["en"] })];
configurePluginLoader({
fetchPlugins: async () => plugins,
importFrontend: async (entry) => modules[entry.id],
loadLocale: async () => ({ hello: "Hello guest" }),
injectCss: () => null,
});
await startPluginRuntime({ guest: true });
await i18n.loadNamespaces("guest");
expect(i18n.t("hello", { ns: "guest" })).toBe("Hello guest");
});
it("settles even when the plugin list cannot be fetched", async () => {
vi.spyOn(console, "error").mockImplementation(() => {});
configurePluginLoader({