More i18n.

This commit is contained in:
Johannes Mockenhaupt 2017-10-27 21:51:15 +02:00
parent a8061b410c
commit 4bc970091e
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
4 changed files with 22 additions and 9 deletions

View file

@ -332,7 +332,7 @@ public class ComboPlugin implements PluginBase, PumpInterface {
EventOverviewBolusProgress event = EventOverviewBolusProgress.getInstance();
switch (state) {
case PROGRAMMING:
event.status = MainApp.sResources.getString(R.string.bolusprogramming);
event.status = MainApp.sResources.getString(R.string.combo_programming_bolus);
break;
case DELIVERING:
event.status = String.format(MainApp.sResources.getString(R.string.bolusdelivering), delivered);
@ -403,7 +403,7 @@ public class ComboPlugin implements PluginBase, PumpInterface {
@NonNull
private PumpEnactResult deliverBolus(final DetailedBolusInfo detailedBolusInfo) {
CommandResult bolusCmdResult = runCommand("Bolusing", new CommandExecution() {
CommandResult bolusCmdResult = runCommand(MainApp.sResources.getString(R.string.combo_action_bolusing), new CommandExecution() {
@Override
public CommandResult execute() {
return ruffyScripter.deliverBolus(detailedBolusInfo.insulin,
@ -475,7 +475,7 @@ public class ComboPlugin implements PluginBase, PumpInterface {
}
final int finalAdjustedPercent = adjustedPercent;
CommandResult commandResult = runCommand("Setting TBR", new CommandExecution() {
CommandResult commandResult = runCommand(MainApp.sResources.getString(R.string.combo_action_setting_tbr), new CommandExecution() {
@Override
public CommandResult execute() {
return ruffyScripter.setTbr(finalAdjustedPercent, durationInMinutes);
@ -528,7 +528,7 @@ public class ComboPlugin implements PluginBase, PumpInterface {
if (activeTemp == null || userRequested) {
/* v1 compatibility to sync DB to pump if they diverged (activeTemp == null) */
log.debug("cancelTempBasal: hard-cancelling TBR since user requested");
commandResult = runCommand("Cancelling TBR", new CommandExecution() {
commandResult = runCommand(MainApp.sResources.getString(R.string.combo_action_cancelling_tbr), new CommandExecution() {
@Override
public CommandResult execute() {
return ruffyScripter.cancelTbr();
@ -555,8 +555,8 @@ public class ComboPlugin implements PluginBase, PumpInterface {
// Set a fake neutral temp to avoid TBR cancel alert. Decide 90% vs 110% based on
// on whether the TBR we're cancelling is above or below 100%.
final int percentage = (activeTemp.percentRate > 100) ? 110 : 90;
log.debug("cancelTempBasal: changing tbr to " + percentage + "% for 15 mins.");
commandResult = runCommand("Setting TBR", new CommandExecution() {
log.debug("cancelTempBasal: changing TBR to " + percentage + "% for 15 mins.");
commandResult = runCommand(MainApp.sResources.getString(R.string.combo_action_setting_tbr), new CommandExecution() {
@Override
public CommandResult execute() {
return ruffyScripter.setTbr(percentage, 15);
@ -634,7 +634,7 @@ public class ComboPlugin implements PluginBase, PumpInterface {
pump.lastCmdResult = commandResult;
pump.state = commandResult.state;
// TODO are there cases when this check should NOT be performed? perform this explicitly or have a flag to skip this?
// TODO call this explicitely when needed after/before calling this?
if (checkTbrMisMatch) {
checkForTbrMismatch();
}

View file

@ -62,6 +62,7 @@ public class KeepAliveReceiver extends BroadcastReceiver {
boolean isStatusOutdated = lastConnection.getTime() + 15 * 60 * 1000L < System.currentTimeMillis();
boolean isBasalOutdated = Math.abs(profile.getBasal() - pump.getBaseBasalRate()) > pump.getPumpDescription().basalStep;
// TODO triggers on init already; don't (both missed readings and pump comms)
SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
if (isStatusOutdated && lastConnection.getTime() + 25 * 60 * 1000 < System.currentTimeMillis()) {
// TODO the alarm will trigger every 5m until the problem is resolved. That can get annoying quiet quickly if
@ -69,7 +70,8 @@ public class KeepAliveReceiver extends BroadcastReceiver {
// suppress this for another 25m if the message was dismissed?
// The alarm sound is played back as regular media, that means it might be muted if sound level is at 0
// a simple 'Enable/disable alarms' button on the actions tab?
Notification n = new Notification(Notification.PUMP_UNREACHABLE, "Pump unreachable", Notification.URGENT);
Notification n = new Notification(Notification.PUMP_UNREACHABLE,
MainApp.sResources.getString(R.string.combo_pump_state_unreachable), Notification.URGENT);
n.soundId = R.raw.alarm;
MainApp.bus().post(new EventNewNotification(n));
} else if (SP.getBoolean("syncprofiletopump", false) && !pump.isThisProfileSet(profile)) {

View file

@ -637,4 +637,9 @@
<string name="combo_last_bolus">Letzter Bolus</string>
<string name="combo_last_connection_time">Letzte Verbindung</string>
<string name="combo_stats">Statistiken</string>
<string name="combo_programming_bolus">Bolusabgabe wird vorbereitet</string>
<string name="combo_action_refreshing">Aktualisierung</string>
<string name="combo_action_cancelling_tbr">TBR wird abgebrochen</string>
<string name="combo_action_setting_tbr">TBR wird gesetzt</string>
<string name="combo_action_bolusing">Bolus wird abgegeben</string>
</resources>

View file

@ -748,10 +748,12 @@
<string name="reuse">reuse</string>
<string name="wearcontrol_title">Controls from Watch</string>
<string name="wearcontrol_summary">Set Temp-Targets and enter Treatments from the watch.</string>
<!-- TODO combo: still needed? -->
<string name="connectiontimedout">Connection timed out</string>
<string name="bolusstopping">Stopping bolus delivery</string>
<string name="bolusstopped">Bolus delivery stopped</string>
<string name="bolusprogramming">Programming pump for bolusing</string>
<string name="combo_programming_bolus">Programming pump for bolusing</string>
<string name="combo_refresh">Refresh</string>
<string name="combo_stats">Stats</string>
<string name="combo_pump_state_label">State</string>
@ -765,5 +767,9 @@
<string name="combo_pump_state_suspended_due_to_error">Suspended due to error</string>
<string name="combo_pump_state_suspended_by_user">Suspended by user</string>
<string name="combo_pump_state_running">Running</string>
<string name="combo_action_refreshing">Refreshing</string>
<string name="combo_action_cancelling_tbr">Cancelling TBR</string>
<string name="combo_action_setting_tbr">Setting TBR</string>
<string name="combo_action_bolusing">Bolusing</string>
</resources>