-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from StatCan/32-angular-ngx-translate
feat: Angular ngx translate
- Loading branch information
Showing
29 changed files
with
543 additions
and
158 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
import { Component } from "@angular/core"; | ||
import {TranslateService} from "@ngx-translate/core"; | ||
|
||
@Component({ | ||
selector: "app-root", | ||
templateUrl: "./app.component.html", | ||
styleUrls: ["./app.component.scss"] | ||
}) | ||
export class AppComponent { | ||
constructor(private translate: TranslateService) { | ||
const currentLanguage = this.translate.getBrowserLang(); | ||
const lang = currentLanguage.match(/en|fr/) ? currentLanguage : "en"; | ||
translate.setDefaultLang(lang); | ||
} | ||
title = "Volumes"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 13 additions & 10 deletions
23
frontend/src/app/main-table/cost-table/cost-table.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,30 @@ | ||
<div class="card mat-elevation-z2 mat-typography"> | ||
<div class="header"> | ||
<mat-icon>attach_money</mat-icon> | ||
<p>Cost</p> | ||
<p>{{ "costTable.title" | translate }}</p> | ||
</div> | ||
|
||
<p> | ||
Estimated cost per day of notebook server resources – summed values may not | ||
match total due to rounding | ||
{{ "costTable.txtCost" | translate }} | ||
</p> | ||
|
||
<mat-divider></mat-divider> | ||
<table style="width: auto"> | ||
<tr class="mat-header-row" style="text-align: left;"> | ||
<th class="mat-header-cell">Compute</th> | ||
<th class="mat-header-cell">GPUs</th> | ||
<th class="mat-header-cell">Storage</th> | ||
<th class="mat-header-cell" width="99%">Total</th> | ||
<tr class="mat-header-row" style="text-align: left"> | ||
<th class="mat-header-cell">{{ "costTable.thCompute" | translate }}</th> | ||
<th class="mat-header-cell">{{ "costTable.thGpus" | translate }}</th> | ||
<th class="mat-header-cell">{{ "costTable.thStorage" | translate }}</th> | ||
<th class="mat-header-cell" width="99%"> | ||
{{ "costTable.thTotal" | translate }} | ||
</th> | ||
</tr> | ||
<tr *ngIf="aggregatedCost?.data[currNamespace]; let cost" class="mat-row" style="text-align: left;"> | ||
<td class="mat-cell">{{ formatCost(cost.cpuCost + cost.ramCost) }}</td> | ||
<td class="mat-cell">{{ formatCost(cost.gpuCost) }}</td> | ||
<td class="mat-cell">{{ formatCost(cost.pvCost) }}</td> | ||
<td class="mat-cell" style="font-weight: 500;">{{ formatCost(cost.totalCost) }}</td> | ||
<td class="mat-cell" style="font-weight: 500;"> | ||
{{ formatCost(cost.totalCost) }} | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.