mirror of
https://github.com/vector-im/element-web.git
synced 2025-11-29 14:31:22 +01:00
Simple test for i18napi
This commit is contained in:
parent
f098f579b4
commit
12d7a0ab97
22
packages/shared-components/src/utils/I18nApi.test.ts
Normal file
22
packages/shared-components/src/utils/I18nApi.test.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2025 Element Creations Ltd.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
||||||
|
* Please see LICENSE files in the repository root for full details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { TranslationKey } from "../i18nKeys";
|
||||||
|
import { I18nApi } from "./I18nApi";
|
||||||
|
|
||||||
|
describe("I18nApi", () => {
|
||||||
|
it("can register a translation and use it", () => {
|
||||||
|
const i18n = new I18nApi();
|
||||||
|
i18n.register({
|
||||||
|
"hello.world": {
|
||||||
|
en: "Hello, World!",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(i18n.translate("hello.world" as TranslationKey)).toBe("Hello, World!");
|
||||||
|
});
|
||||||
|
});
|
||||||
Loading…
x
Reference in New Issue
Block a user