Made i18n constructor private again + fixed direct call to it (singleton)
MODIFY
src/notification/remote-push-notification/RemotePushNotificationTask.ts
src/notification/remote-push-notification/RemotePushNotificationTask.ts
@@ -297,7 +297,7 @@ export default class RemotePushNotificationTask implements NotificationTask {
public async sendOICPPatchChargingStationsStatusesError(data: OICPPatchChargingStationsStatusesErrorNotification, user: User, tenant: Tenant, severity: NotificationSeverity): Promise<void> {
// Set the locale
- const i18nManager = new I18nManager(user.locale);
+ const i18nManager = I18nManager.getInstanceForLocale(user.locale);
// Get Message Text
const title = i18nManager.translate('notifications.oicpPatchChargingStationsStatusesError.title');
const body = i18nManager.translate('notifications.oicpPatchChargingStationsStatusesError.body',
@@ -308,7 +308,7 @@ export default class RemotePushNotificationTask implements NotificationTask {
public async sendOICPPatchChargingStationsError(data: OICPPatchChargingStationsErrorNotification, user: User, tenant: Tenant, severity: NotificationSeverity): Promise<void> {
// Set the locale
- const i18nManager = new I18nManager(user.locale);
+ const i18nManager = I18nManager.getInstanceForLocale(user.locale);
// Get Message Text
const title = i18nManager.translate('notifications.oicpPatchChargingStationsError.title');
const body = i18nManager.translate('notifications.oicpPatchChargingStationsError.body',

MODIFY
src/utils/I18nManager.ts
src/utils/I18nManager.ts
@@ -17,7 +17,7 @@ export default class I18nManager {
private static instances = new Map<string, I18nManager>(); // Tableau avec la cle en locale
private language: string;
- constructor(locale: string) {
+ private constructor(locale: string) {
// Get language
this.language = Utils.getLanguageFromLocale(locale);
// Supported languages?

Made i18n constructor private again + fixed direct call to it (singleton)