Traewelling / traewelling

Free check-in service to log your public transit journeys
https://traewelling.de
GNU Affero General Public License v3.0
225 stars 43 forks source link

Charts in 'Statistics' page show German string "Minuten" no matter the browser's language #2077

Closed Nagiphaaa closed 8 months ago

Nagiphaaa commented 8 months ago

Describe the bug All charts in the 'Statistics' page show the time in German (as "x Minuten") instead of in the user's browser language (in my case English, where it should be "x minutes"). I tested this for both English and French, and in both cases the same issue was present. I did not have German set as a fallback language in my browser settings.

To Reproduce Steps to reproduce the behavior:

  1. (Set browser to non-German language)
  2. Go to the 'Statistics' page
  3. Hovering over the pie charts or looking at the daily travel time charts reveal spent time as "x Minuten"

Expected behavior The charts should display the 'minutes' string in the appropriate language, e.g. "x minutes"

Screenshots 2023-10-21

Desktop

I also tested this on my phone and came across the same issue: Smartphone

MrKrisKrisu commented 8 months ago

Hmm, this is weird. This string is translated and there are variations for every language...

https://github.com/Traewelling/traewelling/blob/8f0cae6d80ceb0539e273e585087d95af87c0e2b/resources/views/stats/includes/chart_volume.blade.php#L61-L63

english translation

https://github.com/Traewelling/traewelling/blob/8f0cae6d80ceb0539e273e585087d95af87c0e2b/resources/lang/en.json#L534

italian translation

https://github.com/Traewelling/traewelling/blob/8f0cae6d80ceb0539e273e585087d95af87c0e2b/resources/lang/it.json#L440