Skip to content

Commit

Permalink
feat: move logic to translation files (#99165)
Browse files Browse the repository at this point in the history
  • Loading branch information
skoch-intershop committed Sep 25, 2024
1 parent 0a1a5ad commit d4ec641
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
<ng-template #BudgetPriceTypeInfo>
<span
data-testing-id="BudgetPriceTypeInfoTestingID"
[ishServerHtml]="
(
'account.organization.budget_price_type.info'
| translate
: {
'0':
(customer$ | async).budgetPriceType === 'gross'
? ('account.costcenter.gross.label' | translate | lowercase)
: ('account.costcenter.net.label' | translate | lowercase)
}
'account.organization.budget_price_type.info' | translate : { type: (customer$ | async).budgetPriceType }
).concat(additionalText | translate)
"
>
</span
></ng-template>
<a [ngbPopover]="BudgetPriceTypeInfo" placement="right">
<a [ngbPopover]="BudgetPriceTypeInfo" data-testing-id="BudgetPriceTypeInfoTestingID" placement="right">
<fa-icon [icon]="['fas', 'info-circle']" />
</a>
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap';
import { MockComponent } from 'ng-mocks';
import { instance, mock } from 'ts-mockito';

Expand All @@ -15,8 +14,7 @@ describe('Budget Info Component', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [NgbPopoverModule],
declarations: [BudgetInfoComponent, MockComponent(FaIconComponent)],
declarations: [MockComponent(FaIconComponent)],
providers: [{ provide: AccountFacade, useFactory: () => instance(mock(AccountFacade)) }],
}).compileComponents();
});
Expand All @@ -31,5 +29,6 @@ describe('Budget Info Component', () => {
expect(component).toBeTruthy();
expect(element).toBeTruthy();
expect(() => fixture.detectChanges()).not.toThrow();
expect(element.querySelector('[data-testing-id=BudgetPriceTypeInfoTestingID]')).toBeTruthy();
});
});
2 changes: 1 addition & 1 deletion src/assets/i18n/de_DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
"account.ordertemplates.widget.heading": "Meine Bestellvorlagen",
"account.ordertemplates.widget.view_all.link": "Alle Bestellvorlagen ansehen",
"account.organization.budget_price_type.admin.info": "<br /> Sie können diese <a href=\"route://account/profile/company\">Einstellung</a> jederzeit ändern.",
"account.organization.budget_price_type.info": "Budgets werden in <b>{{0}}</b> berechnet.",
"account.organization.budget_price_type.info": "Budgets werden in <b>{{type, select, =net{netto} =gross{butto}}}</b> berechnet.",
"account.organization.budget_price_type.suffix.info": "<br /> Der Konto-Administrator kann diese Einstellung jederzeit ändern.",
"account.organization.cost_center_management": "Kostenstellenverwaltung",
"account.organization.cost_center_management.back_to_list": "Zurück zur Kostenstellenverwaltung",
Expand Down
2 changes: 1 addition & 1 deletion src/assets/i18n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
"account.ordertemplates.widget.heading": "My order templates",
"account.ordertemplates.widget.view_all.link": "View all order templates",
"account.organization.budget_price_type.admin.info": "<br /> You can change this <a href=\"route://account/profile/company\">setting</a> at any time.",
"account.organization.budget_price_type.info": "Budgets are calculated in: <b>{{0}}</b>.",
"account.organization.budget_price_type.info": "Budgets are calculated in: <b>{{type, select, =net{net} =gross{gross}}}</b>.",
"account.organization.budget_price_type.suffix.info": "<br /> The account admin can change this setting at any time.",
"account.organization.cost_center_management": "Cost center management",
"account.organization.cost_center_management.back_to_list": "Back to cost center management",
Expand Down
2 changes: 1 addition & 1 deletion src/assets/i18n/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
"account.ordertemplates.widget.heading": "Mes modèles de commande",
"account.ordertemplates.widget.view_all.link": "Afficher tous les modèles de commande",
"account.organization.budget_price_type.admin.info": "<br /> Vous pouvez modifier ce <a href=\"route://account/profile/company\">paramètre</a> à tout moment.",
"account.organization.budget_price_type.info": "Les budgets sont calculés en : <b>{{0}}</b>.",
"account.organization.budget_price_type.info": "Les budgets sont calculés en : <b>{{type, select, =net{net} =gross{brut}}}</b>.",
"account.organization.budget_price_type.suffix.info": "<br /> L’administrateur du compte peut modifier ce paramètre à tout moment.",
"account.organization.cost_center_management": "Gestion des centres de coûts",
"account.organization.cost_center_management.back_to_list": "Retourner à la gestion des centres de coûts",
Expand Down

0 comments on commit d4ec641

Please sign in to comment.