fix(language): fixing types

This commit is contained in:
Slincnik 2025-03-04 18:20:29 +03:00
parent 26d94bed0c
commit 7f5a42b159
No known key found for this signature in database

View file

@ -54,8 +54,15 @@ export default class InternationalizationService {
return { namespaces: [...new Set(namespaces)], languages }; return { namespaces: [...new Set(namespaces)], languages };
} }
public translate(key: string, options: TOptionsBase = {}) { public translate(
const lng = options.lng || this.options.defaultLanguage; key: string,
options?:
| TOptionsBase
| {
[key: string]: string;
},
) {
const lng = options?.lng || this.options.defaultLanguage;
return i18next.t(key, { lng, ...options }); return i18next.t(key, { lng, ...options });
} }