From 05b7ce6c7e51f960e50bd5983b22f05a409551f9 Mon Sep 17 00:00:00 2001 From: Florian Dupret <34862846+sephrat@users.noreply.github.com> Date: Tue, 19 Oct 2021 10:13:36 +0200 Subject: [PATCH 01/11] Localize Movie+TV information panel --- .../card/discover-card.component.ts | 9 ++-- .../movie-information-panel.component.html | 32 ++++++------- .../movie-information-panel.component.ts | 14 +++++- .../tv-information-panel.component.html | 22 ++++----- .../tv-information-panel.component.ts | 16 ++++++- src/Ombi/wwwroot/translations/en.json | 45 +++++++++++++------ 6 files changed, 90 insertions(+), 48 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts index 56002c9e9..a39e92858 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts +++ b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts @@ -2,6 +2,7 @@ import { Component, OnInit, Input } from "@angular/core"; import { IDiscoverCardResult } from "../../interfaces"; import { RequestType } from "../../../interfaces"; import { MessageService, RequestService, SearchV2Service } from "../../../services"; +import { TranslateService } from "@ngx-translate/core"; import { MatDialog } from "@angular/material/dialog"; import { ISearchTvResultV2 } from "../../../interfaces/ISearchTvResultV2"; import { ISearchMovieResultV2 } from "../../../interfaces/ISearchMovieResultV2"; @@ -30,7 +31,7 @@ export class DiscoverCardComponent implements OnInit { private tvSearchResult: ISearchTvResultV2; constructor(private searchService: SearchV2Service, private dialog: MatDialog, private requestService: RequestService, - public messageService: MessageService) { } + public messageService: MessageService, private translate: TranslateService) { } public ngOnInit() { if (this.result.type == RequestType.tvShow) { @@ -98,13 +99,13 @@ export class DiscoverCardComponent implements OnInit { public getAvailbilityStatus(): string { if (this.result.available) { - return "Available"; + return this.translate.instant("Common.Available"); } if (this.result.approved) { - return "Approved"; + return this.translate.instant("Common.Approved"); } if (this.result.requested) { - return "Pending"; + return this.translate.instant("Common.Pending"); } return ""; } diff --git a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html index 62908b361..2e88e6edc 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html @@ -17,7 +17,7 @@

- {{'MediaDetails.StreamingOn' | translate }}: + {{'MediaDetails.StreamingOn' | translate }}
@@ -26,11 +26,11 @@

- {{'MediaDetails.Status' | translate }}: - {{movie.status}} + {{'MediaDetails.Status' | translate }} + {{ getMovieStatusLabel()}}
- {{'MediaDetails.Availability' | translate }}: + {{'MediaDetails.Availability' | translate }} {{'Common.Available' | translate}} {{'Common.NotAvailable' | translate}}
@@ -44,23 +44,23 @@
- {{'Requests.RequestedBy' | translate }}: + {{'MediaDetails.RequestedBy' | translate }} {{request.requestedUser.userAlias}}
- {{'Requests.RequestDate' | translate }}: + {{'MediaDetails.RequestDate' | translate }} {{request.requestedDate | date}}
- {{'Requests.DeniedReason' | translate }}: + {{'MediaDetails.DeniedReason' | translate }} {{request.deniedReason}}
- {{'MediaDetails.Quality' | translate }}: + {{'MediaDetails.Quality' | translate }}
{{movie.quality | quality}}
@@ -77,34 +77,34 @@
- {{'MediaDetails.TheatricalRelease' | translate }}: + {{'MediaDetails.TheatricalRelease' | translate }} {{movie.releaseDate | date: 'mediumDate'}}
- {{'MediaDetails.DigitalRelease' | translate }}: + {{'MediaDetails.DigitalRelease' | translate }} {{movie.digitalReleaseDate | date: 'mediumDate'}}
- {{'MediaDetails.Votes' | translate }}: + {{'MediaDetails.Votes' | translate }} {{movie.voteCount | thousandShort: 1}}
- {{'MediaDetails.Runtime' | translate }}: + {{'MediaDetails.Runtime' | translate }} {{'MediaDetails.Minutes' | translate:{runtime: movie.runtime} }}
- {{'MediaDetails.Revenue' | translate }}: + {{'MediaDetails.Revenue' | translate }} {{movie.revenue | currency: 'USD'}}
- {{'MediaDetails.Budget' | translate }}: + {{'MediaDetails.Budget' | translate }} {{movie.budget | currency: 'USD'}}

- {{'MediaDetails.Genres' | translate }}: + {{'MediaDetails.Genres' | translate }}
@@ -116,7 +116,7 @@
- {{'MediaDetails.Keywords' | translate }}: + {{'MediaDetails.Keywords' | translate }} {{keyword.name}} diff --git a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.ts b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.ts index c11a0f61c..174f692de 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.ts +++ b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.ts @@ -1,4 +1,5 @@ import { Component, ViewEncapsulation, Input, OnInit, Inject } from "@angular/core"; +import { TranslateService } from "@ngx-translate/core"; import { ISearchMovieResultV2 } from "../../../../interfaces/ISearchMovieResultV2"; import { IMovieRequests } from "../../../../interfaces"; import { SearchV2Service } from "../../../../services/searchV2.service"; @@ -13,7 +14,8 @@ import { IStreamingData } from "../../../../interfaces/IStreams"; }) export class MovieInformationPanelComponent implements OnInit { - constructor(private searchService: SearchV2Service, @Inject(APP_BASE_HREF) public internalBaseUrl: string) { } + constructor(private searchService: SearchV2Service, @Inject(APP_BASE_HREF) public internalBaseUrl: string, + private translate: TranslateService) { } @Input() public movie: ISearchMovieResultV2; @Input() public request: IMovieRequests; @@ -33,4 +35,14 @@ export class MovieInformationPanelComponent implements OnInit { this.searchService.getMovieStreams(this.movie.id).subscribe(x => this.streams = x); } + + public getMovieStatusLabel() { + const textKey = 'MediaDetails.StatusValues.' + this.movie.status; + const text = this.translate.instant(textKey); + if (text !== textKey) { + return text; + } else { + return this.movie.status; + } + } } diff --git a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html index 1e3fdbcd6..6f7278c6b 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html @@ -11,7 +11,7 @@

- {{'MediaDetails.StreamingOn' | translate }}: + {{'MediaDetails.StreamingOn' | translate }}
@@ -21,44 +21,44 @@

- {{'MediaDetails.Status' | translate }}: - {{tv.status}} + {{'MediaDetails.Status' | translate }} + {{ getTVStatusLabel()}}
- First Aired: + {{'MediaDetails.FirstAired' | translate }} {{tv.firstAired | date: 'mediumDate'}}
- Seasons: + {{'MediaDetails.Seasons' | translate }} {{seasonCount}}
- Episodes: + {{'MediaDetails.Episodes' | translate }} {{totalEpisodes}}
- {{'MediaDetails.RootFolderOverride' | translate }}: + {{'MediaDetails.RootFolderOverride' | translate }}
{{request.rootPathOverrideTitle}}
- {{'MediaDetails.QualityOverride' | translate }}: + {{'MediaDetails.QualityOverride' | translate }}
{{request.qualityOverrideTitle}}
- {{'MediaDetails.Runtime' | translate }}: + {{'MediaDetails.Runtime' | translate }} {{'MediaDetails.Minutes' | translate:{ runtime: tv.runtime} }}
- Network: + {{'MediaDetails.Network' | translate }} {{tv.network.name}}
- {{'MediaDetails.Genres' | translate }}: + {{'MediaDetails.Genres' | translate }}
diff --git a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.ts b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.ts index d5ba5cbd6..46175847f 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.ts +++ b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.ts @@ -1,5 +1,6 @@ import { APP_BASE_HREF } from "@angular/common"; import { Component, ViewEncapsulation, Input, OnInit, Inject } from "@angular/core"; +import { TranslateService } from "@ngx-translate/core"; import { ITvRequests } from "../../../../../interfaces"; import { ITvRatings } from "../../../../../interfaces/IRatings"; import { ISearchTvResultV2 } from "../../../../../interfaces/ISearchTvResultV2"; @@ -14,7 +15,8 @@ import { SearchV2Service } from "../../../../../services"; }) export class TvInformationPanelComponent implements OnInit { - constructor(private searchService: SearchV2Service, @Inject(APP_BASE_HREF) public internalBaseUrl: string) { } + constructor(private searchService: SearchV2Service, @Inject(APP_BASE_HREF) public internalBaseUrl: string, + private translate: TranslateService) { } @Input() public tv: ISearchTvResultV2; @Input() public request: ITvRequests; @@ -43,5 +45,15 @@ export class TvInformationPanelComponent implements OnInit { public sortBy(prop: string) { return this.streams.sort((a, b) => a[prop] > b[prop] ? 1 : a[prop] === b[prop] ? 0 : -1); - } + } + + public getTVStatusLabel() { + const textKey = 'MediaDetails.StatusValues.' + this.tv.status; + const text = this.translate.instant(textKey); + if (text !== textKey) { + return text; + } else { + return this.tv.status; + } + } } diff --git a/src/Ombi/wwwroot/translations/en.json b/src/Ombi/wwwroot/translations/en.json index 67eb312d8..3eecf5a26 100644 --- a/src/Ombi/wwwroot/translations/en.json +++ b/src/Ombi/wwwroot/translations/en.json @@ -14,6 +14,8 @@ "Common": { "ContinueButton": "Continue", "Available": "Available", + "Approved": "Approved", + "Pending": "Pending", "PartiallyAvailable": "Partially Available", "Monitored": "Monitored", "NotAvailable": "Not Available", @@ -269,21 +271,33 @@ "QualityProfilesSelect":"Select A Quality Profile", "RootFolderSelect":"Select A Root Folder", "LanguageProfileSelect":"Select A Language Profile", - "Status":"Status", - "Availability":"Availability", + "Status":"Status:", + "StatusValues" : { + "Planned": "Planned", + "In Production": "In Production", + "Released": "Released", + "Returning Series": "Returning Series", + "Ended": "Ended", + "Canceled": "Canceled" + }, + "Seasons": "Seasons:", + "Episodes": "Episodes:", + "Availability":"Availability:", "RequestStatus":"Request Status", - "Quality":"Quality", - "RootFolderOverride":"Root Folder Override", - "QualityOverride":"Quality Override", - "Genres":"Genres", - "TheatricalRelease":"Release", - "DigitalRelease":"Digital Release", - "Votes":"Votes", - "Runtime":"Runtime", + "Quality":"Quality:", + "RootFolderOverride":"Root Folder Override:", + "QualityOverride":"Quality Override:", + "Network":"Network:", + "Genres":"Genres:", + "FirstAired":"First Aired:", + "TheatricalRelease":"Release:", + "DigitalRelease":"Digital Release:", + "Votes":"Votes:", + "Runtime":"Runtime:", "Minutes": "{{runtime}} Minutes", - "Revenue":"Revenue", - "Budget":"Budget", - "Keywords":"Keywords/Tags", + "Revenue":"Revenue:", + "Budget":"Budget:", + "Keywords":"Keywords/Tags:", "Casts": { "CastTitle": "Cast" }, @@ -297,7 +311,10 @@ "RadarrConfiguration": "Radarr Configuration", "RequestOnBehalf": "Request on behalf of", "PleaseSelectUser": "Please select a user", - "StreamingOn": "Streaming On", + "StreamingOn": "Streaming On:", + "RequestedBy": "Requested By:", + "RequestDate": "Request Date:", + "DeniedReason": "Denied Reason:", "ReProcessRequest": "Re-Process Request" }, "Discovery": { From fa1e711a25cdc6acbfdd0de4bd1d903fa2e5b5f3 Mon Sep 17 00:00:00 2001 From: Florian Dupret <34862846+sephrat@users.noreply.github.com> Date: Tue, 19 Oct 2021 11:14:38 +0200 Subject: [PATCH 02/11] Localize dates --- src/Ombi/ClientApp/src/app/app.module.ts | 33 +++++++++++++++++++ .../details-group.component.html | 2 +- .../movie-information-panel.component.html | 6 ++-- .../tv-information-panel.component.html | 2 +- .../ClientApp/src/app/pipes/LocalizedDate.ts | 16 +++++++++ .../ClientApp/src/app/pipes/pipe.module.ts | 5 +-- .../about/update-dialog.component.html | 2 +- 7 files changed, 58 insertions(+), 8 deletions(-) create mode 100644 src/Ombi/ClientApp/src/app/pipes/LocalizedDate.ts diff --git a/src/Ombi/ClientApp/src/app/app.module.ts b/src/Ombi/ClientApp/src/app/app.module.ts index b4e78087c..d22edbfbc 100644 --- a/src/Ombi/ClientApp/src/app/app.module.ts +++ b/src/Ombi/ClientApp/src/app/app.module.ts @@ -66,6 +66,39 @@ import { TranslateHttpLoader } from "@ngx-translate/http-loader"; import { UnauthorizedInterceptor } from "./auth/unauthorized.interceptor"; import { environment } from "../environments/environment"; +import { registerLocaleData } from '@angular/common'; +// TODO: lazy load locales, probably somewhere in app.component +import localeDa from '@angular/common/locales/da'; +import localeDe from '@angular/common/locales/de'; +import localeEs from '@angular/common/locales/es'; +import localeFr from '@angular/common/locales/fr'; +import localeIt from '@angular/common/locales/it'; +import localeHu from '@angular/common/locales/hu'; +import localeNl from '@angular/common/locales/nl'; +// import localeNo from '@angular/common/locales/no'; +import localePl from '@angular/common/locales/pl'; +import localePt from '@angular/common/locales/pt'; +import localeSk from '@angular/common/locales/sk'; +import localeSv from '@angular/common/locales/sv'; +import localeBg from '@angular/common/locales/bg'; +import localeRu from '@angular/common/locales/ru'; + + +registerLocaleData(localeDa); +registerLocaleData(localeDe); +registerLocaleData(localeEs); +registerLocaleData(localeFr); +registerLocaleData(localeIt); +registerLocaleData(localeHu); +registerLocaleData(localeNl); +// registerLocaleData(localeNo); +registerLocaleData(localePl); +registerLocaleData(localePt); +registerLocaleData(localeSk); +registerLocaleData(localeSv); +registerLocaleData(localeBg); +registerLocaleData(localeRu); + const routes: Routes = [ { path: "*", component: PageNotFoundComponent }, { path: "", redirectTo: "/discover", pathMatch: "full" }, diff --git a/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.html b/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.html index c4906baac..46a77d575 100644 --- a/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.html +++ b/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.html @@ -1,7 +1,7 @@ {{issue.subject}} - {{issue.userReported?.userName}} on {{issue.createdDate | date:short}} + {{issue.userReported?.userName}} on {{issue.createdDate | localizedDate:short}}

diff --git a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html index 2e88e6edc..480e19ddd 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html @@ -50,7 +50,7 @@

{{'MediaDetails.RequestDate' | translate }} - {{request.requestedDate | date}} + {{request.requestedDate | localizedDate}}
@@ -78,11 +78,11 @@
{{'MediaDetails.TheatricalRelease' | translate }} - {{movie.releaseDate | date: 'mediumDate'}} + {{movie.releaseDate | localizedDate: 'mediumDate'}}
{{'MediaDetails.DigitalRelease' | translate }} - {{movie.digitalReleaseDate | date: 'mediumDate'}} + {{movie.digitalReleaseDate | localizedDate: 'mediumDate'}}
diff --git a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html index 6f7278c6b..ddf6fd44c 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html @@ -25,7 +25,7 @@ {{ getTVStatusLabel()}}
{{'MediaDetails.FirstAired' | translate }} - {{tv.firstAired | date: 'mediumDate'}} + {{tv.firstAired | localizedDate: 'mediumDate'}}
diff --git a/src/Ombi/ClientApp/src/app/pipes/LocalizedDate.ts b/src/Ombi/ClientApp/src/app/pipes/LocalizedDate.ts new file mode 100644 index 000000000..ab71fa36d --- /dev/null +++ b/src/Ombi/ClientApp/src/app/pipes/LocalizedDate.ts @@ -0,0 +1,16 @@ +import { DatePipe } from '@angular/common'; +import { Pipe, PipeTransform } from '@angular/core'; +import { TranslateService } from '@ngx-translate/core'; + +@Pipe({ + name: 'localizedDate', + pure: false + }) +export class LocalizedDatePipe implements PipeTransform { + constructor(private translateService: TranslateService) {} + + transform(value: any, pattern: string = 'mediumDate'): any { + const datePipe: DatePipe = new DatePipe(this.translateService.currentLang); + return datePipe.transform(value, pattern); + } +} \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/pipes/pipe.module.ts b/src/Ombi/ClientApp/src/app/pipes/pipe.module.ts index 8e084ec3d..f41924060 100644 --- a/src/Ombi/ClientApp/src/app/pipes/pipe.module.ts +++ b/src/Ombi/ClientApp/src/app/pipes/pipe.module.ts @@ -1,5 +1,6 @@ import { ModuleWithProviders, NgModule } from "@angular/core"; import { HumanizePipe } from "./HumanizePipe"; +import { LocalizedDatePipe } from "./LocalizedDate"; import { ThousandShortPipe } from "./ThousandShortPipe"; import { SafePipe } from "./SafePipe"; import { QualityPipe } from "./QualityPipe"; @@ -7,8 +8,8 @@ import { UserLocalePipe } from "./UserLocalePipe"; @NgModule({ imports: [], - declarations: [HumanizePipe, ThousandShortPipe, SafePipe, QualityPipe, UserLocalePipe], - exports: [HumanizePipe, ThousandShortPipe, SafePipe, QualityPipe, UserLocalePipe], + declarations: [HumanizePipe, ThousandShortPipe, SafePipe, QualityPipe, UserLocalePipe, LocalizedDatePipe ], + exports: [HumanizePipe, ThousandShortPipe, SafePipe, QualityPipe, UserLocalePipe, LocalizedDatePipe ], }) export class PipeModule { diff --git a/src/Ombi/ClientApp/src/app/settings/about/update-dialog.component.html b/src/Ombi/ClientApp/src/app/settings/about/update-dialog.component.html index 77b053e0a..2327f2834 100644 --- a/src/Ombi/ClientApp/src/app/settings/about/update-dialog.component.html +++ b/src/Ombi/ClientApp/src/app/settings/about/update-dialog.component.html @@ -18,7 +18,7 @@
-Updated at {{data.updateDate | date}} +Updated at {{data.updateDate | localizedDate}} From 5ac0aa34e5f0a039792b5b57d9973dc87dbee1a6 Mon Sep 17 00:00:00 2001 From: Florian Dupret <34862846+sephrat@users.noreply.github.com> Date: Tue, 19 Oct 2021 11:55:36 +0200 Subject: [PATCH 03/11] Localize episode request popup --- .../shared/episode-request/episode-request.component.html | 4 ++-- .../shared/episode-request/episode-request.component.ts | 8 +++++--- src/Ombi/wwwroot/translations/en.json | 7 +++++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/shared/episode-request/episode-request.component.html b/src/Ombi/ClientApp/src/app/shared/episode-request/episode-request.component.html index 9c97c73f1..7b31832ea 100644 --- a/src/Ombi/ClientApp/src/app/shared/episode-request/episode-request.component.html +++ b/src/Ombi/ClientApp/src/app/shared/episode-request/episode-request.component.html @@ -20,8 +20,8 @@ - Season {{season.seasonNumber}} - Season {{season.seasonNumber}} + {{ 'MediaDetails.EpisodeSelector.SeasonNumber' | translate: { number: season.seasonNumber } }} + {{ 'MediaDetails.EpisodeSelector.SeasonNumber' | translate: { number: season.seasonNumber } }} diff --git a/src/Ombi/ClientApp/src/app/shared/episode-request/episode-request.component.ts b/src/Ombi/ClientApp/src/app/shared/episode-request/episode-request.component.ts index 146f31269..4f02a74b4 100644 --- a/src/Ombi/ClientApp/src/app/shared/episode-request/episode-request.component.ts +++ b/src/Ombi/ClientApp/src/app/shared/episode-request/episode-request.component.ts @@ -3,6 +3,7 @@ import { MatCheckboxChange } from "@angular/material/checkbox"; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog"; import { ISearchTvResultV2 } from "../../interfaces/ISearchTvResultV2"; import { MessageService } from "../../services"; +import { TranslateService } from "@ngx-translate/core"; import { ISeasonsViewModel, IEpisodesRequests, INewSeasonRequests, ITvRequestViewModelV2, IRequestEngineResult, RequestType } from "../../interfaces"; import { RequestServiceV2 } from "../../services/requestV2.service"; import { AdminRequestDialogComponent } from "../admin-request-dialog/admin-request-dialog.component"; @@ -23,7 +24,8 @@ export class EpisodeRequestComponent { } constructor(public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: EpisodeRequestData, - private requestService: RequestServiceV2, private notificationService: MessageService, private dialog: MatDialog) { } + private requestService: RequestServiceV2, private notificationService: MessageService, private dialog: MatDialog, + private translate: TranslateService) { } public async submitRequests() { @@ -35,7 +37,7 @@ export class EpisodeRequestComponent { }); if (!selected && !this.data.series.requestAll && !this.data.series.firstSeason && !this.data.series.latestSeason) { - this.notificationService.send("You need to select some episodes!", "OK"); + this.notificationService.send(this.translate.instant("Requests.NeedToSelectEpisodes"), "OK"); return; } @@ -123,7 +125,7 @@ export class EpisodeRequestComponent { private postRequest(requestResult: IRequestEngineResult) { if (requestResult.result) { this.notificationService.send( - `Request for ${this.data.series.title} has been added successfully`); + this.translate.instant("Requests.RequestAddedSuccessfully", { title: this.data.series.title })); this.data.series.seasonRequests.forEach((season) => { season.episodes.forEach((ep) => { diff --git a/src/Ombi/wwwroot/translations/en.json b/src/Ombi/wwwroot/translations/en.json index 3eecf5a26..e27d1564d 100644 --- a/src/Ombi/wwwroot/translations/en.json +++ b/src/Ombi/wwwroot/translations/en.json @@ -194,7 +194,9 @@ "ChangeAvailability":"Mark Available", "Deleted": "Successfully deleted selected items", "Approved": "Successfully approved selected items" - } + }, + "NeedToSelectEpisodes": "You need to select some episodes!", + "RequestAddedSuccessfully": "Request for {{title}} has been added successfully" }, "Issues": { "Title": "Issues", @@ -305,7 +307,8 @@ "AllSeasonsTooltip": "This will request every season for this show", "FirstSeasonTooltip": "This will only request the First Season for this show", "LatestSeasonTooltip": "This will only request the Latest Season for this show", - "NoEpisodes": "There unfortunately is no episode data for this show yet!" + "NoEpisodes": "There unfortunately is no episode data for this show yet!", + "SeasonNumber": "Season {{number}}" }, "SonarrConfiguration": "Sonarr Configuration", "RadarrConfiguration": "Radarr Configuration", From 218f5d8716ebc80afb3392d8aede2584efd3174b Mon Sep 17 00:00:00 2001 From: Florian Dupret <34862846+sephrat@users.noreply.github.com> Date: Tue, 19 Oct 2021 13:13:41 +0200 Subject: [PATCH 04/11] Localize collections and movie requests/popups --- .../components/card/discover-card.component.ts | 4 ++-- .../discover-collections.component.html | 3 +-- .../discover-collections.component.ts | 6 ++++-- .../components/movie/movie-details.component.ts | 16 +++++++++------- .../shared/deny-dialog/deny-dialog.component.ts | 6 ++++-- src/Ombi/wwwroot/translations/en.json | 7 +++++++ 6 files changed, 27 insertions(+), 15 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts index a39e92858..0907404a8 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts +++ b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts @@ -130,7 +130,7 @@ export class DiscoverCardComponent implements OnInit { rootFolderOverride: result.radarrFolderId, }).subscribe(x => { if (x.result) { this.result.requested = true; - this.messageService.send(x.message, "Ok"); + this.messageService.send(this.translate.instant("Requests.RequestAddedSuccessfully", { title: this.result.title }), "Ok"); } else { this.messageService.send(x.errorMessage, "Ok"); } @@ -141,7 +141,7 @@ export class DiscoverCardComponent implements OnInit { this.requestService.requestMovie({ theMovieDbId: +this.result.id, languageCode: null, requestOnBehalf: null, qualityPathOverride: null, rootFolderOverride: null }).subscribe(x => { if (x.result) { this.result.requested = true; - this.messageService.send(x.message, "Ok"); + this.messageService.send(this.translate.instant("Requests.RequestAddedSuccessfully", { title: this.result.title }), "Ok"); } else { this.messageService.send(x.errorMessage, "Ok"); } diff --git a/src/Ombi/ClientApp/src/app/discover/components/collections/discover-collections.component.html b/src/Ombi/ClientApp/src/app/discover/components/collections/discover-collections.component.html index 6c892fae6..23a7791f0 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/collections/discover-collections.component.html +++ b/src/Ombi/ClientApp/src/app/discover/components/collections/discover-collections.component.html @@ -7,8 +7,7 @@

{{collection.overview}}

- +
{{ 'Requests.RequestDate' | translate }} {{request.requestedDate | amLocal - | amDateFormat: 'LL'}}
+ | amUserLocale | amDateFormat: 'LL'}}

