Skip to content
Draft
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 Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ gem 'js-routes'
gem 'jwt'
gem 'kramdown'
gem 'kramdown-parser-gfm'
gem 'local_time'
gem 'mimemagic'
gem 'net-http-persistent'
gem 'net-imap', require: false
Expand All @@ -39,7 +40,6 @@ gem 'pundit'
gem 'rails', '~> 8.0.2'
gem 'rails_admin'
gem 'rails-i18n'
gem 'rails-timeago'
gem 'ransack'
gem 'rubytree'
gem 'rubyzip'
Expand Down
8 changes: 3 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ GEM
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
local_time (3.0.3)
logger (1.7.0)
loofah (2.24.1)
crass (~> 1.0.2)
Expand Down Expand Up @@ -420,9 +421,6 @@ GEM
rails-i18n (8.0.1)
i18n (>= 0.7, < 2)
railties (>= 8.0.0, < 9)
rails-timeago (2.20.0)
actionpack (>= 5.2)
activesupport (>= 5.2)
rails_admin (3.3.0)
activemodel-serializers-xml (>= 1.0)
csv
Expand Down Expand Up @@ -704,6 +702,7 @@ DEPENDENCIES
kramdown-parser-gfm
letter_opener
listen
local_time
mimemagic
mnemosyne-ruby
net-http-persistent
Expand All @@ -720,7 +719,6 @@ DEPENDENCIES
rails (~> 8.0.2)
rails-controller-testing
rails-i18n
rails-timeago
rails_admin
ransack
rspec-collection_matchers
Expand Down Expand Up @@ -861,6 +859,7 @@ CHECKSUMS
letter_opener (1.10.0) sha256=2ff33f2e3b5c3c26d1959be54b395c086ca6d44826e8bf41a14ff96fdf1bdbb2
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
listen (3.9.0) sha256=db9e4424e0e5834480385197c139cb6b0ae0ef28cc13310cfd1ca78377d59c67
local_time (3.0.3) sha256=c69a8974d993fdf6e60db02977ed23c070f203dcb3a1ff0de52ad3d2393f8303
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
loofah (2.24.1) sha256=655a30842b70ec476410b347ab1cd2a5b92da46a19044357bbd9f401b009a337
mail (2.8.1) sha256=ec3b9fadcf2b3755c78785cb17bc9a0ca9ee9857108a64b6f5cfc9c0b5bfc9ad
Expand Down Expand Up @@ -929,7 +928,6 @@ CHECKSUMS
rails-dom-testing (2.3.0) sha256=8acc7953a7b911ca44588bf08737bc16719f431a1cc3091a292bca7317925c1d
rails-html-sanitizer (1.6.2) sha256=35fce2ca8242da8775c83b6ba9c1bcaad6751d9eb73c1abaa8403475ab89a560
rails-i18n (8.0.1) sha256=15303195450bdac9a80636cf14c7e5ada2f43907cc60fcd19bbb3f81ab45be0d
rails-timeago (2.20.0) sha256=f9b284fa758e4ad89f74cec88bd1b04c378597f1eb6bafecdba9186ba0109f38
rails_admin (3.3.0) sha256=666c40a0931ee4f6e29e6db1df69df72417218d553af25b2fb56cdc94e2cfbf9
railties (8.0.2) sha256=0d7c3f40c49ba74980f1bac1d4bb153a9331c5ee8a9631d89c7bf79db82e5cf9
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
Expand Down
3 changes: 0 additions & 3 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require rails-timeago
//= require locales/jquery.timeago.de.js
//
// app/assets
// --> Include some assets first, as they are used by other assets.
// --> Hence, the order specified here is important.
Expand Down
1 change: 0 additions & 1 deletion app/assets/javascripts/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ $(document).on('turbo-migration:load', function(event) {
const htmlTag = $('html')
I18n.defaultLocale = htmlTag.data('default-locale');
I18n.locale = htmlTag.attr('lang');
jQuery.timeago.settings.lang = I18n.locale;

// Initialize Sentry
const sentrySettings = $('meta[name="sentry"]')
Expand Down
5 changes: 5 additions & 0 deletions app/javascript/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ import "ace-builds/src-noconflict/ext-modelist"; // Enable language mode detecti
ace.config.set("useStrictCSP", true); // Enable strict CSP mode
window.ace = ace; // Publish ace in global namespace

import LocalTime from "local-time"
LocalTime.config.locale = 'default';
LocalTime.config.i18n['default'] = i18n.t('local_time');
LocalTime.start()

// Turbo
import '@hotwired/turbo-rails';
import './turbo-migration';
Expand Down
2 changes: 1 addition & 1 deletion app/views/request_for_comments/_list_entry.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ tr.table-row-clickable data-id=request_for_comment.id data-href=request_for_comm
- else
td.text-black-50.font-italic = t('request_for_comments.no_question')
td = request_for_comment.user
td = timeago_tag request_for_comment.created_at
td = local_time_ago request_for_comment.created_at
1 change: 1 addition & 0 deletions config/i18n-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ ignore_unused:
- 'activerecord.{attributes,errors,models}.*'
- 'linter.*'
- 'will_paginate.*'
- 'local_time.*'

## Exclude these keys from the `i18n_tasks eq-base' report:
# ignore_eq_base:
Expand Down
71 changes: 71 additions & 0 deletions config/locales/de/local_time.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
de:
local_time:
date:
abbrDayNames:
- So
- Mo
- Di
- Mi
- Do
- Fr
- Sa
abbrMonthNames:
- Jan
- Feb
- Mär
- Apr
- Mai
- Jun
- Jul
- Aug
- Sep
- Okt
- Nov
- Dez
dayNames:
- Sonntag
- Montag
- Dienstag
- Mittwoch
- Donnerstag
- Freitag
- Samstag
formats:
default: "%e. %b %Y"
thisYear: "%e. %b"
monthNames:
- Januar
- Februar
- März
- April
- Mai
- Juni
- Juli
- August
- September
- Oktober
- November
- Dezember
today: heute
tomorrow: morgen
'true': am {date}
yesterday: gestern
datetime:
at: "{date} um {time}"
formats:
default: "%e. %B %Y um %H:%M %Z"
default_24h: "%e. %B %Y um %H:%M %Z"
time:
elapsed: vor {time}
formats:
default: "%H:%M"
default_24h: "%H:%M"
hour: Stunde
hours: Stunden
minute: Minute
minutes: Minuten
second: Sekunde
seconds: Sekunden
singular: vor einer {time}
singularAn: vor einer {time}
73 changes: 73 additions & 0 deletions config/locales/en/local_time.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
en:
local_time:
date:
abbrDayNames:
- Sun
- Mon
- Tue
- Wed
- Thu
- Fri
- Sat
abbrMonthNames:
- Jan
- Feb
- Mar
- Apr
- May
- Jun
- Jul
- Aug
- Sep
- Oct
- Nov
- Dec
dayNames:
- Sunday
- Monday
- Tuesday
- Wednesday
- Thursday
- Friday
- Saturday
formats:
default: "%b %e, %Y"
thisYear: "%b %e"
monthNames:
- January
- February
- March
- April
- May
- June
- July
- August
- September
- October
- November
- December
today: today
tomorrow: tomorrow
'true': on {date}
yesterday: yesterday
datetime:
at: "{date} at {time}"
formats:
default: "%B %e, %Y at %l:%M%P %Z"
default_24h: "%B %e, %Y at %H:%M %Z"
time:
am: am
elapsed: "{time} ago"
formats:
default: "%l:%M%P"
default_24h: "%H:%M"
hour: hour
hours: hours
minute: minute
minutes: minutes
pm: pm
second: second
seconds: seconds
singular: a {time}
singularAn: an {time}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"jquery-ujs": "^1.2.3",
"jstree": "^3.3.17",
"keycharm": "^0.4.0",
"local-time": "^3.0.3",
"mini-css-extract-plugin": "^2.9.2",
"moment": "^2.30.1",
"opensans-webkit": "^1.1.0",
Expand Down
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2634,6 +2634,7 @@ __metadata:
jquery-ujs: "npm:^1.2.3"
jstree: "npm:^3.3.17"
keycharm: "npm:^0.4.0"
local-time: "npm:^3.0.3"
mini-css-extract-plugin: "npm:^2.9.2"
moment: "npm:^2.30.1"
opensans-webkit: "npm:^1.1.0"
Expand Down Expand Up @@ -4670,6 +4671,13 @@ __metadata:
languageName: node
linkType: hard

"local-time@npm:^3.0.3":
version: 3.0.3
resolution: "local-time@npm:3.0.3"
checksum: 10c0/452f291576f44cceb1c2ffb014376aa6513d03ea0562a114591bb0d40be4e0a0de5f95334344d43c1d92e1511081bf030c8bec7d0ad87421c750b5ceef7cded6
languageName: node
linkType: hard

"locate-path@npm:^5.0.0":
version: 5.0.0
resolution: "locate-path@npm:5.0.0"
Expand Down
Loading