Browse Source

fix(admin-ui): Fix translation of breadcrumbs

Michael Bromley 7 years ago
parent
commit
b82935d0d0

+ 2 - 2
admin-ui/src/app/app.module.ts

@@ -3,7 +3,7 @@ import { NgModule } from '@angular/core';
 import { BrowserModule } from '@angular/platform-browser';
 import { BrowserModule } from '@angular/platform-browser';
 import { RouterModule } from '@angular/router';
 import { RouterModule } from '@angular/router';
 import { TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-translate/core';
 import { TranslateCompiler, TranslateLoader, TranslateModule } from '@ngx-translate/core';
-import { TranslateMessageFormatDebugCompiler } from 'ngx-translate-messageformat-compiler';
+import { TranslateMessageFormatCompiler } from 'ngx-translate-messageformat-compiler';
 import { AppComponent } from './app.component';
 import { AppComponent } from './app.component';
 import { routes } from './app.routes';
 import { routes } from './app.routes';
 import { CoreModule } from './core/core.module';
 import { CoreModule } from './core/core.module';
@@ -28,7 +28,7 @@ export function HttpLoaderFactory(http: HttpClient) {
                 useFactory: HttpLoaderFactory,
                 useFactory: HttpLoaderFactory,
                 deps: [HttpClient],
                 deps: [HttpClient],
             },
             },
-            compiler: { provide: TranslateCompiler, useClass: TranslateMessageFormatDebugCompiler },
+            compiler: { provide: TranslateCompiler, useClass: TranslateMessageFormatCompiler },
         }),
         }),
         CoreModule,
         CoreModule,
     ],
     ],

+ 1 - 1
admin-ui/src/app/catalog/catalog.routes.ts

@@ -11,7 +11,7 @@ export const catalogRoutes: Route[] = [
         path: 'products',
         path: 'products',
         component: ProductListComponent,
         component: ProductListComponent,
         data: {
         data: {
-            breadcrumb: 'Products',
+            breadcrumb: _('breadcrumb.products'),
         },
         },
     },
     },
     {
     {

+ 2 - 2
admin-ui/src/app/core/components/breadcrumb/breadcrumb.component.html

@@ -1,8 +1,8 @@
 <nav role="navigation">
 <nav role="navigation">
     <ul class="breadcrumbs">
     <ul class="breadcrumbs">
         <li *ngFor="let breadcrumb of breadcrumbs$ | async; let isLast = last">
         <li *ngFor="let breadcrumb of breadcrumbs$ | async; let isLast = last">
-            <a [routerLink]="breadcrumb.link" *ngIf="!isLast">{{ breadcrumb.label }}</a>
-            <ng-container *ngIf="isLast">{{ breadcrumb.label }}</ng-container>
+            <a [routerLink]="breadcrumb.link" *ngIf="!isLast">{{ breadcrumb.label | translate }}</a>
+            <ng-container *ngIf="isLast">{{ breadcrumb.label | translate }}</ng-container>
         </li>
         </li>
     </ul>
     </ul>
 </nav>
 </nav>