WEB-76: Fix incentive condition labels and translations (#3014)

Co-authored-by: Parth Sharma <parthsharma@Parths-MacBook-Air.local>
This commit is contained in:
parth-sharma-10
2026-01-22 22:34:50 -06:00
committed by GitHub
co-authored by Parth Sharma
parent 40d3584ed6
commit ee6e4c2699
16 changed files with 149 additions and 30 deletions
@@ -0,0 +1,37 @@
/**
* Copyright since 2025 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
import { Injectable, inject } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
@Injectable({
providedIn: 'root'
})
export class ConditionLabelService {
private translateService = inject(TranslateService);
getConditionLabel(value: string): string {
switch (value?.toLowerCase()) {
case 'lessthan':
return this.translateService.instant('labels.conditions.LessThan');
case 'equal':
return this.translateService.instant('labels.conditions.Equal');
case 'greterthan':
return this.translateService.instant('labels.conditions.GreaterThan');
case 'notequal':
case 'not_equal':
return this.translateService.instant('labels.conditions.NotEqual');
default:
return value;
}
}
}