From 7d23093b9975f0d4b674c1ea5659889cc67cd56b Mon Sep 17 00:00:00 2001 From: Michal Kolodziejski Date: Mon, 27 Jul 2015 10:41:07 +0200 Subject: [PATCH] Set locale to en_GB for dates in emails fixes #1723 --- .../emails/blockings/awaiting_confirmation_email_to_manager.txt | 2 +- .../rb/templates/emails/reservations/creation_email_to_user.txt | 4 ++-- .../reservations/occurrence_cancellation_email_to_assistance.txt | 2 +- .../reservations/occurrence_cancellation_email_to_manager.txt | 2 +- .../emails/reservations/occurrence_cancellation_email_to_user.txt | 2 +- .../reservations/occurrence_cancellation_email_to_vc_support.txt | 2 +- .../reservations/occurrence_rejection_email_to_assistance.txt | 2 +- .../emails/reservations/occurrence_rejection_email_to_manager.txt | 2 +- .../emails/reservations/occurrence_rejection_email_to_user.txt | 2 +- .../templates/emails/reservations/reminders/reservation_digest.txt | 4 ++-- .../templates/emails/reservations/reminders/upcoming_occurrence.txt | 6 +++--- .../modules/rb/templates/emails/reservations/reservation_info.txt | 4 ++-- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/indico/modules/rb/templates/emails/blockings/awaiting_confirmation_email_to_manager.txt b/indico/modules/rb/templates/emails/blockings/awaiting_confirmation_email_to_manager.txt index ae15baa32..239e1014b 100644 --- a/indico/modules/rb/templates/emails/blockings/awaiting_confirmation_email_to_manager.txt +++ b/indico/modules/rb/templates/emails/blockings/awaiting_confirmation_email_to_manager.txt @@ -13,7 +13,7 @@ Rooms: {% endfor %} {%- endif %} Reason: {{ blocking.reason }} -Dates: {{ blocking.start_date | format_date }} - {{ blocking.end_date | format_date }} +Dates: {{ blocking.start_date | format_date(locale='en_GB') }} - {{ blocking.end_date | format_date(locale='en_GB') }} You can approve or reject this blocking request here: {{ url_for('rooms.blocking_my_rooms', state='pending', _external=true) }} diff --git a/indico/modules/rb/templates/emails/reservations/creation_email_to_user.txt b/indico/modules/rb/templates/emails/reservations/creation_email_to_user.txt index 1ce82e584..d9e89d7ee 100644 --- a/indico/modules/rb/templates/emails/reservations/creation_email_to_user.txt +++ b/indico/modules/rb/templates/emails/reservations/creation_email_to_user.txt @@ -5,9 +5,9 @@ The conference room {{ reservation.room.full_name }} has been {% block prebooked_prefix %}{% endblock %}booked for {{ reservation.booked_for_name }} {% if reservation.repeat_frequency == RepeatFrequency.NEVER -%} - on {{ reservation.start_dt | format_date }} from {{ reservation.start_dt | format_time }} to {{ reservation.end_dt | format_time }}. + on {{ reservation.start_dt | format_date(locale='en_GB') }} from {{ reservation.start_dt | format_time(locale='en_GB') }} to {{ reservation.end_dt | format_time(locale='en_GB') }}. {%- else -%} - {{ RepeatMapping.get_short_name(reservation.repeat_frequency, reservation.repeat_interval) }} from {{ reservation.start_dt | format_date }} to {{ reservation.end_dt | format_date }} between {{ reservation.start_dt | format_time }} and {{ reservation.end_dt | format_time }}. + {{ RepeatMapping.get_short_name(reservation.repeat_frequency, reservation.repeat_interval) }} from {{ reservation.start_dt | format_date(locale='en_GB') }} to {{ reservation.end_dt | format_date(locale='en_GB') }} between {{ reservation.start_dt | format_time(locale='en_GB') }} and {{ reservation.end_dt | format_time(locale='en_GB') }}. {%- endif %} Reason: {{ reservation.booking_reason }} {%- block confirmed_booking -%} diff --git a/indico/modules/rb/templates/emails/reservations/occurrence_cancellation_email_to_assistance.txt b/indico/modules/rb/templates/emails/reservations/occurrence_cancellation_email_to_assistance.txt index f0576f331..05ad3fb33 100644 --- a/indico/modules/rb/templates/emails/reservations/occurrence_cancellation_email_to_assistance.txt +++ b/indico/modules/rb/templates/emails/reservations/occurrence_cancellation_email_to_assistance.txt @@ -1,5 +1,5 @@ {% extends 'rb/emails/reservations/base_email_to_assistance.txt' %} {% block body -%} -{{ session.user.full_name }} has cancelled the occurrence on {{ occurrence.start_dt | format_date }} of the following meeting. Support is NOT needed anymore. +{{ session.user.full_name }} has cancelled the occurrence on {{ occurrence.start_dt | format_date(locale='en_GB') }} of the following meeting. Support is NOT needed anymore. {%- endblock %} diff --git a/indico/modules/rb/templates/emails/reservations/occurrence_cancellation_email_to_manager.txt b/indico/modules/rb/templates/emails/reservations/occurrence_cancellation_email_to_manager.txt index 6dcd6a1fb..c4b6d1d4d 100644 --- a/indico/modules/rb/templates/emails/reservations/occurrence_cancellation_email_to_manager.txt +++ b/indico/modules/rb/templates/emails/reservations/occurrence_cancellation_email_to_manager.txt @@ -1,5 +1,5 @@ {% extends 'rb/emails/reservations/base_email_to_manager.txt' %} {% block body -%} -The date {{ reservation.start_dt | format_date }} from a booking that concerns one of your rooms has been CANCELLED by the user. +The date {{ reservation.start_dt | format_date(locale='en_GB') }} from a booking that concerns one of your rooms has been CANCELLED by the user. {%- endblock %} diff --git a/indico/modules/rb/templates/emails/reservations/occurrence_cancellation_email_to_user.txt b/indico/modules/rb/templates/emails/reservations/occurrence_cancellation_email_to_user.txt index a7fd505da..47ed9e9ea 100644 --- a/indico/modules/rb/templates/emails/reservations/occurrence_cancellation_email_to_user.txt +++ b/indico/modules/rb/templates/emails/reservations/occurrence_cancellation_email_to_user.txt @@ -1,7 +1,7 @@ {% extends 'rb/emails/reservations/base_email_to_user.txt' %} {% block body -%} -You have CANCELLED an occurrence of your booking on {{ occurrence.start_dt | format_date }}. +You have CANCELLED an occurrence of your booking on {{ occurrence.start_dt | format_date(locale='en_GB') }}. {% include 'rb/emails/reservations/reservation_info.txt' %} {%- endblock %} diff --git a/indico/modules/rb/templates/emails/reservations/occurrence_cancellation_email_to_vc_support.txt b/indico/modules/rb/templates/emails/reservations/occurrence_cancellation_email_to_vc_support.txt index 10db971b0..c8ffc2ccc 100644 --- a/indico/modules/rb/templates/emails/reservations/occurrence_cancellation_email_to_vc_support.txt +++ b/indico/modules/rb/templates/emails/reservations/occurrence_cancellation_email_to_vc_support.txt @@ -1,5 +1,5 @@ {% extends 'rb/emails/reservations/base_email_to_vc_support.txt' %} {% block body -%} -An occurrence of a booking has been CANCELLED for the {{ occurrence.start_dt | format_date }}. +An occurrence of a booking has been CANCELLED for the {{ occurrence.start_dt | format_date(locale='en_GB') }}. {%- endblock %} diff --git a/indico/modules/rb/templates/emails/reservations/occurrence_rejection_email_to_assistance.txt b/indico/modules/rb/templates/emails/reservations/occurrence_rejection_email_to_assistance.txt index fc00d40e9..aab19e211 100644 --- a/indico/modules/rb/templates/emails/reservations/occurrence_rejection_email_to_assistance.txt +++ b/indico/modules/rb/templates/emails/reservations/occurrence_rejection_email_to_assistance.txt @@ -1,7 +1,7 @@ {% extends 'rb/emails/reservations/base_email_to_assistance.txt' %} {% block body -%} -A booking has been REJECTED by the manager of the room '{{ reservation.room.full_name }}' for the {{ occurrence.start_dt | format_date }}. +A booking has been REJECTED by the manager of the room '{{ reservation.room.full_name }}' for the {{ occurrence.start_dt | format_date(locale='en_GB') }}. Assistance for the meeting startup in NOT needed anymore. Rejection reason: diff --git a/indico/modules/rb/templates/emails/reservations/occurrence_rejection_email_to_manager.txt b/indico/modules/rb/templates/emails/reservations/occurrence_rejection_email_to_manager.txt index a57330dd4..50a464486 100644 --- a/indico/modules/rb/templates/emails/reservations/occurrence_rejection_email_to_manager.txt +++ b/indico/modules/rb/templates/emails/reservations/occurrence_rejection_email_to_manager.txt @@ -1,7 +1,7 @@ {% extends 'rb/emails/reservations/base_email_to_manager.txt' %} {% block body -%} -A booking has been REJECTED by the manager of the room '{{ reservation.room.full_name }}' for the {{ occurrence.start_dt | format_date }}. +A booking has been REJECTED by the manager of the room '{{ reservation.room.full_name }}' for the {{ occurrence.start_dt | format_date(locale='en_GB') }}. Rejection reason: {{ occurrence.rejection_reason }} diff --git a/indico/modules/rb/templates/emails/reservations/occurrence_rejection_email_to_user.txt b/indico/modules/rb/templates/emails/reservations/occurrence_rejection_email_to_user.txt index 7306baed0..41e8fae45 100644 --- a/indico/modules/rb/templates/emails/reservations/occurrence_rejection_email_to_user.txt +++ b/indico/modules/rb/templates/emails/reservations/occurrence_rejection_email_to_user.txt @@ -1,7 +1,7 @@ {% extends 'rb/emails/reservations/base_email_to_user.txt' %} {% block body -%} -Your booking has been REJECTED by the manager of the room for the {{ occurrence.start_dt | format_date }}. +Your booking has been REJECTED by the manager of the room for the {{ occurrence.start_dt | format_date(locale='en_GB') }}. Rejection reason: {{ occurrence.rejection_reason }} diff --git a/indico/modules/rb/templates/emails/reservations/reminders/reservation_digest.txt b/indico/modules/rb/templates/emails/reservations/reminders/reservation_digest.txt index c8502b086..b96039a72 100644 --- a/indico/modules/rb/templates/emails/reservations/reminders/reservation_digest.txt +++ b/indico/modules/rb/templates/emails/reservations/reminders/reservation_digest.txt @@ -5,12 +5,12 @@ This is a reminder digest about a weekly booking under your name: Room: {{ reservation.room.name }} -Time: {{ reservation.start_dt | format_time }} - {{ reservation.end_dt | format_time }} +Time: {{ reservation.start_dt | format_time(locale='en_GB') }} - {{ reservation.end_dt | format_time(locale='en_GB') }} Reason: {{ reservation.booking_reason }} Days: {%- for occ in occurrences %} - * {{ occ.start_dt | format_date }} + * {{ occ.start_dt | format_date(locale='en_GB') }} {%- endfor %} If you don't need to use the room some of these days, please cancel them on this page: diff --git a/indico/modules/rb/templates/emails/reservations/reminders/upcoming_occurrence.txt b/indico/modules/rb/templates/emails/reservations/reminders/upcoming_occurrence.txt index c79fc95cf..f2408ec96 100644 --- a/indico/modules/rb/templates/emails/reservations/reminders/upcoming_occurrence.txt +++ b/indico/modules/rb/templates/emails/reservations/reminders/upcoming_occurrence.txt @@ -6,11 +6,11 @@ This is a reminder about a booking under your name: Room: {{ occurrence.reservation.room.name }} {% if occurrence.reservation.repeat_frequency == RepeatFrequency.DAY -%} -Daily: {{ occurrence.reservation.start_dt | format_date }} - {{ occurrence.reservation.end_dt | format_date }} +Daily: {{ occurrence.reservation.start_dt | format_date(locale='en_GB') }} - {{ occurrence.reservation.end_dt | format_date(locale='en_GB') }} {%- else -%} -Date: {{ occurrence.start_dt | format_date }} +Date: {{ occurrence.start_dt | format_date(locale='en_GB') }} {%- endif %} -Time: {{ occurrence.start_dt | format_time }} - {{ occurrence.end_dt | format_time }} +Time: {{ occurrence.start_dt | format_time(locale='en_GB') }} - {{ occurrence.end_dt | format_time(locale='en_GB') }} If you don't need to use the room, please cancel your occurrence on this page: diff --git a/indico/modules/rb/templates/emails/reservations/reservation_info.txt b/indico/modules/rb/templates/emails/reservations/reservation_info.txt index 948427c12..344ecff09 100644 --- a/indico/modules/rb/templates/emails/reservations/reservation_info.txt +++ b/indico/modules/rb/templates/emails/reservations/reservation_info.txt @@ -1,5 +1,5 @@ Room: {{ reservation.room.full_name }} For: {{ reservation.booked_for_name }} Reason: {{ reservation.booking_reason }} -Dates: {{ reservation.start_dt | format_date }} - {{ reservation.end_dt | format_date }} -Hours: {{ reservation.start_dt | format_time }} - {{ reservation.end_dt | format_time }} +Dates: {{ reservation.start_dt | format_date(locale='en_GB') }} - {{ reservation.end_dt | format_date(locale='en_GB') }} +Hours: {{ reservation.start_dt | format_time(locale='en_GB') }} - {{ reservation.end_dt | format_time(locale='en_GB') }} -- 2.11.4.GIT