Skip to content

Commit

Permalink
Scrobble events is now localized
Browse files Browse the repository at this point in the history
  • Loading branch information
majora2007 committed Aug 5, 2023
1 parent 154eefd commit 4eb847e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion UI/Web/src/app/_models/chapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export interface Chapter {
pagesRead: number; // Attached for the given user when requesting from API
isSpecial: boolean;
title: string;
created: string;
//created: string;
createdUtc: string;
/**
* Actual name of the Chapter if populated in underlying metadata
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

<ng-container *ngIf="totalPages > 0">
<div class="col-auto mb-2">
<app-icon-and-title [label]="t('length-title')" [clickable]="false" fontClasses="fa-regular fa-file-lines" [title]="t('pages-title')">
<app-icon-and-title [label]="t('length-title')" [clickable]="false" fontClasses="fa-regular fa-file-lines">
{{t('pages-count', {num: totalPages | compactNumber})}}
</app-icon-and-title>
</div>
Expand All @@ -60,11 +60,11 @@
</div>
</ng-container>

<ng-container *ngIf="showExtendedProperties && chapter.created && chapter.created !== '' && (chapter.created | date: 'shortDate') !== '1/1/01'">
<ng-container *ngIf="showExtendedProperties && chapter.createdUtc && chapter.createdUtc !== '' && (chapter.createdUtc | date: 'shortDate') !== '1/1/01'">
<div class="vr d-none d-lg-block m-2"></div>
<div class="col-auto">
<app-icon-and-title [label]="t('date-added-title')" [clickable]="false" fontClasses="fa-solid fa-file-import" [title]="t('date-added-title')">
{{chapter.created | date:'short' | defaultDate}}
{{chapter.createdUtc | translocoDate: {dateStyle: 'short', timeStyle: 'short' } | defaultDate}}
</app-icon-and-title>
</div>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ import {NgbTooltip} from "@ng-bootstrap/ng-bootstrap";
import {MetadataDetailComponent} from "../../series-detail/_components/metadata-detail/metadata-detail.component";
import {FilterQueryParam} from "../../shared/_services/filter-utilities.service";
import {TranslocoModule} from "@ngneat/transloco";
import {TranslocoLocaleModule} from "@ngneat/transloco-locale";

@Component({
selector: 'app-entity-info-cards',
standalone: true,
imports: [CommonModule, IconAndTitleComponent, SafeHtmlPipe, DefaultDatePipe, BytesPipe, CompactNumberPipe, AgeRatingPipe, NgbTooltip, MetadataDetailComponent, TranslocoModule, CompactNumberPipe],
imports: [CommonModule, IconAndTitleComponent, SafeHtmlPipe, DefaultDatePipe, BytesPipe, CompactNumberPipe, AgeRatingPipe, NgbTooltip, MetadataDetailComponent, TranslocoModule, CompactNumberPipe, TranslocoLocaleModule],
templateUrl: './entity-info-cards.component.html',
styleUrls: ['./entity-info-cards.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
Expand Down
3 changes: 2 additions & 1 deletion UI/Web/src/assets/langs/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,7 @@
"length-title": "Length",
"pages-count": "{{num}} Pages",
"words-count": "{{num}} Words",

"reading-time-title": "Read Time",
"date-added-title": "Date Added",
"size-title": "Size",
Expand All @@ -952,7 +953,7 @@
"range-hours": "{{value}} {{hourWord}}",
"hour": "Hour",
"hours": "Hours",
"read-time-title": "{{series-info-cards.read-time-title}}"
"read-time-title": "{{series-info-cards.read-time-title}}",
},

"series-info-cards": {
Expand Down

0 comments on commit 4eb847e

Please sign in to comment.