WIP: Arabic localization.|

This commit is contained in:
a.bouhuolia
2021-06-10 12:51:00 +02:00
parent 4fc7c37260
commit 1ea32884c2
465 changed files with 3299 additions and 2109 deletions

View File

@@ -11,5 +11,6 @@ export default (req: Request, res: Response, next: NextFunction) => {
}
Logger.info('[i18n_middleware] set locale language to i18n.', { language, user: req.user });
i18n.setLocale(req, language);
next();
};

View File

@@ -6,6 +6,7 @@ import TenantsManagerService from 'services/Tenancy/TenantsManager';
export default (req: Request, tenant: ITenant) => {
const { id: tenantId, organizationId } = tenant;
const tenantServices = Container.get(TenancyService);
const tenantsManager = Container.get(TenantsManagerService);
@@ -17,7 +18,9 @@ export default (req: Request, tenant: ITenant) => {
const repositories = tenantServices.repositories(tenantId)
const cacheInstance = tenantServices.cache(tenantId);
tenantServices.setI18nLocals(tenantId, { __: req.__ });
const tenantContainer = tenantServices.tenantContainer(tenantId);
tenantContainer.set('i18n', { __: req.__ });
req.knex = knexInstance;
req.organizationId = organizationId;