From 6b441b515e33b8bca7d7b413645f83a72b24eaae Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Tue, 21 Sep 2021 20:34:27 +0200 Subject: [PATCH] more translation --- .../dash/ui/OmnipodDashOverviewFragment.kt | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt index cae91a955f..dfce49f4bf 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt @@ -30,6 +30,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.R import info.nightscout.androidaps.plugins.pump.omnipod.dash.databinding.OmnipodDashOverviewBinding import info.nightscout.androidaps.plugins.pump.omnipod.dash.databinding.OmnipodDashOverviewBluetoothStatusBinding import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.ActivationProgress +import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.AlertType import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state.OmnipodDashPodStateManager import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.queue.events.EventQueueChanged @@ -389,7 +390,7 @@ class OmnipodDashOverviewFragment : DaggerFragment() { } podInfoBinding.podActiveAlerts.text = podStateManager.activeAlerts?.let { it -> - it.joinToString(",") { it.toString() } + it.joinToString(System.lineSeparator()) { t -> translatedActiveAlert(t) } } ?: PLACEHOLDER } @@ -402,6 +403,24 @@ class OmnipodDashOverviewFragment : DaggerFragment() { } } + private fun translatedActiveAlert(alert: AlertType): String { + val id = when (alert) { + AlertType.LOW_RESERVOIR -> + R.string.omnipod_common_alert_low_reservoir + AlertType.EXPIRATION -> + R.string.omnipod_common_alert_expiration_advisory + AlertType.EXPIRATION_IMMINENT -> + R.string.omnipod_common_alert_expiration + AlertType.USER_SET_EXPIRATION -> + R.string.omnipod_common_alert_expiration_advisory + AlertType.AUTO_OFF -> + R.string.omnipod_common_alert_shutdown_imminent + else -> + R.string.omnipod_common_alert_unknown_alert + } + return resourceHelper.gs(id) + } + private fun updateLastConnection() { if (podStateManager.isUniqueIdSet) { podInfoBinding.lastConnection.text = readableDuration(