diff --git a/UI/Web/src/app/statistics/_components/top-readers/top-readers.component.html b/UI/Web/src/app/statistics/_components/top-readers/top-readers.component.html index 0a66a05e9d..40be7112e0 100644 --- a/UI/Web/src/app/statistics/_components/top-readers/top-readers.component.html +++ b/UI/Web/src/app/statistics/_components/top-readers/top-readers.component.html @@ -1,35 +1,38 @@ -
+ +
-

Top Readers

+

{{t('title')}}

-
-
- - -
-
+
+
+ + +
+
-
+
- +
-
-
- {{user.username}} -
-
    -
  • Comics: {{user.comicsTime}} hrs
  • -
  • Manga: {{user.mangaTime}} hrs
  • -
  • Books: {{user.booksTime}} hrs
  • -
+
+
+ {{user.username}}
+
    +
  • {{t('comics-label', {value: user.comicsTime})}}
  • +
  • {{t('manga-label', {value: user.mangaTime})}}
  • +
  • {{t('books-label', {value: user.booksTime})}}
  • +
+
- + + + diff --git a/UI/Web/src/app/statistics/_components/top-readers/top-readers.component.ts b/UI/Web/src/app/statistics/_components/top-readers/top-readers.component.ts index a9d97d1410..07c77b068b 100644 --- a/UI/Web/src/app/statistics/_components/top-readers/top-readers.component.ts +++ b/UI/Web/src/app/statistics/_components/top-readers/top-readers.component.ts @@ -13,8 +13,15 @@ import { StatisticsService } from 'src/app/_services/statistics.service'; import { TopUserRead } from '../../_models/top-reads'; import {takeUntilDestroyed} from "@angular/core/rxjs-interop"; import { NgFor, AsyncPipe } from '@angular/common'; +import {TranslocoModule} from "@ngneat/transloco"; -export const TimePeriods: Array<{title: string, value: number}> = [{title: 'This Week', value: new Date().getDay() || 1}, {title: 'Last 7 Days', value: 7}, {title: 'Last 30 Days', value: 30}, {title: 'Last 90 Days', value: 90}, {title: 'Last Year', value: 365}, {title: 'All Time', value: 0}]; +export const TimePeriods: Array<{title: string, value: number}> = + [{title: 'this-week', value: new Date().getDay() || 1}, + {title: 'last-7-days', value: 7}, + {title: 'last-30-days', value: 30}, + {title: 'last-90-days', value: 90}, + {title: 'last-year', value: 365}, + {title: 'all-time', value: 0}]; @Component({ selector: 'app-top-readers', @@ -22,7 +29,7 @@ export const TimePeriods: Array<{title: string, value: number}> = [{title: 'This styleUrls: ['./top-readers.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, - imports: [ReactiveFormsModule, NgFor, AsyncPipe] + imports: [ReactiveFormsModule, NgFor, AsyncPipe, TranslocoModule] }) export class TopReadersComponent implements OnInit { diff --git a/UI/Web/src/assets/langs/en.json b/UI/Web/src/assets/langs/en.json index 3b8c591449..1858a60b38 100644 --- a/UI/Web/src/assets/langs/en.json +++ b/UI/Web/src/assets/langs/en.json @@ -316,6 +316,31 @@ "read-percentage": "% Read" }, + "top-readers": { + "title": "Top Readers", + "time-selection-label": "Timeframe", + "comics-label": "Comics: {{value}} hrs", + "manga-label": "Manga: {{value}} hrs", + "books-label": "Books: {{value}} hrs", + + "this-week": "{{time-periods.this-week}}", + "last-7-days": "{{time-periods.last-7-days}}", + "last-30-days": "{{time-periods.last-30-days}}", + "last-90-days": "{{time-periods.last-90-days}}", + "last-year": "{{time-periods.last-year}}", + "all-time": "{{time-periods.all-time}}" + }, + + "time-periods": { + "this-week": "This Week", + "last-7-days": "Last 7 Days", + "last-30-days": "Last 30 Days", + "last-90-days": "Last 90 Days", + "last-year": "Last Year", + "all-time": "All Time" + + }, + "validation": { "required-field": "This field is required", "valid-email": "This must be a valid email"