Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix calender translations

Oliver Günther46ac2be1727e
diff --git a/frontend/src/app/core/setup/init-vendors.ts b/frontend/src/app/core/setup/init-vendors.ts
index 393d44b4416..2d00ece3084 100644
--- a/frontend/src/app/core/setup/init-vendors.ts
+++ b/frontend/src/app/core/setup/init-vendors.ts
@@ -67,6 +67,3 @@ require('@openproject/primer-view-components/app/assets/javascripts/primer_view_
require('expose-loader?URI!urijs');
require('urijs/src/URITemplate');
-
-// Localization for fullcalendar
-require('@fullcalendar/core/locales-all');
diff --git a/frontend/src/app/features/calendar/op-work-packages-calendar.service.ts b/frontend/src/app/features/calendar/op-work-packages-calendar.service.ts
index 750153b6bc4..2a854e746d6 100644
--- a/frontend/src/app/features/calendar/op-work-packages-calendar.service.ts
+++ b/frontend/src/app/features/calendar/op-work-packages-calendar.service.ts
@@ -61,6 +61,7 @@ import { OpCalendarService } from 'core-app/features/calendar/op-calendar.servic
import { WeekdayService } from 'core-app/core/days/weekday.service';
import { IDay } from 'core-app/core/state/days/day.model';
import { DayResourceService } from 'core-app/core/state/days/day.service';
+import allLocales from '@fullcalendar/core/locales-all';
export interface CalendarViewEvent {
el:HTMLElement;
@@ -341,6 +342,7 @@ export class OpWorkPackagesCalendarService extends UntilDestroyedMixin {
private defaultOptions():CalendarOptionsWithDayGrid {
return {
editable: false,
+ locales: allLocales,
locale: this.I18n.locale,
fixedWeekCount: false,
firstDay: this.configuration.startOfWeek(),
diff --git a/frontend/src/app/features/calendar/te-calendar/te-calendar.component.ts b/frontend/src/app/features/calendar/te-calendar/te-calendar.component.ts
index 89ddff84c6a..6216191458f 100644
--- a/frontend/src/app/features/calendar/te-calendar/te-calendar.component.ts
+++ b/frontend/src/app/features/calendar/te-calendar/te-calendar.component.ts
@@ -34,7 +34,9 @@ import { ConfigurationService } from 'core-app/core/config/configuration.service
import { TimeEntryResource } from 'core-app/features/hal/resources/time-entry-resource';
import { CollectionResource } from 'core-app/features/hal/resources/collection-resource';
import interactionPlugin from '@fullcalendar/interaction';
-import { HalResourceEditingService } from 'core-app/shared/components/fields/edit/services/hal-resource-editing.service';
+import {
+ HalResourceEditingService,
+} from 'core-app/shared/components/fields/edit/services/hal-resource-editing.service';
import { TimeEntryEditService } from 'core-app/shared/components/time_entries/edit/edit.service';
import { TimeEntryCreateService } from 'core-app/shared/components/time_entries/create/create.service';
import { ColorsService } from 'core-app/shared/components/colors/colors.service';
@@ -50,10 +52,11 @@ import { SchemaResource } from 'core-app/features/hal/resources/schema-resource'
import { IFieldSchema } from 'core-app/shared/components/fields/field.base';
import { VerboseFormattingArg } from '@fullcalendar/common';
import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';
-import { Subject, firstValueFrom } from 'rxjs';
+import { firstValueFrom, Subject } from 'rxjs';
import { WeekdayService } from 'core-app/core/days/weekday.service';
import { IDay } from 'core-app/core/state/days/day.model';
import { DayResourceService } from 'core-app/core/state/days/day.service';
+import allLocales from '@fullcalendar/core/locales-all';
interface TimeEntrySchema extends SchemaResource {
activity:IFieldSchema;
@@ -138,6 +141,7 @@ export class TimeEntryCalendarComponent {
public additionalOptions:CalendarOptionsWithDayGrid = {
editable: false,
+ locales: allLocales,
locale: this.i18n.locale,
fixedWeekCount: false,
headerToolbar: {
diff --git a/frontend/src/app/features/calendar/wp-calendar/wp-calendar.component.ts b/frontend/src/app/features/calendar/wp-calendar/wp-calendar.component.ts
index 75478483ac7..82becb47249 100644
--- a/frontend/src/app/features/calendar/wp-calendar/wp-calendar.component.ts
+++ b/frontend/src/app/features/calendar/wp-calendar/wp-calendar.component.ts
@@ -77,6 +77,7 @@ import {
addBackgroundEvents,
removeBackgroundEvents,
} from 'core-app/features/team-planner/team-planner/planner/background-events';
+import allLocales from '@fullcalendar/core/locales-all';
@Component({
templateUrl: './wp-calendar.template.html',
@@ -104,6 +105,7 @@ export class WorkPackagesCalendarComponent extends UntilDestroyedMixin implement
text = {
cannot_drag_to_non_working_day: this.I18n.t('js.team_planner.cannot_drag_to_non_working_day'),
+ today: this.I18n.t('js.team_planner.today'),
};
constructor(
@@ -181,6 +183,7 @@ export class WorkPackagesCalendarComponent extends UntilDestroyedMixin implement
private initializeCalendar() {
const additionalOptions:{ [key:string]:unknown } = {
+ locales: allLocales,
locale: this.I18n.locale,
height: '100%',
headerToolbar: this.buildHeader(),
diff --git a/frontend/src/app/features/team-planner/team-planner/planner/team-planner.component.ts b/frontend/src/app/features/team-planner/team-planner/planner/team-planner.component.ts
index 67f85b9fbe9..47e3f0e80fa 100644
--- a/frontend/src/app/features/team-planner/team-planner/planner/team-planner.component.ts
+++ b/frontend/src/app/features/team-planner/team-planner/planner/team-planner.component.ts
@@ -114,6 +114,7 @@ import {
removeBackgroundEvents,
} from 'core-app/features/team-planner/team-planner/planner/background-events';
import * as moment from 'moment-timezone';
+import allLocales from '@fullcalendar/core/locales-all';
export type TeamPlannerViewOptionKey = 'resourceTimelineWorkWeek'|'resourceTimelineWeek'|'resourceTimelineTwoWeeks'|'resourceTimelineFourWeeks'|'resourceTimelineEightWeeks';
export type TeamPlannerViewOptions = { [K in TeamPlannerViewOptionKey]:RawOptionsFromRefiners<Required<ViewOptionRefiners>> };
@@ -483,12 +484,12 @@ export class TeamPlannerComponent extends UntilDestroyedMixin implements OnInit,
.then(() => {
this.calendarOptions$.next(
this.workPackagesCalendar.calendarOptions({
+ locales: allLocales,
locale: this.I18n.locale,
schedulerLicenseKey: 'GPL-My-Project-Is-Open-Source',
selectable: true,
plugins: [resourceTimelinePlugin, interactionPlugin],
titleFormat: { year: 'numeric', month: 'long', day: 'numeric' },
- buttonText: { today: this.text.today },
initialView: this.initialCalendarView,
headerToolbar: {
left: '',
diff --git a/frontend/src/app/shared/components/op-non-working-days-list/op-non-working-days-list.component.ts b/frontend/src/app/shared/components/op-non-working-days-list/op-non-working-days-list.component.ts
index 12877247b8c..0df8f565189 100644
--- a/frontend/src/app/shared/components/op-non-working-days-list/op-non-working-days-list.component.ts
+++ b/frontend/src/app/shared/components/op-non-working-days-list/op-non-working-days-list.component.ts
@@ -27,6 +27,7 @@ import { ConfirmDialogService } from 'core-app/shared/components/modals/confirm-
import { ConfirmDialogOptions } from '../modals/confirm-dialog/confirm-dialog.modal';
import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import * as moment from 'moment-timezone';
+import allLocales from '@fullcalendar/core/locales-all';
export const nonWorkingDaysListSelector = 'op-non-working-days-list';
@@ -75,6 +76,7 @@ export class OpNonWorkingDaysListComponent implements OnInit {
selectedNonWorkingDayName= '';
calendarOptions:CalendarOptions = {
+ locales: allLocales,
locale: this.I18n.locale,
plugins: [listPlugin],
initialView: 'listYear',