careportal eventtypes translations

This commit is contained in:
Milos Kozak 2016-07-15 19:45:03 +02:00
parent 871eaa718d
commit c5d40b3a6c
4 changed files with 78 additions and 4 deletions

View file

@ -53,6 +53,7 @@ import info.nightscout.utils.DateUtil;
import info.nightscout.utils.PlusMinusEditText; import info.nightscout.utils.PlusMinusEditText;
import info.nightscout.utils.SafeParse; import info.nightscout.utils.SafeParse;
import info.nightscout.utils.ToastUtils; import info.nightscout.utils.ToastUtils;
import info.nightscout.utils.Translator;
public class NewNSTreatmentDialog extends DialogFragment implements View.OnClickListener, DatePickerDialog.OnDateSetListener, TimePickerDialog.OnTimeSetListener { public class NewNSTreatmentDialog extends DialogFragment implements View.OnClickListener, DatePickerDialog.OnDateSetListener, TimePickerDialog.OnTimeSetListener {
private static Logger log = LoggerFactory.getLogger(NewNSTreatmentDialog.class); private static Logger log = LoggerFactory.getLogger(NewNSTreatmentDialog.class);
@ -421,7 +422,7 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick
if (data.has("eventType")) { if (data.has("eventType")) {
ret += getString(R.string.careportal_newnstreatment_eventtype); ret += getString(R.string.careportal_newnstreatment_eventtype);
ret += ": "; ret += ": ";
ret += data.get("eventType"); // TODO: translate this too ret += Translator.translate(data.getString("eventType"));
ret += "\n"; ret += "\n";
} }
if (data.has("glucose")) { if (data.has("glucose")) {
@ -433,7 +434,7 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick
if (data.has("glucoseType")) { if (data.has("glucoseType")) {
ret += getString(R.string.careportal_newnstreatment_glucosetype); ret += getString(R.string.careportal_newnstreatment_glucosetype);
ret += ": "; ret += ": ";
ret += data.get("glucoseType"); // TODO: translate this too ret += Translator.translate(data.getString("glucoseType"));
ret += "\n"; ret += "\n";
} }
if (data.has("carbs")) { if (data.has("carbs")) {

View file

@ -0,0 +1,63 @@
package info.nightscout.utils;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
/**
* Created by mike on 15.07.2016.
*/
public class Translator {
public static String translate(String text) {
switch (text) {
case "BG Check":
return MainApp.sResources.getString(R.string.careportal_bgcheck);
case "Snack Bolus":
return MainApp.sResources.getString(R.string.careportal_snackbolus);
case "Meal Bolus":
return MainApp.sResources.getString(R.string.careportal_mealbolus);
case "Correction Bolus":
return MainApp.sResources.getString(R.string.careportal_correctionbolus);
case "Carb Correction":
return MainApp.sResources.getString(R.string.careportal_carbscorrection);
case "Combo Bolus":
return MainApp.sResources.getString(R.string.careportal_combobolus);
case "Announcement":
return MainApp.sResources.getString(R.string.careportal_announcement);
case "Note":
return MainApp.sResources.getString(R.string.careportal_note);
case "Question":
return MainApp.sResources.getString(R.string.careportal_question);
case "Exercise":
return MainApp.sResources.getString(R.string.careportal_exercise);
case "Site Change":
return MainApp.sResources.getString(R.string.careportal_pumpsitechange);
case "Sensor Start":
return MainApp.sResources.getString(R.string.careportal_cgmsensorstart);
case "Sensor Change":
return MainApp.sResources.getString(R.string.careportal_cgmsensorinsert);
case "Insulin Change":
return MainApp.sResources.getString(R.string.careportal_insulincartridgechange);
case "Temp Basal Start":
return MainApp.sResources.getString(R.string.careportal_tempbasalstart);
case "Temp Basal End":
return MainApp.sResources.getString(R.string.careportal_tempbasalend);
case "Profile Switch":
return MainApp.sResources.getString(R.string.careportal_profileswitch);
case "Temporary Target":
return MainApp.sResources.getString(R.string.careportal_temporarytarget);
case "Temporary Target Cancel":
return MainApp.sResources.getString(R.string.careportal_temporarytargetcancel);
case "OpenAPS Offline":
return MainApp.sResources.getString(R.string.careportal_openapsoffline);
case "Finger":
return MainApp.sResources.getString(R.string.glucosetype_finger);
case "Sensor":
return MainApp.sResources.getString(R.string.glucosetype_sensor);
case "Manual":
return MainApp.sResources.getString(R.string.glucosetype_manual);
}
return text;
}
}

View file

@ -234,13 +234,18 @@
<string name="success">Úspěch</string> <string name="success">Úspěch</string>
<string name="virtualpump_lastconnection_label">Poslední spojení:</string> <string name="virtualpump_lastconnection_label">Poslední spojení:</string>
<string name="canceltemp">Zrušit dočasný bazál</string> <string name="canceltemp">Zrušit dočasný bazál</string>
<string name="bolusdelivered">Bolus %.2fU aplikován úspěšně</string> <string formatted="false" name="bolusdelivered">Bolus %.2fU aplikován úspěšně</string>
<string name="bolusfailed">Chyba při aplikování bolusu</string> <string name="bolusfailed">Chyba při aplikování bolusu</string>
<string name="remotebolusnotallowed">Vzdálený bolus není momentálně povolen</string> <string name="remotebolusnotallowed">Vzdálený bolus není momentálně povolen</string>
<string name="replywithcode">K potvzení bolusu %.2fU odpověz SMS s kódem %s</string> <string formatted="false" name="replywithcode">K potvzení bolusu %.2fU odpověz SMS s kódem %s</string>
<string name="smscommunicator">SMS komunikátor</string> <string name="smscommunicator">SMS komunikátor</string>
<string name="smscommunicator_allowednumbers">Povolená tel. čísla</string> <string name="smscommunicator_allowednumbers">Povolená tel. čísla</string>
<string name="smscommunicator_allowednumbers_summary">+XXXXXXXXXX;+YYYYYYYYYY</string> <string name="smscommunicator_allowednumbers_summary">+XXXXXXXXXX;+YYYYYYYYYY</string>
<string name="smscommunicator_remotebolusingallowed">Povolit posílání bolusu přes SMS</string> <string name="smscommunicator_remotebolusingallowed">Povolit posílání bolusu přes SMS</string>
<string name="waitingforpumpresult">Čekání na výsledek</string> <string name="waitingforpumpresult">Čekání na výsledek</string>
<string name="careportal_temporarytarget">Dočasný cíl</string>
<string name="careportal_temporarytargetcancel">Dočasný cíl konec</string>
<string name="glucosetype_finger">Glukoměr</string>
<string name="glucosetype_manual">Jiný</string>
<string name="glucosetype_sensor">Senzor</string>
</resources> </resources>

View file

@ -252,5 +252,10 @@
<string formatted="false" name="bolusdelivered">Bolus %.2fU delivered successfully</string> <string formatted="false" name="bolusdelivered">Bolus %.2fU delivered successfully</string>
<string name="smscommunicator_remotebolusingallowed">Allow remote bolusing via SMS</string> <string name="smscommunicator_remotebolusingallowed">Allow remote bolusing via SMS</string>
<string name="remotebolusnotallowed">Remote bolus not allowed</string> <string name="remotebolusnotallowed">Remote bolus not allowed</string>
<string name="glucosetype_finger">Finger</string>
<string name="glucosetype_sensor">Sensor</string>
<string name="glucosetype_manual">Manual</string>
<string name="careportal_temporarytarget">Temporary Target</string>
<string name="careportal_temporarytargetcancel">Temporary Target Cancel</string>
</resources> </resources>