Hong-Kong-Districts-Info / hktrafficcollisions

Shiny app dashboard of HK traffic collisions that result in injury. | 香港車禍傷亡資料庫:利用互動地圖和儀表版,將香港車禍位置和相關數據可視化。
Other
8 stars 2 forks source link

TODO: Vehicle involved in collision map popup are not completely translated. #78

Open KHwong12 opened 2 years ago

KHwong12 commented 2 years ago

As stated in #76, details of vehicles involved aren't translated when collision includes more than 1 vehicle type (e.g. Private car, Taxi).

Warning in private$raw_translate(keyword, translation_language) :
  'Motorcycle, Taxi' translation does not exist.'Private car, Taxi' translation does not exist.'Public franchised bus, Taxi' translation does not exist.'Others (incl. unknown), Private car' translation does not exist.'Private car, Taxi' translation does not exist.'Medium goods vehicle, Others (incl. unknown)' translation does not exist.'Light goods vehicle, Private car' translation does not exist.'Medium goods vehicle, Public light bus' translation does not exist.'Private car, Taxi' translation does not exist.'Private car, Taxi' translation does not exist.'Others (incl. unknown), Taxi' translation does not exist.
KHwong12 commented 2 years ago

Possible way is to split the vehicle class involved string to character vector (e.g. 'Private car, Taxi' -> c('Private car', 'Taxi'), then wrap it with i18n$t() one by one.

lapply(unlist(strsplit(filter_collision_data()$vehicle_class_involved, split = ", ")), function(x) i18n$t(x))