fix: address review feedback on the distance unit setting

- server: allow distance_unit as an admin default (+ value validation) so the
  Admin "Default User Settings" toggle persists instead of returning 400
- i18n: add settings.distance to all 20 locales and translate the labels
  through t() instead of hardcoding "Distance"
- route legs: include the unit in the OSRM cache key and recompute on a unit
  switch, so map and sidebar distances refresh and never mix units
- keep wind speed tied to the temperature unit — a distance setting must not
  silently flip existing Fahrenheit users from mph to km/h
- restore the sub-1km metres reading for metric, convert GPX elevation to feet
  for imperial, and format distances with a '.' decimal in every locale
- add units.test.ts
This commit is contained in:
Maurice
2026-06-26 17:45:56 +02:00
committed by Maurice
parent 94dca8cad7
commit 3d65bb0c12
32 changed files with 109 additions and 23 deletions
+1
View File
@@ -52,6 +52,7 @@ const settings: TranslationStrings = {
'settings.auto': '自動',
'settings.language': '言語',
'settings.temperature': '温度単位',
'settings.distance': '距離単位',
'settings.timeFormat': '時刻形式',
'settings.bookingLabels': '予約ルートのラベル',
'settings.bookingLabelsHint': '地図に駅・空港名を表示。オフ時はアイコンのみ。',