Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Use new primeng i18n api

Chocobozzz8e0a2f2a05df
diff --git a/client/src/app/+videos/+video-edit/shared/i18n-primeng-calendar.service.ts b/client/src/app/+videos/+video-edit/shared/i18n-primeng-calendar.service.ts
index 2acbace48d..6ef4dbc68d 100644
--- a/client/src/app/+videos/+video-edit/shared/i18n-primeng-calendar.service.ts
+++ b/client/src/app/+videos/+video-edit/shared/i18n-primeng-calendar.service.ts
@@ -1,12 +1,12 @@
import { Injectable } from '@angular/core'
+import { PrimeNGConfig } from 'primeng/api'
@Injectable()
export class I18nPrimengCalendarService {
private readonly calendarLocale: any = {}
- constructor () {
- this.calendarLocale = {
- firstDayOfWeek: 0,
+ constructor (private config: PrimeNGConfig) {
+ this.config.setTranslation({
dayNames: [
$localize`Sunday`,
$localize`Monday`,
@@ -70,7 +70,7 @@ export class I18nPrimengCalendarService {
today: $localize`Today`,
clear: $localize`Clear`
- }
+ })
}
getCalendarLocale () {
diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.html b/client/src/app/+videos/+video-edit/shared/video-edit.component.html
index 4747cec27c..0c60ec4ec5 100644
--- a/client/src/app/+videos/+video-edit/shared/video-edit.component.html
+++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.html
@@ -117,7 +117,7 @@
<label i18n for="schedulePublicationAt">Schedule publication ({{ calendarTimezone }})</label>
<p-calendar
id="schedulePublicationAt" formControlName="schedulePublicationAt" [dateFormat]="calendarDateFormat"
- [locale]="calendarLocale" [minDate]="minScheduledDate" [showTime]="true" [hideOnDateTimeSelect]="true"
+ [firstDayOfWeek]="0" [minDate]="minScheduledDate" [showTime]="true" [hideOnDateTimeSelect]="true"
>
</p-calendar>
@@ -299,8 +299,8 @@
</ng-template>
</my-help>
<p-calendar
- id="originallyPublishedAt" formControlName="originallyPublishedAt" [dateFormat]="calendarDateFormat"
- [locale]="calendarLocale" [showTime]="true" [hideOnDateTimeSelect]="true" [monthNavigator]="true" [yearNavigator]="true" [yearRange]="myYearRange"
+ id="originallyPublishedAt" formControlName="originallyPublishedAt" [dateFormat]="calendarDateFormat" [firstDayOfWeek]="0"
+ [showTime]="true" [hideOnDateTimeSelect]="true" [monthNavigator]="true" [yearNavigator]="true" [yearRange]="myYearRange"
>
</p-calendar>