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
This commit is contained in:
Philoul 2019-12-01 21:44:05 +01:00
parent 0caf0d5f28
commit 62cc365dc4
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -1605,7 +1605,7 @@
<string name="close">Close</string>
<string name="increasingmaxbasal">Increasing max basal value because setting is lower than your max basal in profile</string>
<string name="smscommunicator_messagebody">Invalid message body</string>
<string name="format_bg_isf">%1$s ISF: %2$.1f</string>
<string name="format_bg_isf">%1$.0f ISF: %2$.1f</string>
<string name="format_carbs_ic">%1$.0fg IC: %2$.1f</string>
<string name="format_cob_ic">%1$.1fg IC: %2$.1f</string>
<string name="format_percent">%1$d%%</string>