Translate calendar - #2359
Open
Yago004 wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
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
langattribute and use it to drive Moment/FullCalendar locale selection. - Load AngularJS
angular-i18nlocale 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') %>"> | |||
| <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 on lines
+24
to
+27
| .run( amMoment => { | ||
| const lang = document.documentElement.lang || 'en'; | ||
| amMoment.changeLocale(lang); | ||
| }); |
|
|
||
| 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' %>"/> |
| msgstr "disponible" | ||
|
|
||
| msgid "There are no machines that match the selection" | ||
| msgstr "No hay máquinas que coincidan con la seleción" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Translated Schedule page, its calendar and the booking date selector (day names, months...).
Also added translation of a few more frases.