WIP: Arabic localization.

This commit is contained in:
a.bouhuolia
2021-06-13 13:53:17 +02:00
parent 7d5bb95e75
commit 26bea3d2c2
27 changed files with 304 additions and 100 deletions

View File

@@ -21,6 +21,7 @@ import events from 'subscribers/events';
import AccountTypesUtils from 'lib/AccountTypes';
import { ERRORS } from './constants';
import { flatToNestedArray } from 'utils';
import I18nService from 'services/I18n/I18nService';
@Service()
export default class AccountsService {
@@ -36,6 +37,9 @@ export default class AccountsService {
@EventDispatcher()
eventDispatcher: EventDispatcherInterface;
@Inject()
i18nService: I18nService;
/**
* Retrieve account type or throws service error.
* @param {number} tenantId -
@@ -721,7 +725,9 @@ export default class AccountsService {
...account.toJSON(),
currencyCode: baseCurrency,
}));
return flatToNestedArray(_accounts, {
return flatToNestedArray(
this.i18nService.i18nMapper(_accounts, ['account_type_label'], tenantId),
{
id: 'id',
parentId: 'parent_account_id',
});