@@ -5,7 +5,12 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
55Please see LICENSE files in the repository root for full details.
66*/
77
8- import { type I18nApi as II18nApi , type Variables , type Translations } from "@element-hq/element-web-module-api" ;
8+ import {
9+ type I18nApi as II18nApi ,
10+ type Variables ,
11+ type Translations ,
12+ type Tags ,
13+ } from "@element-hq/element-web-module-api" ;
914
1015import { humanizeTime } from "../utils/humanize" ;
1116import { _t , getLocale , registerTranslations } from "./i18n" ;
@@ -41,8 +46,12 @@ export class I18nApi implements II18nApi {
4146 * Perform a translation, with optional variables
4247 * @param key - The key to translate
4348 * @param variables - Optional variables to interpolate into the translation
49+ * @param tags - Optional tags to interpolate into the translation
4450 */
45- public translate ( this : void , key : TranslationKey , variables ?: Variables ) : string {
51+ public translate ( this : void , key : TranslationKey , variables ?: Variables ) : string ;
52+ public translate ( this : void , key : TranslationKey , variables : Variables | undefined , tags : Tags ) : React . ReactNode ;
53+ public translate ( this : void , key : TranslationKey , variables ?: Variables , tags ?: Tags ) : string {
54+ if ( tags ) return _t ( key , variables , tags ) as string ;
4655 return _t ( key , variables ) ;
4756 }
4857
0 commit comments