LocationItem: localize departure time preview (#1294)
* localize departure time preview * use plurals * use plural format string correctly
This commit is contained in:
@@ -453,8 +453,11 @@ fun LocationItem(
|
||||
java.time.LocalTime.now(),
|
||||
nextDeparture.time + (nextDeparture.delay
|
||||
?: Duration.ZERO)
|
||||
).toMinutes()
|
||||
if (timeLeft < 1) "now" else "in $timeLeft min"
|
||||
).toMinutes().toInt()
|
||||
if (timeLeft < 1)
|
||||
context.getString(R.string.departure_time_now)
|
||||
else
|
||||
context.resources.getQuantityString(R.plurals.departure_time_in, timeLeft, timeLeft)
|
||||
}
|
||||
|
||||
Text(
|
||||
|
||||
Reference in New Issue
Block a user