1
0
mirror of https://github.com/element-hq/element-web.git synced 2025-07-31 19:44:30 +03:00

Element Module API v1.0 support (#29934)

This commit is contained in:
Michael Telatynski
2025-05-14 09:21:24 +01:00
committed by GitHub
parent c9548ec1d0
commit 785a12a029
10 changed files with 153 additions and 81 deletions

View File

@ -6,11 +6,19 @@ Please see LICENSE files in the repository root for full details.
*/
export default class ExampleModule {
static moduleApiVersion = "^0.1.0";
static moduleApiVersion = "^1.0.0";
constructor(api) {
this.api = api;
this.api.i18n.register({
key: {
en: "%(brand)s module loading successful!",
de: "%(brand)s-Module erfolgreich geladen!",
},
});
}
async load() {
alert("Testing module loading successful!");
const brand = this.api.config.get("brand");
alert(this.api.i18n.translate("key", { brand }));
}
}