From 2b6f060eaed85501085740dd73a95bbf20d5f2d9 Mon Sep 17 00:00:00 2001 From: Philoul Date: Wed, 17 Mar 2021 12:05:25 +0100 Subject: [PATCH] Translate TT_Reason (UserEntry and csv export) --- .../plugins/treatments/fragments/TreatmentsUserEntryFragment.kt | 2 +- .../plugins/general/maintenance/formats/ClassicPrefsFormat.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsUserEntryFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsUserEntryFragment.kt index ea2d8f600d..e6b99eaf8a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsUserEntryFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/fragments/TreatmentsUserEntryFragment.kt @@ -128,7 +128,7 @@ class TreatmentsUserEntryFragment : DaggerFragment() { when (v.unit) { Units.Timestamp -> valuesWithUnitString += dateUtil.dateAndTimeAndSecondsString(v.lValue) + separator Units.CPEvent -> valuesWithUnitString += translator.translate(v.sValue) + separator - Units.TT_Reason -> valuesWithUnitString += v.sValue + separator + Units.TT_Reason -> valuesWithUnitString += translator.translate(v.sValue) + separator Units.R_String -> { rStringParam = v.lValue.toInt() when (rStringParam) { // diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/ClassicPrefsFormat.kt b/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/ClassicPrefsFormat.kt index 21b82a04ad..93372126df 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/ClassicPrefsFormat.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/formats/ClassicPrefsFormat.kt @@ -113,7 +113,7 @@ class ClassicPrefsFormat @Inject constructor( return when (v.unit) { Units.Timestamp -> dateUtil.dateAndTimeAndSecondsString(v.lValue) + ";" + csvString(R.string.date) Units.CPEvent -> csvString(translator.translate(v.sValue)) + ";" - Units.TT_Reason -> csvString(v.sValue) + ";" + Units.TT_Reason -> csvString(translator.translate(v.sValue)) + ";" Units.R_String -> if (v.lValue.toInt() == 0) csvString(v.iValue) + ";" else ";" //If lValue > 0 it's a formated string, so hidden for Units.Mg_Dl -> if (profileFunction.getUnits()==Constants.MGDL) DecimalFormatter.to0Decimal(v.dValue) + ";" + csvString(Units.Mg_Dl) else DecimalFormatter.to1Decimal(v.dValue/Constants.MMOLL_TO_MGDL) + ";" + csvString(Units.Mmol_L) Units.Mmol_L -> if (profileFunction.getUnits()==Constants.MGDL) DecimalFormatter.to0Decimal(v.dValue*Constants.MMOLL_TO_MGDL) + ";" + csvString(Units.Mg_Dl) else DecimalFormatter.to1Decimal(v.dValue) + ";" + csvString(Units.Mmol_L)