Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions lib/Ravada/I18N/ca.po
Original file line number Diff line number Diff line change
Expand Up @@ -2779,3 +2779,27 @@ msgstr "Ara"

msgid "Later"
msgstr "Després"

msgid "Today"
msgstr "Avui"

msgid "Clear"
msgstr "Esborra"

msgid "LDAP groups allowed"
msgstr "Grups LDAP permesos"

msgid "No devices found"
msgstr "No s'han trobat dispositius"

msgid "found"
msgstr "trobats"

msgid "Storage Pool"
msgstr "Emmagatzematge"

msgid "There are no machines that match the selection"
msgstr "No hi ha cap màquina que coincideixi amb la selecció"

msgid "more"
msgstr "més"
24 changes: 24 additions & 0 deletions lib/Ravada/I18N/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -2613,3 +2613,27 @@ msgstr "Now"

msgid "Later"
msgstr "Later"

msgid "Today"
msgstr "Today"

msgid "Clear"
msgstr "Clear"

msgid "LDAP groups allowed"
msgstr "LDAP groups allowed"

msgid "No devices found"
msgstr "No devices found"

msgid "found"
msgstr "found"

msgid "Storage Pool"
msgstr "Storage Pool"

msgid "There are no machines that match the selection"
msgstr "There are no machines that match the selection"

msgid "more"
msgstr "more"
33 changes: 33 additions & 0 deletions lib/Ravada/I18N/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -2703,3 +2703,36 @@ msgstr "Ahora"

msgid "Later"
msgstr "Después"

msgid "Today"
msgstr "Hoy"

msgid "Clear"
msgstr "Limpiar"

msgid "LDAP groups allowed"
msgstr "Grupos LDAP permitidos"

msgid "Local groups"
msgstr "Grupos locales"

msgid "LDAP groups"
msgstr "Grupos LDAP"

msgid "No devices found"
msgstr "No se encontraron dispositivos"

msgid "found"
msgstr "encontrados"

msgid "Storage Pool"
msgstr "Almacenamiento"

msgid "available"
msgstr "disponible"

msgid "There are no machines that match the selection"
msgstr "No hay máquinas que coincidan con la selección"

msgid "more"
msgstr "más"
24 changes: 24 additions & 0 deletions lib/Ravada/I18N/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2726,3 +2726,27 @@ msgstr ""

msgid "Later"
msgstr ""

msgid "Today"
msgstr ""

msgid "Clear"
msgstr ""

msgid "LDAP groups allowed"
msgstr ""

msgid "No devices found"
msgstr ""

msgid "found"
msgstr ""

msgid "Storage Pool"
msgstr ""

msgid "There are no machines that match the selection"
msgstr ""

msgid "more"
msgstr ""
9 changes: 8 additions & 1 deletion public/js/booking/booking.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,12 @@ angular.module("ravada.booking", ['ui.bootstrap','angularMoment','angularjsToast
.service("apiEntry",svcEntry)
.service("apiLDAP",svcLDAP)
.service("apiLocal",svcLocal)
.run( amMoment => amMoment.changeLocale('en') );
.run( (amMoment, moment) => {
const rawLang = document.documentElement.lang || 'en';
const normalized = rawLang.toLowerCase().replace(/_/g, '-').replace(/@/g, '-');
const locales = (moment && typeof moment.locales === 'function') ? moment.locales() : [];
const base = normalized.split('-')[0];
const resolved = locales.includes(normalized) ? normalized : (locales.includes(base) ? base : 'en');
amMoment.changeLocale(resolved);
});

9 changes: 8 additions & 1 deletion public/js/booking/calendar.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ calendarCtrl.$inject = ['$element', '$window', 'apiBookings','$uibModal','moment

function calendarCtrl($element, $window, apiBookings,$uibModal,moment,apiEntry) {
const self = this;
const rawLang = document.documentElement.lang || 'en';
const normalized = rawLang.toLowerCase().replace(/_/g, '-').replace(/@/g, '-');
const locales = (moment && typeof moment.locales === 'function') ? moment.locales() : [];
const base = normalized.split('-')[0];
const lang = locales.includes(normalized) ? normalized : (locales.includes(base) ? base : 'en');
const parseDate = (data, time) => data + "T" + time;
const TimeFormat = {
hour: '2-digit',
Expand All @@ -20,15 +25,17 @@ function calendarCtrl($element, $window, apiBookings,$uibModal,moment,apiEntry)
omitZeroMinute: false
};
let calendar;
moment.updateLocale('en', {
moment.updateLocale(lang, {
week: {
dow: 1,
}
});
self.$postLink = () => {
const calendarEl = $element.find("#rvdCalendar")[0];
calendar = new FullCalendar.Calendar(calendarEl, {
locale: lang,
initialView: 'timeGridWeek',
height: 'auto',
firstDay: 1,
allDaySlot: false,
selectOverlap: false,
Expand Down
4 changes: 2 additions & 2 deletions templates/booking/formEvent.component.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
ng-click="$ctrl.openCal('ini_opened')"
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' %>"/>
</div>
</div>
<!-- repeat until date -->
Expand All @@ -62,7 +62,7 @@
ng-click="$ctrl.openCal('until_opened')"
is-open="$ctrl.cal.until_opened"
datepicker-options="$ctrl.optionsDateEnd"
ng-required="true" close-text="Close"/>
ng-required="true" current-text="<%=l 'Today' %>" clear-text="<%=l 'Clear' %>" close-text="<%=l 'Close' %>"/>
</div>
</div>
<!-- end repear -->
Expand Down
4 changes: 4 additions & 0 deletions templates/bootstrap/scripts.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<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>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular-resource.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular-animate.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular-aria.min.js"></script>
Expand Down Expand Up @@ -35,6 +37,8 @@
<script src="/fallback/bootstrap.min.js"></script>

<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} : 'en') %>.js"></script>

Comment on lines 39 to +41
<script src="/fallback/angular-1.8.2/angular-resource.min.js"></script>
<script src="/fallback/angular-1.8.2/angular-animate.min.js"></script>
<script src="/fallback/angular-1.8.2/angular-aria.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion templates/main/machine_access_group.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<div ng-show="<%= $FEATURE->{ldap} %> && access_groups['ldap']">

<h4>LDAP groups</h4>
<h4><%=l 'LDAP groups' %></h4>

<div class="card-body ml-8 pl-8">
<ldap-groups name="groups"
Expand Down
2 changes: 1 addition & 1 deletion templates/ng-templates/booking/calendar.html.ep
Original file line number Diff line number Diff line change
@@ -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') %>">
%= include 'bootstrap/header'
<body id="page-top" data-spy="scroll" data-target="fixed-top" role="document" ng-cloak>
<div id="wrapper">
Expand Down
Loading