diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt index 9689e722d8..033205f1bd 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt @@ -186,10 +186,10 @@ class TempTargetDialog : DialogFragmentWithDate() { timestamp = eventTime, duration = TimeUnit.MINUTES.toMillis(duration.toLong()), reason = when (reason) { - "Eating Soon" -> TemporaryTarget.Reason.EATING_SOON - "Activity" -> TemporaryTarget.Reason.ACTIVITY - "Hypo" -> TemporaryTarget.Reason.HYPOGLYCEMIA - else -> TemporaryTarget.Reason.CUSTOM + resourceHelper.gs(R.string.eatingsoon) -> TemporaryTarget.Reason.EATING_SOON + resourceHelper.gs(R.string.activity) -> TemporaryTarget.Reason.ACTIVITY + resourceHelper.gs(R.string.hypo) -> TemporaryTarget.Reason.HYPOGLYCEMIA + else -> TemporaryTarget.Reason.CUSTOM }, lowTarget = Profile.toMgdl(target, profileFunction.getUnits()), highTarget = Profile.toMgdl(target, profileFunction.getUnits()) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsTempTargetFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsTempTargetFragment.kt index 0bfa260b35..8ef74d39d5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsTempTargetFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsTempTargetFragment.kt @@ -32,6 +32,7 @@ import info.nightscout.androidaps.plugins.treatments.fragments.TreatmentsTempTar import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.T +import info.nightscout.androidaps.utils.Translator import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.extensions.friendlyDescription @@ -58,6 +59,7 @@ class TreatmentsTempTargetFragment : DaggerFragment() { @Inject lateinit var nsUpload: NSUpload @Inject lateinit var uploadQueue: UploadQueue @Inject lateinit var fabricPrivacy: FabricPrivacy + @Inject lateinit var translator: Translator @Inject lateinit var dateUtil: DateUtil @Inject lateinit var buildHelper: BuildHelper @Inject lateinit var aapsSchedulers: AapsSchedulers @@ -167,7 +169,7 @@ class TreatmentsTempTargetFragment : DaggerFragment() { holder.binding.duration.text = resourceHelper.gs(R.string.format_mins, T.msecs(tempTarget.duration).mins()) holder.binding.low.text = tempTarget.lowValueToUnitsToString(units) holder.binding.high.text = tempTarget.highValueToUnitsToString(units) - holder.binding.reason.text = tempTarget.reason.text + holder.binding.reason.text = translator.translate(tempTarget.reason.text) holder.binding.date.setTextColor( when { tempTarget.id == currentlyActiveTarget?.id -> resourceHelper.gc(R.color.colorActive) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 34c51462e9..1777fc407a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -318,9 +318,6 @@ Use Autosens feature Refresh events from NS Delete treatments in the future - Eating Soon - Hypo - Activity ACT CONF LOOP diff --git a/core/src/main/java/info/nightscout/androidaps/utils/Translator.kt b/core/src/main/java/info/nightscout/androidaps/utils/Translator.kt index ef2a835118..1fb6dbcae4 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/Translator.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/Translator.kt @@ -1,6 +1,7 @@ package info.nightscout.androidaps.utils import info.nightscout.androidaps.core.R +import info.nightscout.androidaps.database.entities.TemporaryTarget import info.nightscout.androidaps.database.entities.TherapyEvent import info.nightscout.androidaps.utils.resources.ResourceHelper import javax.inject.Inject @@ -40,6 +41,12 @@ class Translator @Inject internal constructor( TherapyEvent.MeterType.FINGER.text -> resourceHelper.gs(R.string.glucosetype_finger) TherapyEvent.MeterType.SENSOR.text -> resourceHelper.gs(R.string.glucosetype_sensor) TherapyEvent.MeterType.MANUAL.text -> resourceHelper.gs(R.string.manual) + TemporaryTarget.Reason.CUSTOM.text -> resourceHelper.gs(R.string.custom) + TemporaryTarget.Reason.HYPOGLYCEMIA.text -> resourceHelper.gs(R.string.hypo) + TemporaryTarget.Reason.EATING_SOON.text -> resourceHelper.gs(R.string.eatingsoon) + TemporaryTarget.Reason.ACTIVITY.text -> resourceHelper.gs(R.string.activity) + TemporaryTarget.Reason.AUTOMATION.text -> resourceHelper.gs(R.string.automation) + TemporaryTarget.Reason.WEAR.text -> resourceHelper.gs(R.string.wear) else -> resourceHelper.gs(R.string.unknown) } } \ No newline at end of file diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index ecd92d70ca..3b87c124b3 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -266,6 +266,12 @@ Sensor Manual unknown + Eating Soon + Hypo + Activity + Wear + Automation + Custom Connection timed out