Skip to content

Translate calendar - #2359

Open
Yago004 wants to merge 4 commits into
UPC:mainfrom
Yago004:translate/calendar
Open

Translate calendar#2359
Yago004 wants to merge 4 commits into
UPC:mainfrom
Yago004:translate/calendar

Conversation

@Yago004

@Yago004 Yago004 commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Translated Schedule page, its calendar and the booking date selector (day names, months...).
Also added translation of a few more frases.

Yago004 added 3 commits July 24, 2026 10:18
Added translations for date selector inside booking

issue UPC#2320

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends Ravada’s i18n support on the Schedule/Bookings UI by propagating the user’s language into the page (<html lang>), Angular datepicker locale data, and the FullCalendar/Moment locale configuration, and by adding a few missing translation strings.

Changes:

  • Set the Schedule/Bookings page HTML lang attribute and use it to drive Moment/FullCalendar locale selection.
  • Load AngularJS angular-i18n locale data dynamically based on the active language.
  • Add/extend translation strings and localize a few UI labels (e.g., LDAP groups header, datepicker button texts).

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
templates/ng-templates/booking/calendar.html.ep Adds lang attribute to the Bookings calendar page HTML root.
templates/main/machine_access_group.html.ep Localizes “LDAP groups” header.
templates/bootstrap/scripts.html.ep Loads AngularJS locale file dynamically; adds locale include to fallback branch too.
templates/booking/formEvent.component.html.ep Localizes datepicker button labels for one datepicker instance.
public/js/booking/calendar.component.js Uses document language to set FullCalendar locale and Moment week settings; adjusts calendar height.
public/js/booking/booking.module.js Sets angular-moment locale from document language at module startup.
lib/Ravada/I18N/messages.pot Adds new msgids for newly localized strings.
lib/Ravada/I18N/es.po Adds Spanish translations for new strings.
lib/Ravada/I18N/en.po Adds English translations for new strings.
lib/Ravada/I18N/ca.po Adds Catalan translations for new strings.
Comments suppressed due to low confidence (1)

templates/bootstrap/scripts.html.ep:40

  • The locale script fallback uses 'es' even though the app I18N plugin default is 'en' (script/rvd_front: plugin I18N => {... default => 'en'}). Defaulting to Spanish here can load the wrong Angular locale when no language is set.
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-i18n/1.8.2/angular-locale_<%= stash('language') || (stash('i18n') ? stash('i18n')->{language} : 'es') %>.js"></script>

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html ng-app="ravada.app">
<html ng-app="ravada.app" lang="<%= stash('language') || (stash('i18n') ? stash('i18n')->{language} : 'es') %>">
Comment thread templates/bootstrap/scripts.html.ep Outdated
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-i18n/1.8.2/angular-locale_<%= stash('language') || (stash('i18n') ? stash('i18n')->{language} : 'es') %>.js"></script>
Comment on lines 39 to +41
<script src="/fallback/angular-1.8.2/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-i18n/1.8.2/angular-locale_<%= stash('language') || (stash('i18n') ? stash('i18n')->{language} : 'es') %>.js"></script>

Comment thread public/js/booking/booking.module.js Outdated
Comment on lines +24 to +27
.run( amMoment => {
const lang = document.documentElement.lang || 'en';
amMoment.changeLocale(lang);
});
Comment thread public/js/booking/calendar.component.js Outdated

function calendarCtrl($element, $window, apiBookings,$uibModal,moment,apiEntry) {
const self = this;
const lang = document.documentElement.lang || 'en';
ng-change="$ctrl.updateDates()"
is-open="$ctrl.cal.ini_opened"
ng-required="true" close-text="Close"/>
ng-required="true" current-text="<%=l 'Today' %>" clear-text="<%=l 'Clear' %>" close-text="<%=l 'Close' %>"/>
Comment thread lib/Ravada/I18N/es.po Outdated
msgstr "disponible"

msgid "There are no machines that match the selection"
msgstr "No hay máquinas que coincidan con la seleción"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants