Skip to content

Commit 7f6c844

Browse files
committed
Fixing more translations.
1 parent a21835a commit 7f6c844

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-planning-actions/workday-entity/workday-entity-dialog.component.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -497,12 +497,12 @@ export class WorkdayEntityDialogComponent implements OnInit {
497497

498498
if (!start || !stop) {
499499
if (!start) {
500-
setError(startControl, 'required', 'Start time is required');
500+
setError(startControl, 'required', this.translateService.instant('Start time is required'));
501501
} else {
502502
removeError(startControl, 'required');
503503
}
504504
if (!stop) {
505-
setError(stopControl, 'required', 'Stop time is required');
505+
setError(stopControl, 'required', this.translateService.instant('Stop time is required'));
506506
} else {
507507
removeError(stopControl, 'required');
508508
}
@@ -511,8 +511,8 @@ export class WorkdayEntityDialogComponent implements OnInit {
511511

512512
// Validate same start/stop
513513
if (startMin === stopMin && (startMin !== 0 && stopMin !== 0)) {
514-
setError(startControl, 'sameStartStop', 'Start and Stop cannot be the same');
515-
setError(stopControl, 'sameStartStop', 'Start and Stop cannot be the same');
514+
setError(startControl, 'sameStartStop', this.translateService.instant('Start and Stop cannot be the same'));
515+
setError(stopControl, 'sameStartStop', this.translateService.instant('Start and Stop cannot be the same'));
516516
} else {
517517
removeError(startControl, 'sameStartStop');
518518
removeError(stopControl, 'sameStartStop');
@@ -527,15 +527,15 @@ export class WorkdayEntityDialogComponent implements OnInit {
527527

528528
// Stop before start
529529
if (stopMin !== 0 && stopMin < startMin) {
530-
setError(stopControl, 'invalidRange', 'Stop time cannot be before start time');
530+
setError(stopControl, 'invalidRange', this.translateService.instant('Stop time cannot be before start time'));
531531
} else {
532532
removeError(stopControl, 'invalidRange');
533533
}
534534

535535
// Break time validation
536536
if (breakMin !== null) {
537537
if (breakMin < 0) {
538-
setError(breakControl, 'negativeBreak', 'Break cannot be negative');
538+
setError(breakControl, 'negativeBreak', this.translateService.instant('Break cannot be negative'));
539539
} else {
540540
removeError(breakControl, 'negativeBreak');
541541
}
@@ -544,21 +544,20 @@ export class WorkdayEntityDialogComponent implements OnInit {
544544
setError(
545545
breakControl,
546546
'breakTooLong',
547-
'Break cannot be equal or longer than shift duration',
548-
);
547+
this.translateService.instant('Break cannot be equal or longer than shift duration'),);
549548
} else {
550549
removeError(breakControl, 'breakTooLong');
551550
}
552551
}
553552

554553
if (duration > 24 * 60) {
555-
setError(group, 'shiftTooLong', 'Shift duration cannot exceed 24 hours');
554+
setError(group, 'shiftTooLong', this.translateService.instant('Shift duration cannot exceed 24 hours'));
556555
} else {
557556
removeError(group, 'shiftTooLong');
558557
}
559558

560559
if (breakMin && breakMin >= duration) {
561-
setError(breakControl, 'invalidBreak', 'Break must be shorter than shift duration');
560+
setError(breakControl, 'invalidBreak', this.translateService.instant('Break must be shorter than shift duration'));
562561
} else {
563562
removeError(breakControl, 'invalidBreak');
564563
}

0 commit comments

Comments
 (0)