From 62cc365dc43d0a7a5182f2d37d2ab12cb259e620 Mon Sep 17 00:00:00 2001 From: Philoul Date: Sun, 1 Dec 2019 21:44:05 +0100 Subject: [PATCH] I tried to replace hard coded units for ISF, IC and U by formated text from strings (translated in WizardDialog.kt but not in WizardInfoDialog.kt) => It's not perfect but I don't know how to do it better so I pull this proposal: - for BG I think we could replace DecimalFormatter.to1Decimal by DecimalFormatter.to0Decimal but it also doesn't work (in french comma is replaced by point for bg but not for ISF i.e. "83,0 ISF: 50,0" => "83.0 SI: 50,0") but if we change default String format : format_bg_isf="%1$s ISF: %2$.1f" by "%1$.0f ISF: %2$.1f" I think it's good --- .../androidaps/plugins/treatments/dialogs/WizardInfoDialog.kt | 2 +- app/src/main/res/values/strings.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/dialogs/WizardInfoDialog.kt b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/dialogs/WizardInfoDialog.kt index 610031c472..7619f02f02 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/treatments/dialogs/WizardInfoDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/treatments/dialogs/WizardInfoDialog.kt @@ -65,7 +65,7 @@ class WizardInfoDialog : DialogFragment() { treatments_wizard_sbcheckbox.isChecked = JsonHelper.safeGetBoolean(json, "superbolusused") // Carbs //treatments_wizard_carbs.text = DecimalFormatter.to0Decimal(JsonHelper.safeGetDouble(json, "carbs")) + "g IC: " + DecimalFormatter.to1Decimal(JsonHelper.safeGetDouble(json, "ic")) - treatments_wizard_carbs.text = String.format(MainApp.gs(R.string.format_cob_ic), JsonHelper.safeGetDouble(json, "carbs"), JsonHelper.safeGetDouble(json, "ic")) + treatments_wizard_carbs.text = String.format(MainApp.gs(R.string.format_carbs_ic), JsonHelper.safeGetDouble(json, "carbs"), JsonHelper.safeGetDouble(json, "ic")) //treatments_wizard_carbsinsulin.text = DecimalFormatter.to2Decimal(JsonHelper.safeGetDouble(json, "insulincarbs")) + "U" treatments_wizard_carbsinsulin.text = StringUtils.formatInsulin(JsonHelper.safeGetDouble(json, "insulincarbs")) // Correction diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 3942e9c030..ab91efc2e0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1605,7 +1605,7 @@ Close Increasing max basal value because setting is lower than your max basal in profile Invalid message body - %1$s ISF: %2$.1f + %1$.0f ISF: %2$.1f %1$.0fg IC: %2$.1f %1$.1fg IC: %2$.1f %1$d%%