

























@@ -74,18 +74,21 @@ describeWhenUiI18nPresent("ui i18n locale registry", () => {
7474});
75757676it("loads lazy locale translations from the registry", async () => {
77-const de = await registry.loadLazyLocaleTranslation("de");
78-const es = await registry.loadLazyLocaleTranslation("es");
79-const ptBR = await registry.loadLazyLocaleTranslation("pt-BR");
80-const zhCN = await registry.loadLazyLocaleTranslation("zh-CN");
81-const th = await registry.loadLazyLocaleTranslation("th");
77+const [de, es, ptBR, zhCN, th, en] = await Promise.all([
78+registry.loadLazyLocaleTranslation("de"),
79+registry.loadLazyLocaleTranslation("es"),
80+registry.loadLazyLocaleTranslation("pt-BR"),
81+registry.loadLazyLocaleTranslation("zh-CN"),
82+registry.loadLazyLocaleTranslation("th"),
83+registry.loadLazyLocaleTranslation("en"),
84+]);
82858386expect(getNestedTranslation(de, "common", "health")).toBe("Status");
8487expect(getNestedTranslation(es, "common", "health")).toBe("Estado");
8588expect(getNestedTranslation(es, "languages", "de")).toBe("Deutsch (Alemán)");
8689expect(getNestedTranslation(ptBR, "languages", "es")).toBe("Español (Espanhol)");
8790expect(getNestedTranslation(zhCN, "common", "health")).toBe("\u5065\u5eb7\u72b6\u51b5");
8891expect(getNestedTranslation(th, "languages", "en")).toBeTruthy();
89-expect(await registry.loadLazyLocaleTranslation("en")).toBeNull();
92+expect(en).toBeNull();
9093});
9194});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。