From 30014b793e35e48c3cc4247988721b63bb85d735 Mon Sep 17 00:00:00 2001 From: Ayman Abo El Abbas Date: Thu, 14 May 2026 17:39:36 +0300 Subject: [PATCH 001/163] refactor: update dependencies and migrate localization strings across frontend applications --- .../admin-cms/src/app/app.component.spec.ts | 4 +- frontend/apps/admin-cms/src/app/app.config.ts | 33 +- .../app/auth-callback/auth-callback.page.ts | 4 +- .../auth-toolbar/auth-toolbar.component.html | 4 +- .../auth-toolbar.component.spec.ts | 4 +- .../auth-toolbar/auth-toolbar.component.ts | 4 +- .../app/core/http/server-error.interceptor.ts | 2 +- .../app/core/layout/shell.component.spec.ts | 4 +- .../src/app/core/layout/shell.component.ts | 8 +- .../app/core/layout/side-nav.component.html | 6 +- .../core/layout/side-nav.component.spec.ts | 6 +- .../src/app/core/layout/side-nav.component.ts | 4 +- .../src/app/core/translate-loader.factory.ts | 14 +- .../src/app/features/audit/audit.page.html | 26 +- .../src/app/features/audit/audit.page.spec.ts | 4 +- .../src/app/features/audit/audit.page.ts | 4 +- .../community-moderation.page.html | 72 +-- .../community-moderation.page.spec.ts | 4 +- .../community-moderation.page.ts | 4 +- .../content/asset-upload.component.html | 8 +- .../content/asset-upload.component.spec.ts | 4 +- .../content/asset-upload.component.ts | 4 +- .../country-resource-request.page.html | 18 +- .../country-resource-request.page.spec.ts | 4 +- .../content/country-resource-request.page.ts | 4 +- .../content/resource-form.dialog.html | 24 +- .../content/resource-form.dialog.spec.ts | 4 +- .../features/content/resource-form.dialog.ts | 4 +- .../features/content/resources-list.page.html | 28 +- .../content/resources-list.page.spec.ts | 4 +- .../features/content/resources-list.page.ts | 4 +- .../countries/countries-list.page.html | 20 +- .../countries/countries-list.page.spec.ts | 4 +- .../features/countries/countries-list.page.ts | 4 +- .../countries/country-detail.page.html | 38 +- .../countries/country-detail.page.spec.ts | 4 +- .../features/countries/country-detail.page.ts | 4 +- .../experts/approve-expert.dialog.html | 12 +- .../experts/approve-expert.dialog.spec.ts | 4 +- .../features/experts/approve-expert.dialog.ts | 4 +- .../experts/expert-profiles-list.page.html | 18 +- .../experts/expert-profiles-list.page.spec.ts | 4 +- .../experts/expert-profiles-list.page.ts | 4 +- .../experts/expert-requests-list.page.html | 28 +- .../experts/expert-requests-list.page.spec.ts | 4 +- .../experts/expert-requests-list.page.ts | 4 +- .../experts/reject-expert.dialog.html | 12 +- .../experts/reject-expert.dialog.spec.ts | 4 +- .../features/experts/reject-expert.dialog.ts | 4 +- .../features/identity/role-assign.dialog.html | 10 +- .../identity/role-assign.dialog.spec.ts | 4 +- .../features/identity/role-assign.dialog.ts | 4 +- .../identity/state-rep-create.dialog.html | 16 +- .../identity/state-rep-create.dialog.spec.ts | 4 +- .../identity/state-rep-create.dialog.ts | 4 +- .../identity/state-rep-list.page.html | 20 +- .../identity/state-rep-list.page.spec.ts | 4 +- .../features/identity/state-rep-list.page.ts | 4 +- .../features/identity/user-detail.page.html | 20 +- .../identity/user-detail.page.spec.ts | 4 +- .../app/features/identity/user-detail.page.ts | 4 +- .../features/identity/users-list.page.html | 10 +- .../features/identity/users-list.page.spec.ts | 4 +- .../app/features/identity/users-list.page.ts | 4 +- .../notification-form.dialog.html | 24 +- .../notifications/notification-form.dialog.ts | 4 +- .../notifications-list.page.html | 22 +- .../notifications-list.page.spec.ts | 4 +- .../notifications/notifications-list.page.ts | 4 +- .../publishing/event-form.dialog.html | 28 +- .../features/publishing/event-form.dialog.ts | 4 +- .../features/publishing/events-list.page.html | 24 +- .../publishing/events-list.page.spec.ts | 4 +- .../features/publishing/events-list.page.ts | 4 +- .../publishing/homepage-sections.page.html | 20 +- .../publishing/homepage-sections.page.spec.ts | 4 +- .../publishing/homepage-sections.page.ts | 4 +- .../features/publishing/news-form.dialog.html | 20 +- .../features/publishing/news-form.dialog.ts | 4 +- .../features/publishing/news-list.page.html | 32 +- .../publishing/news-list.page.spec.ts | 4 +- .../app/features/publishing/news-list.page.ts | 4 +- .../features/publishing/page-form.dialog.html | 20 +- .../features/publishing/page-form.dialog.ts | 4 +- .../features/publishing/pages-list.page.html | 20 +- .../publishing/pages-list.page.spec.ts | 4 +- .../features/publishing/pages-list.page.ts | 4 +- .../publishing/reschedule-event.dialog.html | 12 +- .../publishing/reschedule-event.dialog.ts | 4 +- .../app/features/reports/reports.page.html | 14 +- .../app/features/reports/reports.page.spec.ts | 4 +- .../src/app/features/reports/reports.page.ts | 4 +- .../app/features/settings/settings.page.ts | 4 +- .../taxonomies/resource-categories.page.html | 20 +- .../resource-categories.page.spec.ts | 4 +- .../taxonomies/resource-categories.page.ts | 4 +- .../resource-category-form.dialog.html | 20 +- .../resource-category-form.dialog.ts | 4 +- .../taxonomies/topic-form.dialog.html | 26 +- .../features/taxonomies/topic-form.dialog.ts | 4 +- .../app/features/taxonomies/topics.page.html | 22 +- .../features/taxonomies/topics.page.spec.ts | 4 +- .../app/features/taxonomies/topics.page.ts | 4 +- .../translations/translations.page.ts | 4 +- .../locale-switcher.component.html | 4 +- .../locale-switcher.component.spec.ts | 8 +- .../locale-switcher.component.ts | 8 +- .../src/app/profile/profile.page.spec.ts | 4 +- .../admin-cms/src/app/profile/profile.page.ts | 4 +- .../web-portal/src/app/app.component.spec.ts | 4 +- .../apps/web-portal/src/app/app.config.ts | 30 +- .../service-rating-dialog.component.html | 12 +- .../service-rating-dialog.component.spec.ts | 4 +- .../service-rating-dialog.component.ts | 4 +- .../core/layout/filter-rail.component.spec.ts | 4 +- .../app/core/layout/filter-rail.component.ts | 4 +- .../src/app/core/layout/footer.component.html | 10 +- .../src/app/core/layout/footer.component.ts | 4 +- .../src/app/core/layout/header.component.html | 26 +- .../src/app/core/layout/header.component.ts | 4 +- .../layout/portal-shell.component.spec.ts | 4 +- .../app/core/layout/portal-shell.component.ts | 4 +- .../core/layout/search-box.component.spec.ts | 4 +- .../app/core/layout/search-box.component.ts | 4 +- .../src/app/core/translate-loader.factory.ts | 14 +- .../features/account/expert-request.page.html | 24 +- .../account/expert-request.page.spec.ts | 4 +- .../features/account/expert-request.page.ts | 4 +- .../src/app/features/account/login.page.ts | 4 +- .../app/features/account/profile.page.html | 40 +- .../app/features/account/profile.page.spec.ts | 4 +- .../src/app/features/account/profile.page.ts | 4 +- .../features/account/register.page.spec.ts | 4 +- .../src/app/features/account/register.page.ts | 4 +- .../features/assistant/assistant.dialog.ts | 4 +- .../features/assistant/assistant.page.html | 6 +- .../features/assistant/assistant.page.spec.ts | 4 +- .../app/features/assistant/assistant.page.ts | 4 +- .../thread/citation-chip.component.spec.ts | 4 +- .../thread/citation-chip.component.ts | 4 +- .../thread/compose-box.component.html | 14 +- .../thread/compose-box.component.spec.ts | 4 +- .../assistant/thread/compose-box.component.ts | 4 +- .../thread/message-bubble.component.html | 12 +- .../thread/message-bubble.component.spec.ts | 4 +- .../thread/message-bubble.component.ts | 4 +- .../thread/message-list.component.html | 2 +- .../thread/message-list.component.spec.ts | 4 +- .../thread/message-list.component.ts | 4 +- .../compose-post-dialog.component.html | 14 +- .../compose-post-dialog.component.spec.ts | 4 +- .../compose-post-dialog.component.ts | 4 +- .../compose-reply-form.component.html | 10 +- .../compose-reply-form.component.spec.ts | 4 +- .../community/compose-reply-form.component.ts | 4 +- .../like-dislike-control.component.ts | 4 +- .../community/mark-answer-button.component.ts | 4 +- .../features/community/post-detail.page.html | 38 +- .../community/post-detail.page.spec.ts | 4 +- .../features/community/post-detail.page.ts | 4 +- .../community/post-summary.component.ts | 4 +- .../rate-post-control.component.html | 2 +- .../rate-post-control.component.spec.ts | 6 +- .../community/rate-post-control.component.ts | 4 +- .../features/community/reply.component.html | 10 +- .../app/features/community/reply.component.ts | 4 +- .../community/sign-in-cta.component.spec.ts | 4 +- .../community/sign-in-cta.component.ts | 4 +- .../community/topic-card.component.ts | 4 +- .../features/community/topic-detail.page.html | 24 +- .../community/topic-detail.page.spec.ts | 4 +- .../features/community/topic-detail.page.ts | 4 +- .../features/community/topics-list.page.html | 40 +- .../community/topics-list.page.spec.ts | 4 +- .../features/community/topics-list.page.ts | 8 +- .../countries/countries-grid.page.html | 30 +- .../countries/countries-grid.page.spec.ts | 4 +- .../features/countries/countries-grid.page.ts | 4 +- .../countries/country-card.component.ts | 4 +- .../countries/country-detail.page.html | 22 +- .../countries/country-detail.page.spec.ts | 4 +- .../features/countries/country-detail.page.ts | 4 +- .../countries/kapsarc-snapshot.component.ts | 4 +- .../features/events/event-card.component.ts | 4 +- .../features/events/event-detail.page.html | 42 +- .../features/events/event-detail.page.spec.ts | 4 +- .../app/features/events/event-detail.page.ts | 14 +- .../app/features/events/events-list.page.html | 62 +- .../features/events/events-list.page.spec.ts | 4 +- .../app/features/events/events-list.page.ts | 16 +- .../app/features/follows/follows.page.html | 12 +- .../app/features/follows/follows.page.spec.ts | 4 +- .../src/app/features/follows/follows.page.ts | 4 +- .../src/app/features/home/home.page.html | 78 +-- .../src/app/features/home/home.page.spec.ts | 4 +- .../src/app/features/home/home.page.ts | 4 +- .../builder/confirm-dialog.component.html | 8 +- .../builder/confirm-dialog.component.spec.ts | 4 +- .../builder/confirm-dialog.component.ts | 4 +- .../environmental-factors.component.html | 20 +- .../environmental-factors.component.ts | 4 +- .../save-scenario-dialog.component.html | 10 +- .../save-scenario-dialog.component.spec.ts | 4 +- .../builder/save-scenario-dialog.component.ts | 4 +- .../saved-scenarios-drawer.component.html | 20 +- .../saved-scenarios-drawer.component.spec.ts | 4 +- .../saved-scenarios-drawer.component.ts | 4 +- .../builder/scenario-header.component.html | 10 +- .../builder/scenario-header.component.spec.ts | 4 +- .../builder/scenario-header.component.ts | 4 +- .../builder/selected-list.component.html | 12 +- .../builder/selected-list.component.spec.ts | 4 +- .../builder/selected-list.component.ts | 4 +- .../builder/technology-catalog.component.html | 14 +- .../technology-catalog.component.spec.ts | 4 +- .../builder/technology-catalog.component.ts | 4 +- .../builder/totals-bar.component.html | 28 +- .../builder/totals-bar.component.spec.ts | 4 +- .../builder/totals-bar.component.ts | 4 +- .../scenario-builder.page.html | 10 +- .../scenario-builder.page.spec.ts | 4 +- .../interactive-city/scenario-builder.page.ts | 18 +- .../categories-tree.component.html | 2 +- .../categories-tree.component.spec.ts | 4 +- .../categories-tree.component.ts | 4 +- .../resource-card.component.ts | 4 +- .../resource-detail.page.html | 16 +- .../resource-detail.page.spec.ts | 4 +- .../knowledge-center/resource-detail.page.ts | 4 +- .../knowledge-center/resources-list.page.html | 18 +- .../resources-list.page.spec.ts | 4 +- .../knowledge-center/resources-list.page.ts | 4 +- .../knowledge-maps-list.page.html | 28 +- .../knowledge-maps-list.page.spec.ts | 4 +- .../knowledge-maps-list.page.ts | 4 +- .../knowledge-maps/map-viewer.page.html | 30 +- .../knowledge-maps/map-viewer.page.spec.ts | 4 +- .../knowledge-maps/map-viewer.page.ts | 4 +- .../viewer/export-menu.component.html | 4 +- .../viewer/export-menu.component.spec.ts | 4 +- .../viewer/export-menu.component.ts | 4 +- .../viewer/graph-canvas.component.html | 40 +- .../viewer/graph-canvas.component.ts | 4 +- .../viewer/list-view.component.html | 18 +- .../viewer/list-view.component.spec.ts | 4 +- .../viewer/list-view.component.ts | 4 +- .../viewer/node-detail-panel.component.html | 14 +- .../node-detail-panel.component.spec.ts | 4 +- .../viewer/node-detail-panel.component.ts | 4 +- .../viewer/search-and-filters.component.html | 8 +- .../search-and-filters.component.spec.ts | 4 +- .../viewer/search-and-filters.component.ts | 4 +- .../viewer/tabs-bar.component.html | 4 +- .../viewer/tabs-bar.component.spec.ts | 4 +- .../viewer/tabs-bar.component.ts | 4 +- .../app/features/news/news-card.component.ts | 4 +- .../app/features/news/news-detail.page.html | 8 +- .../features/news/news-detail.page.spec.ts | 4 +- .../src/app/features/news/news-detail.page.ts | 4 +- .../src/app/features/news/news-list.page.html | 52 +- .../app/features/news/news-list.page.spec.ts | 4 +- .../src/app/features/news/news-list.page.ts | 14 +- .../notification-row.component.ts | 4 +- .../notifications-drawer.component.html | 12 +- .../notifications-drawer.component.spec.ts | 4 +- .../notifications-drawer.component.ts | 4 +- .../notifications/notifications-page.page.ts | 4 +- .../app/features/pages/static-page.page.html | 4 +- .../features/pages/static-page.page.spec.ts | 4 +- .../app/features/pages/static-page.page.ts | 4 +- .../features/search/search-hit.component.ts | 4 +- .../features/search/search-results.page.html | 22 +- .../search/search-results.page.spec.ts | 4 +- .../features/search/search-results.page.ts | 4 +- .../app/features/world-map/world-map.page.ts | 4 +- .../src/app/health/health.page.html | 12 +- .../web-portal/src/app/health/health.page.ts | 4 +- .../locale-switcher.component.html | 4 +- .../locale-switcher.component.spec.ts | 8 +- .../locale-switcher.component.ts | 8 +- .../lib/feedback/confirm-dialog.component.ts | 4 +- .../src/lib/feedback/toast.service.spec.ts | 4 +- .../ui-kit/src/lib/feedback/toast.service.ts | 6 +- .../paged-table/paged-table.component.html | 2 +- .../paged-table/paged-table.component.spec.ts | 4 +- .../lib/paged-table/paged-table.component.ts | 4 +- frontend/package.json | 4 +- frontend/pnpm-lock.yaml | 600 ++++++++++++++++-- 288 files changed, 1875 insertions(+), 1360 deletions(-) diff --git a/frontend/apps/admin-cms/src/app/app.component.spec.ts b/frontend/apps/admin-cms/src/app/app.component.spec.ts index 24938939..96f5ed17 100644 --- a/frontend/apps/admin-cms/src/app/app.component.spec.ts +++ b/frontend/apps/admin-cms/src/app/app.component.spec.ts @@ -3,7 +3,7 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { provideRouter } from '@angular/router'; import { provideNoopAnimations } from '@angular/platform-browser/animations'; -import { TranslateModule } from '@ngx-translate/core'; +import { TranslocoModule } from '@jsverse/transloco'; import { OidcSecurityService } from 'angular-auth-oidc-client'; import { of } from 'rxjs'; import { LocaleService } from '@frontend/i18n'; @@ -13,7 +13,7 @@ import { AppComponent } from './app.component'; describe('AppComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [AppComponent, TranslateModule.forRoot()], + imports: [AppComponent, TranslocoModule.forRoot()], providers: [ provideHttpClient(), provideHttpClientTesting(), diff --git a/frontend/apps/admin-cms/src/app/app.config.ts b/frontend/apps/admin-cms/src/app/app.config.ts index 11916594..58245331 100644 --- a/frontend/apps/admin-cms/src/app/app.config.ts +++ b/frontend/apps/admin-cms/src/app/app.config.ts @@ -2,18 +2,17 @@ import { provideHttpClient, withFetch, withInterceptors, HttpClient } from '@ang import { authInterceptor } from './core/http/auth.interceptor'; import { serverErrorInterceptor } from './core/http/server-error.interceptor'; import { correlationIdInterceptor } from './core/http/correlation-id.interceptor'; -import { ApplicationConfig, provideAppInitializer, provideZoneChangeDetection, inject } from '@angular/core'; +import { ApplicationConfig, provideAppInitializer, provideZoneChangeDetection, inject, isDevMode } from '@angular/core'; import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; import { provideRouter } from '@angular/router'; -import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core'; +import { provideTransloco, TranslocoService } from '@jsverse/transloco'; import { provideAuth } from 'angular-auth-oidc-client'; -import { firstValueFrom } from 'rxjs'; import { LocaleService } from '@frontend/i18n'; import { buildCceOidcConfig } from '@frontend/auth'; import { appRoutes } from './app.routes'; import { AuthService } from './core/auth/auth.service'; import { EnvService } from './core/env.service'; -import { ngxTranslateHttpLoaderFactory } from './core/translate-loader.factory'; +import { TranslocoHttpLoader } from './core/translate-loader.factory'; export const appConfig: ApplicationConfig = { providers: [ @@ -24,16 +23,14 @@ export const appConfig: ApplicationConfig = { withInterceptors([correlationIdInterceptor, authInterceptor, serverErrorInterceptor]), ), provideAnimationsAsync(), - ...(TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useFactory: ngxTranslateHttpLoaderFactory, - deps: [HttpClient], + provideTransloco({ + config: { + availableLangs: ['en', 'ar'], + defaultLang: 'ar', + prodMode: !isDevMode(), }, - defaultLanguage: 'ar', - }).providers ?? []), - // OIDC config is built dynamically AFTER env.json loads, so provideAuth uses a placeholder - // here and we re-configure it inside provideAppInitializer once env is available. + loader: TranslocoHttpLoader + }), provideAuth({ config: buildCceOidcConfig({ authority: 'http://localhost:8080/realms/cce-internal', @@ -48,17 +45,11 @@ export const appConfig: ApplicationConfig = { }), provideAppInitializer(async () => { const env = inject(EnvService); - const translate = inject(TranslateService); + const translate = inject(TranslocoService); const locale = inject(LocaleService); const auth = inject(AuthService); await env.load(); - translate.setDefaultLang('ar'); - await firstValueFrom(translate.use(locale.locale())); - // Bootstrap user + permissions. Without this the side-nav stays - // empty (every nav item is gated by *ccePermission, and with - // currentUser = null every check fails). AuthService.refresh() - // tries /api/me first, then falls back to deriving the user - // and permissions from the cce-dev-role cookie. + translate.setActiveLang(locale.locale()); await auth.refresh(); }), ], diff --git a/frontend/apps/admin-cms/src/app/auth-callback/auth-callback.page.ts b/frontend/apps/admin-cms/src/app/auth-callback/auth-callback.page.ts index 71788785..570bfcf2 100644 --- a/frontend/apps/admin-cms/src/app/auth-callback/auth-callback.page.ts +++ b/frontend/apps/admin-cms/src/app/auth-callback/auth-callback.page.ts @@ -1,6 +1,6 @@ import { CommonModule } from '@angular/common'; import { ChangeDetectionStrategy, Component } from '@angular/core'; -import { TranslateModule } from '@ngx-translate/core'; +import { TranslocoModule } from '@jsverse/transloco'; /** * Public landing route for the OIDC redirect URI configured in @@ -17,7 +17,7 @@ import { TranslateModule } from '@ngx-translate/core'; @Component({ selector: 'cce-auth-callback', standalone: true, - imports: [CommonModule, TranslateModule], + imports: [CommonModule, TranslocoModule], template: `

{{ 'common.loading' | translate }}

diff --git a/frontend/apps/admin-cms/src/app/auth-toolbar/auth-toolbar.component.html b/frontend/apps/admin-cms/src/app/auth-toolbar/auth-toolbar.component.html index d9455099..87ce5624 100644 --- a/frontend/apps/admin-cms/src/app/auth-toolbar/auth-toolbar.component.html +++ b/frontend/apps/admin-cms/src/app/auth-toolbar/auth-toolbar.component.html @@ -4,10 +4,10 @@ {{ displayLabel() }} } @else { } diff --git a/frontend/apps/admin-cms/src/app/auth-toolbar/auth-toolbar.component.spec.ts b/frontend/apps/admin-cms/src/app/auth-toolbar/auth-toolbar.component.spec.ts index 3446bac4..dd348ca9 100644 --- a/frontend/apps/admin-cms/src/app/auth-toolbar/auth-toolbar.component.spec.ts +++ b/frontend/apps/admin-cms/src/app/auth-toolbar/auth-toolbar.component.spec.ts @@ -1,5 +1,5 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { TranslateModule } from '@ngx-translate/core'; +import { TranslocoModule } from '@jsverse/transloco'; import { OidcSecurityService } from 'angular-auth-oidc-client'; import { of } from 'rxjs'; import { AuthToolbarComponent } from './auth-toolbar.component'; @@ -15,7 +15,7 @@ describe('AuthToolbarComponent', () => { logoff: jest.fn().mockReturnValue(of({})), } as unknown as jest.Mocked>; await TestBed.configureTestingModule({ - imports: [AuthToolbarComponent, TranslateModule.forRoot()], + imports: [AuthToolbarComponent, TranslocoModule.forRoot()], providers: [ { provide: OidcSecurityService, diff --git a/frontend/apps/admin-cms/src/app/auth-toolbar/auth-toolbar.component.ts b/frontend/apps/admin-cms/src/app/auth-toolbar/auth-toolbar.component.ts index 2c46838d..745af6de 100644 --- a/frontend/apps/admin-cms/src/app/auth-toolbar/auth-toolbar.component.ts +++ b/frontend/apps/admin-cms/src/app/auth-toolbar/auth-toolbar.component.ts @@ -1,7 +1,7 @@ import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { CommonModule } from '@angular/common'; import { MatButtonModule } from '@angular/material/button'; -import { TranslateModule } from '@ngx-translate/core'; +import { TranslocoModule } from '@jsverse/transloco'; import { DevAuthService } from '../core/auth/dev-auth.service'; /** @@ -14,7 +14,7 @@ import { DevAuthService } from '../core/auth/dev-auth.service'; @Component({ selector: 'cce-auth-toolbar', standalone: true, - imports: [CommonModule, MatButtonModule, TranslateModule], + imports: [CommonModule, MatButtonModule, TranslocoModule], templateUrl: './auth-toolbar.component.html', styleUrl: './auth-toolbar.component.scss', changeDetection: ChangeDetectionStrategy.OnPush, diff --git a/frontend/apps/admin-cms/src/app/core/http/server-error.interceptor.ts b/frontend/apps/admin-cms/src/app/core/http/server-error.interceptor.ts index cd43b5d3..0b08bcbf 100644 --- a/frontend/apps/admin-cms/src/app/core/http/server-error.interceptor.ts +++ b/frontend/apps/admin-cms/src/app/core/http/server-error.interceptor.ts @@ -5,7 +5,7 @@ import { ToastService } from '@frontend/ui-kit'; /** * Lazy-resolve ToastService only when an error fires. Eager `inject(ToastService)` - * at the top of the interceptor pulls in TranslateService via ToastService's + * at the top of the interceptor pulls in TranslocoService via ToastService's * dependency chain, which transitively needs HttpClient (TranslateLoader factory). * If the very first HTTP request is the env.json bootstrap fetch, that creates * a circular DI on `ToastService` mid-request. Resolving the toast lazily inside diff --git a/frontend/apps/admin-cms/src/app/core/layout/shell.component.spec.ts b/frontend/apps/admin-cms/src/app/core/layout/shell.component.spec.ts index e11b3aab..87f2ea1c 100644 --- a/frontend/apps/admin-cms/src/app/core/layout/shell.component.spec.ts +++ b/frontend/apps/admin-cms/src/app/core/layout/shell.component.spec.ts @@ -1,7 +1,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { provideRouter } from '@angular/router'; import { provideNoopAnimations } from '@angular/platform-browser/animations'; -import { TranslateModule } from '@ngx-translate/core'; +import { TranslocoModule } from '@jsverse/transloco'; import { OidcSecurityService } from 'angular-auth-oidc-client'; import { of } from 'rxjs'; import { LocaleService } from '@frontend/i18n'; @@ -25,7 +25,7 @@ describe('ShellComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ShellComponent, TranslateModule.forRoot()], + imports: [ShellComponent, TranslocoModule.forRoot()], providers: [ provideRouter([]), provideNoopAnimations(), diff --git a/frontend/apps/admin-cms/src/app/core/layout/shell.component.ts b/frontend/apps/admin-cms/src/app/core/layout/shell.component.ts index 7ce5639b..cfd96a82 100644 --- a/frontend/apps/admin-cms/src/app/core/layout/shell.component.ts +++ b/frontend/apps/admin-cms/src/app/core/layout/shell.component.ts @@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; import { CommonModule } from '@angular/common'; import { RouterOutlet } from '@angular/router'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { TranslateModule, TranslateService } from '@ngx-translate/core'; +import { TranslocoModule, TranslocoService } from '@jsverse/transloco'; import { AppShellComponent } from '@frontend/ui-kit'; import { LocaleSwitcherComponent } from '../../locale-switcher/locale-switcher.component'; import { AuthToolbarComponent } from '../../auth-toolbar/auth-toolbar.component'; @@ -19,13 +19,13 @@ import { SideNavComponent } from './side-nav.component'; SideNavComponent, LocaleSwitcherComponent, AuthToolbarComponent, - TranslateModule, + TranslocoModule, ], templateUrl: './shell.component.html', styleUrl: './shell.component.scss', changeDetection: ChangeDetectionStrategy.OnPush, }) export class ShellComponent { - private readonly translate = inject(TranslateService); - readonly title = this.translate.instant('common.appName') || 'CCE Admin'; + private readonly translate = inject(TranslocoService); + readonly title = this.translate.translate('common.appName') || 'CCE Admin'; } diff --git a/frontend/apps/admin-cms/src/app/core/layout/side-nav.component.html b/frontend/apps/admin-cms/src/app/core/layout/side-nav.component.html index c294f69f..9743629c 100644 --- a/frontend/apps/admin-cms/src/app/core/layout/side-nav.component.html +++ b/frontend/apps/admin-cms/src/app/core/layout/side-nav.component.html @@ -6,12 +6,12 @@
-