[ACS-5629] enhanced way of providing translations (#8763)

* enhanced way providing translations

* update documentation

* update documentation

* test fixes

* try add missing module import

* inject i18n to core module to cause the setup
This commit is contained in:
Denys Vuika
2023-07-18 20:06:09 +01:00
committed by GitHub
parent d70f689e06
commit 1a4d7ba008
11 changed files with 99 additions and 183 deletions

View File

@@ -24,11 +24,11 @@ import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform
import { TranslateModule } from '@ngx-translate/core';
import {
AppConfigService,
TRANSLATION_PROVIDER,
DebugAppConfigService,
CoreModule,
CoreAutomationService,
AuthModule
AuthModule,
provideTranslations
} from '@alfresco/adf-core';
import { ExtensionsModule } from '@alfresco/adf-extensions';
import { AppComponent } from './app.component';
@@ -211,22 +211,8 @@ registerLocaleData(localeSv);
],
providers: [
{ provide: AppConfigService, useClass: DebugAppConfigService }, // not use this service in production
{
provide: TRANSLATION_PROVIDER,
multi: true,
useValue: {
name: 'app',
source: 'resources'
}
},
{
provide: TRANSLATION_PROVIDER,
multi: true,
useValue: {
name: 'lazy-loading',
source: 'resources/lazy-loading'
}
},
provideTranslations('app', 'resources'),
provideTranslations('lazy-loading', 'resources/lazy-loading'),
AppNotificationsService,
{
provide: APP_INITIALIZER,