Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make date configurable via locales #997

Merged
merged 2 commits into from
Jun 10, 2023
Merged
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
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module ApplicationHelper
include PathHelper

def format_time(time = Time.now)
I18n.l(time, format: '%d.%m.%Y %H:%M') unless time.nil?
I18n.l(time, format: :foodsoft_datetime) unless time.nil?
end

def format_date(time = Time.now)
Expand Down
1 change: 1 addition & 0 deletions config/initializers/time_formats.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Time::DATE_FORMATS[:foodsoft_datetime] = "%d.%m.%Y %H:%M"
3 changes: 3 additions & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1876,3 +1876,6 @@ de:
title: Arbeitsgruppen
update:
notice: Arbeitsgruppe wurde aktualisiert
time:
formats:
foodsoft_datetime: "%d.%m.%Y %H:%M"
3 changes: 3 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1903,3 +1903,6 @@ en:
title: Workgroups
update:
notice: Workgroup was updated
time:
formats:
foodsoft_datetime: "%Y-%m-%d %H:%M"
3 changes: 3 additions & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1618,3 +1618,6 @@ es:
title: Grupos de trabajo
update:
notice: El grupo de trabajo se actualizó.
time:
formats:
foodsoft_datetime: "%d/%b/%Y %H:%M"
3 changes: 3 additions & 0 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1375,3 +1375,6 @@ fr:
title: Équipes
update:
notice: L'équipe a été mise à jour
time:
formats:
foodsoft_datetime: "%d/%m/%Y %H:%M"
3 changes: 3 additions & 0 deletions config/locales/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1868,3 +1868,6 @@ nl:
title: Werkgroepen
update:
notice: Werkgroep is bijgewerkt
time:
formats:
foodsoft_datetime: "%d-%m-%Y %H:%M"
4 changes: 3 additions & 1 deletion config/locales/tr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1903,4 +1903,6 @@ tr:
title: Çalışma Grupları
update:
notice: Çalışma grubu güncellendi.

time:
formats:
foodsoft_datetime: "%d.%b.%Y %H:%M"