Replace deprecated i18next-parser with i18next-cli

This commit is contained in:
Johannes Marbach
2026-06-08 15:27:07 +02:00
parent 65bd51fe92
commit 11b08c9a9f
7 changed files with 884 additions and 786 deletions

View File

@@ -8,6 +8,8 @@ Please see LICENSE in the repository root for full details.
import { t } from "i18next";
import { type ConnectionError } from "livekit-client";
import { i18nKey } from "./i18n";
export enum ErrorCode {
/**
* Configuration problem due to no MatrixRTC backend/SFU is exposed via .well-known and no fallback configured.
@@ -251,9 +253,9 @@ export class PeerConnectionTimeoutError extends ElementCallError {
ErrorCode.SFU_ERROR,
ErrorCategory.NETWORK_CONNECTIVITY,
);
// Mark translation key for i18n extraction
// t("error.peer_connection_timeout_description");
this.localisedMessageKey = "error.peer_connection_timeout_description";
this.localisedMessageKey = i18nKey(
"error.peer_connection_timeout_description",
);
this.localisedMessageValues = {
linkUrl:
"https://docs.element.io/latest/element-server-suite-pro/configuring-components/configuring-matrix-rtc/#sfu-connectivity-troubleshooting",
@@ -268,9 +270,9 @@ export class LivekitConnectionError extends ElementCallError {
ErrorCode.SFU_ERROR,
ErrorCategory.NETWORK_CONNECTIVITY,
);
// Mark translation key for i18n extraction
// t("error.livekit_connection_error_description");
this.localisedMessageKey = "error.livekit_connection_error_description";
this.localisedMessageKey = i18nKey(
"error.livekit_connection_error_description",
);
this.localisedMessageValues = { reason: cause.reasonName };
}
}

9
src/utils/i18n.ts Normal file
View File

@@ -0,0 +1,9 @@
/*
Copyright 2026 New Vector Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE in the repository root for full details.
*/
// Custom marker function to allow i18next extraction
export const i18nKey = (key: string): string => key;