Skip to content

Translate calendar - #2359

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

Yago004 wants to merge 5 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.

Comment thread templates/ng-templates/booking/calendar.html.ep Outdated
Comment thread templates/bootstrap/scripts.html.ep Outdated
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 thread public/js/booking/calendar.component.js Outdated
Comment thread templates/booking/formEvent.component.html.ep
Comment thread lib/Ravada/I18N/es.po Outdated

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.

🟡 Changes recommended

Several supported locale identifiers resolve incorrectly, and fallback mode introduces an external CDN dependency.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

templates/bootstrap/scripts.html.ep:40

  • The fallback branch is intended to serve dependencies from /fallback, but this newly added locale still comes from Cloudflare. On installations using fallback mode because external CDNs are unavailable, the request fails and the datepicker remains in the default locale. Bundle the required AngularJS locale files with the other fallback assets and load the mapped local file here.
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-i18n/1.8.2/angular-locale_<%= stash('language') || (stash('i18n') ? stash('i18n')->{language} : 'en') %>.js"></script>
  • Files reviewed: 10/10 changed files
  • Comments generated: 2
  • Review effort level: Balanced

<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} : 'en') %>.js"></script>
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html ng-app="ravada.app">
<html ng-app="ravada.app" lang="<%= stash('language') || (stash('i18n') ? stash('i18n')->{language} : 'en') %>">
changed some languages identificators

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.

🟡 Changes recommended

Several Angular locale URLs are invalid, fallback mode retains an external dependency, and persisted legacy locale IDs lack migration.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (2)

templates/bootstrap/scripts.html.ep:7

  • The application locale is not always an Angular i18n asset name. Angular 1.8.2 provides ca-es-valencia, nb-no, and zh-cn, but this URL generates ca-valencia, nb-NO, and zh-CN; those requests return no locale module, leaving the datepicker in English. Lowercase the code and explicitly map Valencian before building the URL.
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-i18n/1.8.2/angular-locale_<%= stash('language') || (stash('i18n') ? stash('i18n')->{language} : 'en') %>.js"></script>

templates/bootstrap/scripts.html.ep:40

  • This is inside the $fallback branch, but it still loads from cdnjs while every other script in the branch is local. An offline/fallback installation therefore loses the Angular locale and renders the booking datepicker in English. Load the locale from the Angular archive under /fallback/angular-1.8.2/i18n/ (with the normalized/mapped asset name), or add the locale assets to fallback.conf.
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-i18n/1.8.2/angular-locale_<%= stash('language') || (stash('i18n') ? stash('i18n')->{language} : 'en') %>.js"></script>
  • Files reviewed: 16/16 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread script/rvd_front
,ko => 'Korean'
,my => 'Melayu'
,nb_NO => 'Norwegian'
,ms => 'Melayu'
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