diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboFragment.java index cff810d382..3929dbcacd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboFragment.java @@ -75,8 +75,6 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis public void onClick(View view) { switch (view.getId()) { case R.id.combo_refresh_button: - // TODO why is activity in ComboPump? - ComboPlugin.getPlugin().getPump().activity = MainApp.gs(R.string.combo_pump_action_refreshing); ConfigBuilderPlugin.getCommandQueue().readStatus("User request", null); break; case R.id.combo_alerts_button: @@ -213,19 +211,16 @@ public class ComboFragment extends SubscriberFragment implements View.OnClickLis if (bolus != null && bolus.timestamp + 6 * 60 * 60 * 1000 >= System.currentTimeMillis()) { long agoMsc = System.currentTimeMillis() - bolus.timestamp; double bolusMinAgo = agoMsc / 60d / 1000d; - double bolusHoursAgo = agoMsc / 60d / 60d / 1000d; - // TODO i18n + String unit = MainApp.gs(R.string.treatments_wizard_unit_label); + String ago; if ((agoMsc < 60 * 1000)) { - lastBolusView.setText(String.format("%.1f U (now)", bolus.amount)); + ago = MainApp.gs(R.string.combo_pump_connected_now); } else if (bolusMinAgo < 60) { - lastBolusView.setText(String.format("%.1f U (%d min ago)", bolus.amount, (int) bolusMinAgo)); -// lastBolusView.setText(getString(R.string.combo_last_bolus, bolus.amount, -// getString(R.string.minago, bolusMinAgo), DateUtil.timeString(bolus.timestamp))); + ago = DateUtil.minAgo(bolus.timestamp); } else { - lastBolusView.setText(String.format("%.1f U (%.1f h ago)", bolus.amount, bolusHoursAgo)); -// lastBolusView.setText(getString(R.string.combo_last_bolus, bolus.amount, -// String.format("%.1f", bolusHoursAgo) + getString(R.string.hoursago), DateUtil.timeString(bolus.timestamp))); + ago = DateUtil.hourAgo(bolus.timestamp); } + lastBolusView.setText(MainApp.gs(R.string.combo_last_bolus, bolus.amount, unit, ago)); } else { lastBolusView.setText(""); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java index 4cb2778adc..84659053fd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java @@ -633,7 +633,7 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf if (pumpHistoryChanged && percent > 110) { return new PumpEnactResult().success(false).enacted(false) - .comment("Rejecting high temp since calculation didn't consider recently changed pump history"); + .comment(MainApp.gs(R.string.combo_high_temp_rejected_due_to_pump_history_changes)); } int adjustedPercent = percent; diff --git a/app/src/main/java/info/nightscout/utils/DateUtil.java b/app/src/main/java/info/nightscout/utils/DateUtil.java index 86965621d2..1c3be368bf 100644 --- a/app/src/main/java/info/nightscout/utils/DateUtil.java +++ b/app/src/main/java/info/nightscout/utils/DateUtil.java @@ -127,6 +127,11 @@ public class DateUtil { return String.format(MainApp.sResources.getString(R.string.minago), mins); } + public static String hourAgo(long time) { + double hours = (System.currentTimeMillis() - time) / 1000d / 60 / 60; + return String.format(MainApp.sResources.getString(R.string.hoursago), hours); + } + private static LongSparseArray timeStrings = new LongSparseArray<>(); public static String timeStringFromSeconds(int seconds) { diff --git a/app/src/main/res/values-bg/strings.xml b/app/src/main/res/values-bg/strings.xml index 312b02b69a..dca1f6b0af 100644 --- a/app/src/main/res/values-bg/strings.xml +++ b/app/src/main/res/values-bg/strings.xml @@ -224,7 +224,6 @@ IOB на помпата Инсулин за деня Последен болус: - ч по-рано Грешни входящи данни Неправилна стойност Презареди профил diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 751d559130..f3559c9fa4 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -206,7 +206,6 @@ Provedeno Licenční ujednání ROZUMÍM A PORVZUJI - h zpět Nenalezen bluetooth adaptér Procent Obnovit profil diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 13e2c34d65..a12e6c3389 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -222,7 +222,6 @@ Ich verstehe und stimme zu DAS PROGRAMM DARF NICHT FÜR MEDIZINISCHE ENTSCHEIDUNGEN BENUTZT WERDEN. ES GIBT IN DIESEM PROJEKT KEINE GEWÄHRLEISTUNG ODER GARANTIERTE UNTERSTÜTZUNG IN IRGENDEINER ART. WENN DU DICH ENTSCHEIDEST ES ZU NUTZEN, HÄNGT DIE QUALITÄT UND LEISTUNGSFÄHIGKEIT DIESES PROJEKTES VON DIR SELBST AB. ES WIRD \"WIE BESEHEN\" ZUR VERFÜGUNG GESTELLT. SOLLTE SICH DAS PROGRAMM ALS FEHLERHAFT ERWEISEN, ÜBERNEHMEN SIE DIE KOSTEN ALLER NOTWENDIGEN KRANKHEITSKOSTEN, SERVICELEISTUNGEN, REPARATUREN ODER KORREKTUREN. Fehler beim Aktualisieren der Basalrate - "h her " SMS-Kommunikator Erlaubte Telefonnummern Auf Pumpenergebnis warten diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index b9fd9bff78..bb0220a7db 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -220,7 +220,6 @@ IOB αντλίας "Μονάδες ανά ημέρα " Τελευταίο Bolus: - ώρες πριν Μη έγκυρα δεδομένα Η τιμή δεν μπήκε σωστά Ξαναφορτώστε το προφίλ diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index aa59862b20..fc0e8f8ce8 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -214,7 +214,6 @@ Bomba IOB Unidades diarias Último bolo: - h antes Datos invalidos Valor no establecido correctamente Recargar Perfil diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 148b1aab2d..89f8ca917c 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -178,7 +178,6 @@ Stato Micro Glucosio Sensore - h fa Importa impstazioni da Inizzializzazione INS diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index 3b62dffeab..233d7ce73c 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -225,7 +225,6 @@ 펌프 IOB 일 인슐린 총량 최근 식사주입: - 시간 전 사용할수 없는 입력 데이터 값이 제대로 설정되지 않았습니다 Reload profile diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index ca434cc35a..40f477e0c6 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -419,7 +419,6 @@ STOP INGEDRUKT Kalibratie Oude gegevens druk \"VERNIEUW\" a.u.b. - u geleden %d min geleden Berekening Dosis diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 1535d82c26..f0bebf2474 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -221,7 +221,6 @@ палец сенсор ВЕРХНЯЯ отметка - час. назад импортировать настройки из инициализация... ИНС diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index b27b70da43..79e286e44e 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -206,9 +206,8 @@ Sensor HÖG markering timmar - h sedan Importera inställningar från - Startar... + Startar… Ogiltig profil !!! IOB Italienska diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index cb9ca63a59..5d5f1f54e2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -235,7 +235,7 @@ Pump IOB Daily units Last bolus - h ago + %dh ago Invalid input data Value not set properly Reload profile @@ -820,7 +820,7 @@ Activity No connection for %d min %d%% (%d min remaining) - %.1f U (%s, %s) + %.1f %s (%s) Initializing Disconnected Suspended due to error @@ -869,5 +869,6 @@ Reading basal profile The pump history has changed after the bolus calculation was performed. The bolus was not delivered. Please recalculate if a bolus is still needed. If the same bolus amount is required, please wait a minute since boluses with the same amount are blocked when requested with less than tow minutes between them for safety (regardless of whether they were administered or not). Bolus successfully delivered, but adding the treatment entry failed. This can happen if two small boluses of the same size are administered within the last two minutes. Please check the pump history and treatment entries and use the Careportal to add missing entries. Make sure not to add any entries for the exact same minute and same amount. + Rejecting high temp since calculation didn\'t consider recently changed pump history