Skip to content

Commit

Permalink
fix: fix prefix and translations and lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
anninowak committed Mar 28, 2024
1 parent 8ad66d8 commit bb5d7f1
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 20 deletions.
4 changes: 2 additions & 2 deletions libs/angular-accelerator/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@
"A_MINUTE_AGO": "vor einer Minute",
"A_MONAT_AGO": "vor einem Monat",
"A_YEAR_AGO": "vor einem Jahr",
"DAYS_AGO": "vor {{Tage}} Tagen",
"HOURS_AGO": "vor {{Stunden}} Stunden",
"DAYS_AGO": "vor {{days}} Tagen",
"HOURS_AGO": "vor {{hours}} Stunden",
"MINUTES_AGO": "vor {{minutes}} Minuten",
"MONTHS_AGO": "vor {{months}} Monaten",
"YEARS_AGO": "vor {{years}} Jahren"
Expand Down
2 changes: 1 addition & 1 deletion libs/angular-accelerator/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"VERTICAL_BAR": "Switch to vertical bar chart"
}
},
"TRANSLATEPIPE": {
"OCX_TIMEAGO": {
"A_DAY_AGO": "a day ago",
"A_FEW_SECONDS_AGO": "a few seconds ago",
"AN_HOUR_AGO": "an hour ago",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommonModule } from '@angular/common'
import { CUSTOM_ELEMENTS_SCHEMA, LOCALE_ID, NgModule, importProvidersFrom } from '@angular/core'
import { CUSTOM_ELEMENTS_SCHEMA, LOCALE_ID, NgModule } from '@angular/core'
import { FormsModule, ReactiveFormsModule } from '@angular/forms'
import { RouterModule } from '@angular/router'
import { HttpClient } from '@angular/common/http'
Expand All @@ -10,7 +10,6 @@ import {
TranslateModule,
} from '@ngx-translate/core'


import { AppStateService, UserService } from '@onecx/angular-integration-interface'

import { AngularAcceleratorPrimeNgModule } from './angular-accelerator-primeng.module'
Expand Down
7 changes: 4 additions & 3 deletions libs/angular-accelerator/src/lib/pipes/ocxtimeago.pipe.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { ChangeDetectorRef, NgZone, OnDestroy, Pipe } from '@angular/core'
import { ChangeDetectorRef, NgZone, OnDestroy, Pipe, PipeTransform } from '@angular/core'
import { TranslatePipe, TranslateService } from '@ngx-translate/core'

@Pipe({
name: 'timeago',
})
export class OcxTimeAgoPipe extends TranslatePipe implements OnDestroy {
// eslint-disable-next-line @angular-eslint/use-pipe-transform-interface
export class OcxTimeAgoPipe extends TranslatePipe implements OnDestroy, PipeTransform {
private timer: number | undefined | null
constructor(
private changeDetectorRef: ChangeDetectorRef,
Expand Down Expand Up @@ -58,7 +59,7 @@ export class OcxTimeAgoPipe extends TranslatePipe implements OnDestroy {
} else {
translationKey = 'YEARS_AGO'
}
return super.transform('TRANSLATEPIPE.' + translationKey, { minutes, hours, days, months, years })
return super.transform('OCX_TIMEAGO.' + translationKey, { minutes, hours, days, months, years })
}
override ngOnDestroy(): void {
this.removeTimer()
Expand Down
24 changes: 12 additions & 12 deletions libs/portal-integration-angular/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,17 @@
"VERTICAL_BAR": "Zu vertikalem Balkendiagramm wechseln"
}
},
"TRANSLATEPIPE": {
"A_DAY_AGO": "a day ago",
"A_FEW_SECONDS_AGO": "a few seconds ago",
"AN_HOUR_AGO": "an hour ago",
"A_MINUTE_AGO": "a minute ago",
"A_MONTH_AGO": "a month ago",
"A_YEAR_AGO": "a year ago",
"DAYS_AGO": "{{days}} days ago",
"HOURS_AGO": "{{hours}} hours ago",
"MINUTES_AGO": "{{minutes}} minutes ago",
"MONTHS_AGO": "{{months}} months ago",
"YEARS_AGO": "{{years}} years ago"
"OCX_TIMEAGO": {
"A_DAY_AGO": "vor einem Tag",
"A_FEW_SECONDS_AGO": "vor ein paar Sekunden",
"AN_HOUR_AGO": "vor einer Stunde",
"A_MINUTE_AGO": "vor einer Minute",
"A_MONAT_AGO": "vor einem Monat",
"A_YEAR_AGO": "vor einem Jahr",
"DAYS_AGO": "vor {{days}} Tagen",
"HOURS_AGO": "vor {{hours}} Stunden",
"MINUTES_AGO": "vor {{minutes}} Minuten",
"MONTHS_AGO": "vor {{months}} Monaten",
"YEARS_AGO": "vor {{years}} Jahren"
}
}
13 changes: 13 additions & 0 deletions libs/portal-integration-angular/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,18 @@
"HORIZONTAL_BAR": "Switch to horizontal bar chart",
"VERTICAL_BAR": "Switch to vertical bar chart"
}
},
"OCX_TIMEAGO": {
"A_DAY_AGO": "a day ago",
"A_FEW_SECONDS_AGO": "a few seconds ago",
"AN_HOUR_AGO": "an hour ago",
"A_MINUTE_AGO": "a minute ago",
"A_MONTH_AGO": "a month ago",
"A_YEAR_AGO": "a year ago",
"DAYS_AGO": "{{days}} days ago",
"HOURS_AGO": "{{hours}} hours ago",
"MINUTES_AGO": "{{minutes}} minutes ago",
"MONTHS_AGO": "{{months}} months ago",
"YEARS_AGO": "{{years}} years ago"
}
}

0 comments on commit bb5d7f1

Please sign in to comment.