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 };
}
public translate(key: string, options: TOptionsBase = {}) {
const lng = options.lng || this.options.defaultLanguage;
public translate(
key: string,
options?:
| TOptionsBase
| {
[key: string]: string;
},
) {
const lng = options?.lng || this.options.defaultLanguage;
return i18next.t(key, { lng, ...options });
}