diff --git a/src/Ombi/ClientApp/src/app/requests/tvrequests.component.html b/src/Ombi/ClientApp/src/app/requests/tvrequests.component.html index 5834e3a23..f1bf5b2f1 100644 --- a/src/Ombi/ClientApp/src/app/requests/tvrequests.component.html +++ b/src/Ombi/ClientApp/src/app/requests/tvrequests.component.html @@ -22,7 +22,7 @@ -
Release Date: {{node.releaseDate | amLocal | amDateFormat: 'LL'}}
+
Release Date: {{node.releaseDate | amLocal | amUserLocale | amDateFormat: 'LL'}}
{{ 'Requests.QualityOverride' | translate }} {{node.qualityOverrideTitle}} diff --git a/src/Ombi/ClientApp/src/app/search/moviesearch.component.html b/src/Ombi/ClientApp/src/app/search/moviesearch.component.html index f6a27677f..77702a6d5 100644 --- a/src/Ombi/ClientApp/src/app/search/moviesearch.component.html +++ b/src/Ombi/ClientApp/src/app/search/moviesearch.component.html @@ -103,7 +103,7 @@ amDateFormat: 'LL'} }} {{ 'Search.DigitalDate' | translate: {date: result.digitalReleaseDate | - amLocal | amDateFormat: 'LL'} }} + amLocal | amUserLocale | amDateFormat: 'LL'} }} From abf0ddf74a9ad5f10951732b2aec160ed942a46c Mon Sep 17 00:00:00 2001 From: Florian Dupret <34862846+sephrat@users.noreply.github.com> Date: Tue, 19 Oct 2021 13:49:27 +0200 Subject: [PATCH 06/11] Refactor status translation into a dedicated pipe --- .../movie-information-panel.component.html | 2 +- .../movie-information-panel.component.ts | 14 +------------- .../tv-information-panel.component.html | 2 +- .../tv-information-panel.component.ts | 14 +------------- .../src/app/pipes/TranslateStatus.ts | 19 +++++++++++++++++++ .../ClientApp/src/app/pipes/pipe.module.ts | 5 +++-- .../movies-grid/movies-grid.component.html | 2 +- .../components/tv-grid/tv-grid.component.html | 2 +- 8 files changed, 28 insertions(+), 32 deletions(-) create mode 100644 src/Ombi/ClientApp/src/app/pipes/TranslateStatus.ts diff --git a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html index 480e19ddd..50070e47e 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html @@ -27,7 +27,7 @@
{{'MediaDetails.Status' | translate }} - {{ getMovieStatusLabel()}} + {{ this.movie.status | translateStatus }}
{{'MediaDetails.Availability' | translate }} diff --git a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.ts b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.ts index 174f692de..c11a0f61c 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.ts +++ b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.ts @@ -1,5 +1,4 @@ import { Component, ViewEncapsulation, Input, OnInit, Inject } from "@angular/core"; -import { TranslateService } from "@ngx-translate/core"; import { ISearchMovieResultV2 } from "../../../../interfaces/ISearchMovieResultV2"; import { IMovieRequests } from "../../../../interfaces"; import { SearchV2Service } from "../../../../services/searchV2.service"; @@ -14,8 +13,7 @@ import { IStreamingData } from "../../../../interfaces/IStreams"; }) export class MovieInformationPanelComponent implements OnInit { - constructor(private searchService: SearchV2Service, @Inject(APP_BASE_HREF) public internalBaseUrl: string, - private translate: TranslateService) { } + constructor(private searchService: SearchV2Service, @Inject(APP_BASE_HREF) public internalBaseUrl: string) { } @Input() public movie: ISearchMovieResultV2; @Input() public request: IMovieRequests; @@ -35,14 +33,4 @@ export class MovieInformationPanelComponent implements OnInit { this.searchService.getMovieStreams(this.movie.id).subscribe(x => this.streams = x); } - - public getMovieStatusLabel() { - const textKey = 'MediaDetails.StatusValues.' + this.movie.status; - const text = this.translate.instant(textKey); - if (text !== textKey) { - return text; - } else { - return this.movie.status; - } - } } diff --git a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html index ddf6fd44c..8fc23d39f 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html @@ -22,7 +22,7 @@
{{'MediaDetails.Status' | translate }} - {{ getTVStatusLabel()}} + {{ this.tv.status | translateStatus }}
{{'MediaDetails.FirstAired' | translate }} {{tv.firstAired | localizedDate: 'mediumDate'}} diff --git a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.ts b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.ts index 46175847f..1ee844967 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.ts +++ b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.ts @@ -1,6 +1,5 @@ import { APP_BASE_HREF } from "@angular/common"; import { Component, ViewEncapsulation, Input, OnInit, Inject } from "@angular/core"; -import { TranslateService } from "@ngx-translate/core"; import { ITvRequests } from "../../../../../interfaces"; import { ITvRatings } from "../../../../../interfaces/IRatings"; import { ISearchTvResultV2 } from "../../../../../interfaces/ISearchTvResultV2"; @@ -15,8 +14,7 @@ import { SearchV2Service } from "../../../../../services"; }) export class TvInformationPanelComponent implements OnInit { - constructor(private searchService: SearchV2Service, @Inject(APP_BASE_HREF) public internalBaseUrl: string, - private translate: TranslateService) { } + constructor(private searchService: SearchV2Service, @Inject(APP_BASE_HREF) public internalBaseUrl: string) { } @Input() public tv: ISearchTvResultV2; @Input() public request: ITvRequests; @@ -46,14 +44,4 @@ export class TvInformationPanelComponent implements OnInit { public sortBy(prop: string) { return this.streams.sort((a, b) => a[prop] > b[prop] ? 1 : a[prop] === b[prop] ? 0 : -1); } - - public getTVStatusLabel() { - const textKey = 'MediaDetails.StatusValues.' + this.tv.status; - const text = this.translate.instant(textKey); - if (text !== textKey) { - return text; - } else { - return this.tv.status; - } - } } diff --git a/src/Ombi/ClientApp/src/app/pipes/TranslateStatus.ts b/src/Ombi/ClientApp/src/app/pipes/TranslateStatus.ts new file mode 100644 index 000000000..1d7ebf1bd --- /dev/null +++ b/src/Ombi/ClientApp/src/app/pipes/TranslateStatus.ts @@ -0,0 +1,19 @@ +import { Pipe, PipeTransform } from '@angular/core'; +import { TranslateService } from '@ngx-translate/core'; + +@Pipe({ + name: 'translateStatus' + }) +export class TranslateStatusPipe implements PipeTransform { + constructor(private translateService: TranslateService) {} + + transform(value: string): string { + const textKey = 'MediaDetails.StatusValues.' + value; + const text = this.translateService.instant(textKey); + if (text !== textKey) { + return text; + } else { + return value; + } + } +} \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/pipes/pipe.module.ts b/src/Ombi/ClientApp/src/app/pipes/pipe.module.ts index f41924060..7a9520af8 100644 --- a/src/Ombi/ClientApp/src/app/pipes/pipe.module.ts +++ b/src/Ombi/ClientApp/src/app/pipes/pipe.module.ts @@ -1,6 +1,7 @@ import { ModuleWithProviders, NgModule } from "@angular/core"; import { HumanizePipe } from "./HumanizePipe"; import { LocalizedDatePipe } from "./LocalizedDate"; +import { TranslateStatusPipe } from "./TranslateStatus"; import { ThousandShortPipe } from "./ThousandShortPipe"; import { SafePipe } from "./SafePipe"; import { QualityPipe } from "./QualityPipe"; @@ -8,8 +9,8 @@ import { UserLocalePipe } from "./UserLocalePipe"; @NgModule({ imports: [], - declarations: [HumanizePipe, ThousandShortPipe, SafePipe, QualityPipe, UserLocalePipe, LocalizedDatePipe ], - exports: [HumanizePipe, ThousandShortPipe, SafePipe, QualityPipe, UserLocalePipe, LocalizedDatePipe ], + declarations: [HumanizePipe, ThousandShortPipe, SafePipe, QualityPipe, UserLocalePipe, LocalizedDatePipe, TranslateStatusPipe ], + exports: [HumanizePipe, ThousandShortPipe, SafePipe, QualityPipe, UserLocalePipe, LocalizedDatePipe, TranslateStatusPipe ], }) export class PipeModule { diff --git a/src/Ombi/ClientApp/src/app/requests-list/components/movies-grid/movies-grid.component.html b/src/Ombi/ClientApp/src/app/requests-list/components/movies-grid/movies-grid.component.html index 0d397b778..0e6e31521 100644 --- a/src/Ombi/ClientApp/src/app/requests-list/components/movies-grid/movies-grid.component.html +++ b/src/Ombi/ClientApp/src/app/requests-list/components/movies-grid/movies-grid.component.html @@ -63,7 +63,7 @@ {{ 'Requests.Status' | translate}} - {{element.status}} + {{element.status |translateStatus }} diff --git a/src/Ombi/ClientApp/src/app/requests-list/components/tv-grid/tv-grid.component.html b/src/Ombi/ClientApp/src/app/requests-list/components/tv-grid/tv-grid.component.html index 4fda46b6c..8cb00d3bb 100644 --- a/src/Ombi/ClientApp/src/app/requests-list/components/tv-grid/tv-grid.component.html +++ b/src/Ombi/ClientApp/src/app/requests-list/components/tv-grid/tv-grid.component.html @@ -56,7 +56,7 @@ {{'Requests.Status' | translate}} - {{element.parentRequest.status}} + {{element.parentRequest.status | translateStatus }} From 907ce4be0fb41227e1769b0a7ad2e1280f27d12a Mon Sep 17 00:00:00 2001 From: Florian Dupret <34862846+sephrat@users.noreply.github.com> Date: Tue, 19 Oct 2021 15:51:45 +0200 Subject: [PATCH 07/11] Refactor localized dates into angular moment --- src/Ombi/ClientApp/src/app/app.module.ts | 33 ------------------- .../details-group.component.html | 2 +- .../movie-information-panel.component.html | 6 ++-- .../tv-information-panel.component.html | 2 +- .../ClientApp/src/app/pipes/LocalizedDate.ts | 16 --------- .../ClientApp/src/app/pipes/pipe.module.ts | 5 ++- .../about/update-dialog.component.html | 2 +- 7 files changed, 8 insertions(+), 58 deletions(-) delete mode 100644 src/Ombi/ClientApp/src/app/pipes/LocalizedDate.ts diff --git a/src/Ombi/ClientApp/src/app/app.module.ts b/src/Ombi/ClientApp/src/app/app.module.ts index d22edbfbc..b4e78087c 100644 --- a/src/Ombi/ClientApp/src/app/app.module.ts +++ b/src/Ombi/ClientApp/src/app/app.module.ts @@ -66,39 +66,6 @@ import { TranslateHttpLoader } from "@ngx-translate/http-loader"; import { UnauthorizedInterceptor } from "./auth/unauthorized.interceptor"; import { environment } from "../environments/environment"; -import { registerLocaleData } from '@angular/common'; -// TODO: lazy load locales, probably somewhere in app.component -import localeDa from '@angular/common/locales/da'; -import localeDe from '@angular/common/locales/de'; -import localeEs from '@angular/common/locales/es'; -import localeFr from '@angular/common/locales/fr'; -import localeIt from '@angular/common/locales/it'; -import localeHu from '@angular/common/locales/hu'; -import localeNl from '@angular/common/locales/nl'; -// import localeNo from '@angular/common/locales/no'; -import localePl from '@angular/common/locales/pl'; -import localePt from '@angular/common/locales/pt'; -import localeSk from '@angular/common/locales/sk'; -import localeSv from '@angular/common/locales/sv'; -import localeBg from '@angular/common/locales/bg'; -import localeRu from '@angular/common/locales/ru'; - - -registerLocaleData(localeDa); -registerLocaleData(localeDe); -registerLocaleData(localeEs); -registerLocaleData(localeFr); -registerLocaleData(localeIt); -registerLocaleData(localeHu); -registerLocaleData(localeNl); -// registerLocaleData(localeNo); -registerLocaleData(localePl); -registerLocaleData(localePt); -registerLocaleData(localeSk); -registerLocaleData(localeSv); -registerLocaleData(localeBg); -registerLocaleData(localeRu); - const routes: Routes = [ { path: "*", component: PageNotFoundComponent }, { path: "", redirectTo: "/discover", pathMatch: "full" }, diff --git a/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.html b/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.html index 46a77d575..315cb86ae 100644 --- a/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.html +++ b/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.html @@ -1,7 +1,7 @@ {{issue.subject}} - {{issue.userReported?.userName}} on {{issue.createdDate | localizedDate:short}} + {{issue.userReported?.userName}} on {{issue.createdDate | amLocal | amUserLocale | amDateFormat: 'LL' }}

diff --git a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html index 50070e47e..6970c913d 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html @@ -50,7 +50,7 @@

{{'MediaDetails.RequestDate' | translate }} - {{request.requestedDate | localizedDate}} + {{request.requestedDate | amUserLocale | amDateFormat: 'LL'}}
@@ -78,11 +78,11 @@
{{'MediaDetails.TheatricalRelease' | translate }} - {{movie.releaseDate | localizedDate: 'mediumDate'}} + {{movie.releaseDate | amUserLocale | amDateFormat: 'LL': 'mediumDate'}}
{{'MediaDetails.DigitalRelease' | translate }} - {{movie.digitalReleaseDate | localizedDate: 'mediumDate'}} + {{movie.digitalReleaseDate | amUserLocale | amDateFormat: 'LL': 'mediumDate'}}
diff --git a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html index 8fc23d39f..dcdf6fe8e 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html @@ -25,7 +25,7 @@ {{ this.tv.status | translateStatus }}
{{'MediaDetails.FirstAired' | translate }} - {{tv.firstAired | localizedDate: 'mediumDate'}} + {{tv.firstAired | amLocal | amUserLocale | amDateFormat: 'LL' }}
diff --git a/src/Ombi/ClientApp/src/app/pipes/LocalizedDate.ts b/src/Ombi/ClientApp/src/app/pipes/LocalizedDate.ts deleted file mode 100644 index ab71fa36d..000000000 --- a/src/Ombi/ClientApp/src/app/pipes/LocalizedDate.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { DatePipe } from '@angular/common'; -import { Pipe, PipeTransform } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; - -@Pipe({ - name: 'localizedDate', - pure: false - }) -export class LocalizedDatePipe implements PipeTransform { - constructor(private translateService: TranslateService) {} - - transform(value: any, pattern: string = 'mediumDate'): any { - const datePipe: DatePipe = new DatePipe(this.translateService.currentLang); - return datePipe.transform(value, pattern); - } -} \ No newline at end of file diff --git a/src/Ombi/ClientApp/src/app/pipes/pipe.module.ts b/src/Ombi/ClientApp/src/app/pipes/pipe.module.ts index 7a9520af8..6f063c91c 100644 --- a/src/Ombi/ClientApp/src/app/pipes/pipe.module.ts +++ b/src/Ombi/ClientApp/src/app/pipes/pipe.module.ts @@ -1,6 +1,5 @@ import { ModuleWithProviders, NgModule } from "@angular/core"; import { HumanizePipe } from "./HumanizePipe"; -import { LocalizedDatePipe } from "./LocalizedDate"; import { TranslateStatusPipe } from "./TranslateStatus"; import { ThousandShortPipe } from "./ThousandShortPipe"; import { SafePipe } from "./SafePipe"; @@ -9,8 +8,8 @@ import { UserLocalePipe } from "./UserLocalePipe"; @NgModule({ imports: [], - declarations: [HumanizePipe, ThousandShortPipe, SafePipe, QualityPipe, UserLocalePipe, LocalizedDatePipe, TranslateStatusPipe ], - exports: [HumanizePipe, ThousandShortPipe, SafePipe, QualityPipe, UserLocalePipe, LocalizedDatePipe, TranslateStatusPipe ], + declarations: [HumanizePipe, ThousandShortPipe, SafePipe, QualityPipe, UserLocalePipe, TranslateStatusPipe ], + exports: [HumanizePipe, ThousandShortPipe, SafePipe, QualityPipe, UserLocalePipe, TranslateStatusPipe ], }) export class PipeModule { diff --git a/src/Ombi/ClientApp/src/app/settings/about/update-dialog.component.html b/src/Ombi/ClientApp/src/app/settings/about/update-dialog.component.html index 2327f2834..5377c463f 100644 --- a/src/Ombi/ClientApp/src/app/settings/about/update-dialog.component.html +++ b/src/Ombi/ClientApp/src/app/settings/about/update-dialog.component.html @@ -18,7 +18,7 @@
-Updated at {{data.updateDate | localizedDate}} +Updated at {{data.updateDate | amUserLocale | amDateFormat: 'LL' }} From 4f6cc120bb31acab6f4eec38d33b46ee29e938b9 Mon Sep 17 00:00:00 2001 From: Florian Dupret <34862846+sephrat@users.noreply.github.com> Date: Tue, 19 Oct 2021 15:52:13 +0200 Subject: [PATCH 08/11] Fix pipes not available in DetailsGroupComponent --- src/Ombi/ClientApp/src/app/shared/shared.module.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Ombi/ClientApp/src/app/shared/shared.module.ts b/src/Ombi/ClientApp/src/app/shared/shared.module.ts index 50dfc4538..01d70f1c6 100644 --- a/src/Ombi/ClientApp/src/app/shared/shared.module.ts +++ b/src/Ombi/ClientApp/src/app/shared/shared.module.ts @@ -38,6 +38,7 @@ import { MatTreeModule } from '@angular/material/tree'; import { MomentModule } from "ngx-moment"; import { NgModule } from "@angular/core"; import { SidebarModule } from "primeng/sidebar"; +import { PipeModule } from "../pipes/pipe.module"; import { TheMovieDbService } from "../services"; import { TranslateModule } from "@ngx-translate/core"; import { TruncateModule } from "@yellowspot/ng-truncate"; @@ -87,6 +88,7 @@ import { WatchProvidersSelectComponent } from "./components/watch-providers-sele MatTreeModule, MatStepperModule, MatSnackBarModule, + PipeModule, ], exports: [ TranslateModule, From 8106097ea3a4140d4925cb73909056883d547c63 Mon Sep 17 00:00:00 2001 From: Florian Dupret <34862846+sephrat@users.noreply.github.com> Date: Tue, 19 Oct 2021 16:03:16 +0200 Subject: [PATCH 09/11] Translate Issue details group --- .../components/details-group/details-group.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.html b/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.html index 315cb86ae..01ddaf75e 100644 --- a/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.html +++ b/src/Ombi/ClientApp/src/app/issues/components/details-group/details-group.component.html @@ -1,7 +1,7 @@ {{issue.subject}} - {{issue.userReported?.userName}} on {{issue.createdDate | amLocal | amUserLocale | amDateFormat: 'LL' }} + {{'Issues.UserOnDate' | translate: { user: issue.userReported?.userName, date: issue.createdDate | amLocal | amUserLocale | amDateFormat: 'LL' } }}

From 496b399d67808c9880f70d2d442aaf82b2bdf16b Mon Sep 17 00:00:00 2001 From: Florian Dupret <34862846+sephrat@users.noreply.github.com> Date: Tue, 19 Oct 2021 16:15:58 +0200 Subject: [PATCH 10/11] Fix minor regressions --- .../movie/panels/movie-information-panel.component.html | 4 ++-- .../tv-information-panel/tv-information-panel.component.html | 2 +- src/Ombi/wwwroot/translations/en.json | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html index 6970c913d..1aafc30bf 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html @@ -27,7 +27,7 @@


{{'MediaDetails.Status' | translate }} - {{ this.movie.status | translateStatus }} + {{ this.movie.status | translateStatus }}
{{'MediaDetails.Availability' | translate }} @@ -45,7 +45,7 @@
{{'MediaDetails.RequestedBy' | translate }} - {{request.requestedUser.userAlias}} + {{request.requestedUser.userAlias}}
diff --git a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html index dcdf6fe8e..9d1d927bd 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/tv/panels/tv-information-panel/tv-information-panel.component.html @@ -22,7 +22,7 @@
{{'MediaDetails.Status' | translate }} - {{ this.tv.status | translateStatus }} + {{ tv.status | translateStatus }}
{{'MediaDetails.FirstAired' | translate }} {{tv.firstAired | amLocal | amUserLocale | amDateFormat: 'LL' }} diff --git a/src/Ombi/wwwroot/translations/en.json b/src/Ombi/wwwroot/translations/en.json index 643f00d37..791ec3285 100644 --- a/src/Ombi/wwwroot/translations/en.json +++ b/src/Ombi/wwwroot/translations/en.json @@ -239,7 +239,8 @@ "Delete": "Delete issue", "DeletedIssue": "Issue has been deleted", "Chat":"Chat", - "Requested":"Requested" + "Requested":"Requested", + "UserOnDate": "{{user}} on {{date}}" }, "Filter": { "ClearFilter": "Clear Filter", From 9191e558925a327063313a1dab59ddbfc7ef8d3f Mon Sep 17 00:00:00 2001 From: Florian Dupret <34862846+sephrat@users.noreply.github.com> Date: Wed, 20 Oct 2021 13:57:20 +0200 Subject: [PATCH 11/11] Localize user preferences --- .../user-preference.component.html | 30 +++++++++++-------- .../user-preference.component.ts | 2 +- src/Ombi/wwwroot/translations/en.json | 21 ++++++++++++- 3 files changed, 38 insertions(+), 15 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.html b/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.html index 7d466d972..6942eb3ad 100644 --- a/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.html +++ b/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.html @@ -7,15 +7,15 @@
- +
- User Type: + {{'UserPreferences.UserType' | translate}}
- {{UserType[user?.userType]}} + {{'UserTypeLabel.' + user?.userType | translate }}
@@ -58,7 +58,7 @@
Get it on Google Play + src="https://play.google.com/intl/{{ selectedLang }}/badges/static/images/badges/{{ selectedLang }}_badge_web_generic.png" />
- +
@@ -75,15 +77,15 @@
- +
-

Change Details

+

{{'UserPreferences.ChangeDetails' | translate}}

- You need your current password to make any changes here + {{'UserPreferences.NeedCurrentPassword' | translate}} - Current Password + {{'UserPreferences.CurrentPassword' | translate}}
@@ -91,7 +93,7 @@
- Email Address + {{'UserPreferences.EmailAddress' | translate}}
@@ -100,7 +102,7 @@
- New Password + {{'UserPreferences.NewPassword' | translate}}
@@ -108,12 +110,14 @@
- New Password Confirm + {{'UserPreferences.NewPasswordConfirm' | translate}}
- +
diff --git a/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.ts b/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.ts index afa2496cf..32ba813cc 100644 --- a/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.ts +++ b/src/Ombi/ClientApp/src/app/user-preferences/components/user-preference/user-preference.component.ts @@ -133,7 +133,7 @@ export class UserPreferenceComponent implements OnInit { currentPassword: values.currentPassword }).subscribe(x => { if (x.successful) { - this.notification.success("Updated your information"); + this.notification.success(this.translate.instant("UserPreferences.UpdatedYourInformation")); this.user.emailAddress = values.emailAddress; } else { this.notification.error(x.errors[0]); diff --git a/src/Ombi/wwwroot/translations/en.json b/src/Ombi/wwwroot/translations/en.json index 791ec3285..959ddaade 100644 --- a/src/Ombi/wwwroot/translations/en.json +++ b/src/Ombi/wwwroot/translations/en.json @@ -35,6 +35,7 @@ }, "Cancel": "Cancel", "Submit": "Submit", + "Update": "Update", "tvShow": "TV Show", "movie": "Movie" }, @@ -361,6 +362,24 @@ "LanguageDescription": "This is the language you would like the Ombi interface to be displayed in.", "MobileQRCode":"Mobile QR Code", "LegacyApp":"Launch Legacy App", - "NoQrCode":"Please contact your administrator to enable QR codes" + "NoQrCode":"Please contact your administrator to enable QR codes", + "UserType": "User Type:", + "ChangeDetails": "Change Details", + "NeedCurrentPassword": "You need your current password to make any changes here", + "CurrentPassword": "Current Password", + "EmailAddress": "Email Address", + "NewPassword": "New Password", + "NewPasswordConfirm": "New Password Confirm", + "Security": "Security", + "Profile": "Profile", + "UpdatedYourInformation": "Updated your information" + }, + "UserTypeLabel": { + "1": "Local User", + "2": "Plex User", + "3": "Emby User", + "4": "Emby Connect User", + "5": "Jellyfin User" } + }