diff --git a/src/main/java/swiss/fihlon/apus/ui/view/RoomView.java b/src/main/java/swiss/fihlon/apus/ui/view/RoomView.java index 1fd274a..a1c4798 100644 --- a/src/main/java/swiss/fihlon/apus/ui/view/RoomView.java +++ b/src/main/java/swiss/fihlon/apus/ui/view/RoomView.java @@ -144,11 +144,14 @@ private Component createTimeComponent() { } else if (startTime.isBefore(now) && endTime.isAfter(now)) { // running session final Duration duration = Duration.between(now, endTime); final long timeLeft = Math.round(duration.getSeconds() / 60f); - timeComponent.add( - new Icon(VaadinIcon.HOURGLASS), - new Text(getTranslation(timeLeft == 1 - ? "event.session.countdown.singular" : "event.session.countdown.plural", - timeLeft))); + timeComponent.add(new Icon(VaadinIcon.HOURGLASS)); + if (timeLeft == 0) { + timeComponent.add(new Text(getTranslation("event.session.countdown.now"))); + } else if (timeLeft == 1) { + timeComponent.add(new Text(getTranslation("event.session.countdown.singular", timeLeft))); + } else { + timeComponent.add(new Text(getTranslation("event.session.countdown.plural", timeLeft))); + } roomStyle = RoomStyle.RUNNING; } else { // next session timeComponent.add( diff --git a/src/main/resources/vaadin-i18n/translations.properties b/src/main/resources/vaadin-i18n/translations.properties index 3f53771..dcd4a64 100644 --- a/src/main/resources/vaadin-i18n/translations.properties +++ b/src/main/resources/vaadin-i18n/translations.properties @@ -5,6 +5,7 @@ event.legend.empty-room=room closed event.legend.next-session=next session event.legend.running-session=running session event.room.empty=closed +event.session.countdown.now=ends now event.session.countdown.plural=ends in {0} minutes event.session.countdown.singular=ends in {0} minute social.admin.login.button=Login diff --git a/src/main/resources/vaadin-i18n/translations_de.properties b/src/main/resources/vaadin-i18n/translations_de.properties index 91ccf93..b04b964 100644 --- a/src/main/resources/vaadin-i18n/translations_de.properties +++ b/src/main/resources/vaadin-i18n/translations_de.properties @@ -5,6 +5,7 @@ event.legend.empty-room=Raum geschlossen event.legend.next-session=nächster Vortrag event.legend.running-session=laufender Vortrag event.room.empty=geschlossen +event.session.countdown.now=endet jetzt event.session.countdown.plural=endet in {0} Minuten event.session.countdown.singular=endet in {0} Minute social.admin.login.button=Anmelden