Commit 851c3c99 authored by Toni Beier's avatar Toni Beier

Merge branch 'englische-lokalisierung' into 'master'

Englische Lokalisierung

Closes #27

See merge request !22
parents 1f06d5e4 8816c498
Pipeline #25438 passed with stages
in 2 minutes and 37 seconds
......@@ -10,14 +10,12 @@ package de.tu_chemnitz.wlan;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.AssetManager;
import android.content.res.Resources;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiEnterpriseConfig;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.util.Base64;
import android.util.Log;
import android.widget.Toast;
......@@ -29,11 +27,9 @@ import com.android.volley.VolleyError;
import com.android.volley.VolleyLog;
import com.android.volley.toolbox.StringRequest;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
......@@ -51,8 +47,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.regex.Pattern;
import java.util.stream.Stream;
class Helper {
......@@ -470,12 +464,12 @@ class Helper {
static void quickApply(Context context, String json) {
if (Helper.buildWifiConfig(json, context)) {
if (Helper.applyWifiConfig(context)) {
Toast.makeText(context, Helper.lastWifi.SSID + " erfolgreich angewendet!", Toast.LENGTH_LONG).show();
Toast.makeText(context, context.getResources().getString(R.string.message_last_wifi_ssid_successfully_applied, Helper.lastWifi.SSID), Toast.LENGTH_LONG).show();
} else {
Toast.makeText(context, "Konnte Konfiguration nicht anwenden!\nLöschen Sie ggf. bestehende Konfiguration von " + Helper.lastWifi.SSID + ".", Toast.LENGTH_LONG).show();
Toast.makeText(context, context.getResources().getString(R.string.message_not_successfully_applied_last_wifi_ssid, Helper.lastWifi.SSID), Toast.LENGTH_LONG).show();
}
} else {
Toast.makeText(context, "Ungültiges Format!", Toast.LENGTH_LONG).show();
Toast.makeText(context, context.getResources().getString(R.string.msg_invalid_format), Toast.LENGTH_LONG).show();
}
}
......@@ -595,7 +589,7 @@ class Helper {
WifiManager wifi = (WifiManager)context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
if (wifi.isWifiEnabled())
{
MainActivity.TickLine tick = new MainActivity.TickLine(true, "WLAN ist aktiviert", "Verfügbarkeit", false);
MainActivity.TickLine tick = new MainActivity.TickLine(true, context.getResources().getString(R.string.tickline_message_wifi_enabled), context.getResources().getString(R.string.msg_available ), false);
tick._tag = status_tags[0];
list.add(tick);
......@@ -627,7 +621,7 @@ class Helper {
ticked = false;
}
list.add(new MainActivity.TickLine(ticked, message, context.getString(R.string.tickline_message_user_identity), false));
list.add(new MainActivity.TickLine(ticked, message, context.getString(R.string.tickline_category_user_identity), false));
if (currentConfig.enterpriseConfig.getAnonymousIdentity().length()>0) {
String anonymousIdentity = currentConfig.enterpriseConfig.getAnonymousIdentity();
......@@ -639,10 +633,10 @@ class Helper {
ticked = true;
}
} else {
message="Nicht gesetzt";
message= context.getResources().getString(R.string.msg_not_set);
ticked = false;
}
list.add(new MainActivity.TickLine(ticked, message, "Anonyme Identität", true));
list.add(new MainActivity.TickLine(ticked, message, context.getResources().getString(R.string.tickline_category_anonymous_identity), true));
ticked = true;
......@@ -719,12 +713,12 @@ class Helper {
list.add(new MainActivity.TickLine(ticked, message, "Server Subject Match", true));
message = "Technische Parameter ";
message = context.getResources().getString(R.string.tickline_message_techincal_parameters);
if (list.get(3).ticked && list.get(4).ticked && list.get(5).ticked && list.get(6).ticked) {
message += "sicher";
message += " " + context.getResources().getString(R.string.tickline_message_are_correct);
ticked = true;
} else {
message += "unsicher";
message += " " + context.getResources().getString(R.string.tickline_message_not_correct);
ticked = false;
}
list.add(3, new MainActivity.TickLine(ticked, message, "", false));
......@@ -740,20 +734,20 @@ class Helper {
}
}
} else {
MainActivity.TickLine tick = new MainActivity.TickLine(false, "WLAN ist deaktiviert", "Verfügbarkeit", false);
MainActivity.TickLine tick = new MainActivity.TickLine(false, context.getResources().getString(R.string.tickline_message_wifi_disabled), context.getResources().getString(R.string.msg_available), false);
tick._tag = status_tags[0];
list.add(tick);
}
MainActivity.TickLine tick = getByTag(list, status_tags[0]);
if (list.size() <= 1 && tick != null && tick.ticked) {
list.add(new MainActivity.TickLine(false, "Kein " + ssid + " konfiguriert", "Verfügbarkeit", false));
list.add(new MainActivity.TickLine(false, context.getResources().getString(R.string.message_no_ssid_configuration, ssid), context.getResources().getString(R.string.msg_available), false));
}
return list;
}
static void getInstallStatus(Context context) {
static void getInstallStatus(final Context context) {
ticks_install = new ArrayList<>();
......@@ -767,14 +761,14 @@ class Helper {
MainActivity.TickLine tick;
if (!response.startsWith("{")) {
// we got no JSON, we are not logged in
tick = new MainActivity.TickLine(false, "Nicht angemeldet", "WTC-Login", false);
tick = new MainActivity.TickLine(false, context.getResources().getString(R.string.tickline_message_not_logged_in), context.getResources().getString(R.string.message_wtc_login), false);
} else {
// logged in && can fetch username
username = getUsername(response);
if (username == null) {
tick = new MainActivity.TickLine(false, "Konnte Benutzer nicht abrufen", "WTC-Login", false);
tick = new MainActivity.TickLine(false, context.getResources().getString(R.string.msg_not_receive_user), context.getResources().getString(R.string.message_wtc_login), false);
} else {
tick = new MainActivity.TickLine(true, "Angemeldet als " + username, "WTC-Login", false);
tick = new MainActivity.TickLine(true, context.getResources().getString(R.string.message_logged_in_as, username), context.getResources().getString(R.string.message_wtc_login), false);
}
}
tick._tag = install_order[0];
......@@ -784,7 +778,7 @@ class Helper {
@Override
public void onErrorResponse(VolleyError error) {
Log.e("getInstallStatus", "check user", error);
MainActivity.TickLine tick = new MainActivity.TickLine(false, "Fehler", "WTC-Login", false);
MainActivity.TickLine tick = new MainActivity.TickLine(false, context.getResources().getString(R.string.error_message), context.getResources().getString(R.string.message_wtc_login), false);
tick._tag = install_order[0];
ticks_install.add(tick);
}
......@@ -792,9 +786,9 @@ class Helper {
MainActivity.TickLine tick;
if (buildFromPreferences(context)) {
tick = new MainActivity.TickLine(true, "Konfiguration erhalten", "Gerätepasswort", false);
tick = new MainActivity.TickLine(true, context.getResources().getString(R.string.msg_configuration_received), context.getResources().getString(R.string.msg_device_password), false);
} else {
tick = new MainActivity.TickLine(false, "Anfrage ausstehend", "Gerätepasswort", false);
tick = new MainActivity.TickLine(false, context.getResources().getString(R.string.msg_request_pending), context.getResources().getString(R.string.msg_device_password), false);
}
tick._tag = install_order[1];
ticks_install.add(tick);
......@@ -807,12 +801,12 @@ class Helper {
int state = getReadyState(response);
MainActivity.TickLine tick;
if (state < 0) {
tick = new MainActivity.TickLine(false, "Konnte nicht angewendet werden!", "Passwort aktiv", false);
tick = new MainActivity.TickLine(false, context.getResources().getString(R.string.msg_could_not_be_used), context.getResources().getString(R.string.msg_password_active), false);
} else if (state == 0) {
tick = new MainActivity.TickLine(false, "In Arbeit", "Passwort aktiv", false);
tick = new MainActivity.TickLine(false, context.getResources().getString(R.string.msg_in_progress), context.getResources().getString(R.string.msg_password_active), false);
tick.working = true;
} else {
tick = new MainActivity.TickLine(true, "OK", "Passwort aktiv", false);
tick = new MainActivity.TickLine(true, context.getResources().getString(R.string.okay), context.getResources().getString(R.string.msg_password_active), false);
}
tick._tag = install_order[2];
ticks_install.add(tick);
......@@ -828,31 +822,31 @@ class Helper {
MainActivity.TickLine login = getByTag(ticks_install, install_order[0]);
if (login != null) {
login.ticked = false;
login.text = "Anmeldung fehlgeschlagen";
login.text = context.getResources().getString(R.string.msg_login_failed);
}
}
MainActivity.TickLine tick = new MainActivity.TickLine(false, "Netzwerkfehler", "Passwort aktiv", false);
MainActivity.TickLine tick = new MainActivity.TickLine(false, context.getResources().getString(R.string.msg_network_error), context.getResources().getString(R.string.msg_password_active), false);
tick._tag = install_order[2];
ticks_install.add(tick);
}
}, Request.Method.GET);
tick = null;
} else {
tick = new MainActivity.TickLine(false, "Nicht überprüfbar", "Passwort aktiv", false);
tick = new MainActivity.TickLine(false, context.getResources().getString(R.string.msg_not_verifiable), context.getResources().getString(R.string.msg_password_active), false);
}
} else {
tick = new MainActivity.TickLine(false, "Anfrage ausstehend", "Passwort aktiv", false);
tick = new MainActivity.TickLine(false, context.getResources().getString(R.string.msg_request_pending), context.getResources().getString(R.string.msg_password_active), false);
}
if (tick != null) {
tick._tag = install_order[2];
ticks_install.add(tick);
}
tick = new MainActivity.TickLine(false, "Ausstehend", "Konfiguration angewendet", false);
tick = new MainActivity.TickLine(false, context.getResources().getString(R.string.msg_pending), context.getResources().getString(R.string.msg_configuration_applied), false);
tick._tag = install_order[3];
ticks_install.add(tick);
} else {
MainActivity.TickLine tick = new MainActivity.TickLine(false, "Kein Internetzugriff!", "Verfügbarkeit", false);
MainActivity.TickLine tick = new MainActivity.TickLine(false, context.getResources().getString(R.string.tickline_message_not_connected_to_internet), context.getResources().getString(R.string.msg_available), false);
tick._tag = install_order[3];
ticks_install.add(tick);
}
......
......@@ -13,7 +13,6 @@ import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
......@@ -114,8 +113,8 @@ public class MainActivity extends AppCompatActivity {
Helper.quickApply(this, total.toString());
}
} catch (Exception e) {
Toast.makeText(this, "Konnte Datei nicht lesen oder ungültiges Format!", Toast.LENGTH_LONG).show();
Log.e("ACTION_VIEW - handler", "Something went wrong!", e);
Toast.makeText(this, getResources().getString(R.string.error_message_invalid_format), Toast.LENGTH_LONG).show();
Log.e("ACTION_VIEW - handler", getResources().getString(R.string.error_message_something_went_wrong), e);
}
}
......@@ -151,7 +150,7 @@ public class MainActivity extends AppCompatActivity {
networkChangeRecieverIntentFilter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
this.networkChangeReciever = new NetworkChangeReciever();
Log.d("network_change_broadcast", "register receiver");
Log.d("networkChange_broadcast", "register receiver");
this.registerReceiver(this.networkChangeReciever, networkChangeRecieverIntentFilter);
}
......@@ -192,7 +191,7 @@ public class MainActivity extends AppCompatActivity {
protected void onPause() {
super.onPause();
Log.d("network_change_broadcast", "unregister receiver");
Log.d("networkChange_broadcast", "unregister receiver");
this.unregisterReceiver(this.networkChangeReciever);
}
......@@ -203,7 +202,7 @@ public class MainActivity extends AppCompatActivity {
@Override
public void run() {
boolean hasInternet = Helper.hasInternet(MainActivity.this);
TickLine tick = new TickLine(hasInternet, hasInternet ? "Mit Internet verbunden" : "Kein Internetzugang", "Verbindung", false);
TickLine tick = new TickLine(hasInternet, hasInternet ? getResources().getString(R.string.tickline_message_connected_to_internet) : getResources().getString(R.string.tickline_message_not_connected_to_internet), getResources().getString(R.string.tickline_category_connected), false);
tick._tag = Helper.status_tags[1];
ticks_status.add(0, tick);
}
......@@ -212,7 +211,7 @@ public class MainActivity extends AppCompatActivity {
KeyguardManager km = (KeyguardManager)MainActivity.this.getApplicationContext().getSystemService(Context.KEYGUARD_SERVICE);
boolean isSecure = km.isKeyguardSecure();
TickLine tick = new TickLine(isSecure, isSecure ? "Sperrbildschirm gesetzt" : "PIN- oder Passwortsperre erforderlich", "", false);
TickLine tick = new TickLine(isSecure, isSecure ? getResources().getString(R.string.tickline_message_locked_screen_set) : getResources().getString(R.string.tickline_message_screen_lock_required), "", false);
tick._tag = Helper.status_tags[2];
ticks_status.add(tick);
......@@ -240,7 +239,9 @@ public class MainActivity extends AppCompatActivity {
}
Button btn = new Button(this);
btn.setText(valid ? "Konfiguration " + (configured ? "erneut " : "") + "starten" : "Fehler lösen");
//btn.setText(valid ? getResources().getString(R.string.configuration) + (configured ? getResources().getString(R.string.msg_again) : "") + getResources().getString(R.string.msg_start) : getResources().getString(R.string.msg_resolve));
btn.setText(valid ? (configured ? getResources().getString(R.string.msg_configure_again) : getResources().getString(R.string.msg_start_configure)) : getResources().getString(R.string.msg_resolve_configuration));
btn.setTextSize(18);
btn.setOnClickListener(new View.OnClickListener() {
@Override
......@@ -277,7 +278,7 @@ public class MainActivity extends AppCompatActivity {
if (canLeaveInstall) {
Button btn = new Button(this);
btn.setText("Verlassen");
btn.setText(getResources().getString(R.string.cancel));
btn.setTextSize(18);
btn.setOnClickListener(new View.OnClickListener() {
@Override
......@@ -322,7 +323,7 @@ public class MainActivity extends AppCompatActivity {
tick = Helper.getByTag(ticks_status, Helper.status_tags[2]);
if (tick == null || !tick.ticked) { // no lockscreen
AlertDialog alert = new AlertDialog.Builder(this).create();
alert.setTitle("Sperrbildschirm");
alert.setTitle(getResources().getString(R.string.alert_box_title_locked_screen));
/*LinearLayout ll = new LinearLayout(this);
ll.setOrientation(LinearLayout.VERTICAL);
......@@ -335,9 +336,9 @@ public class MainActivity extends AppCompatActivity {
ll.addView(tv, params);
builder.setView(ll);*/
alert.setMessage("Bitte setze dir einen PIN- oder Passwort-Sperrbildschirm.");
alert.setMessage(getResources().getString(R.string.alert_box_message_put_pin_password_lock));
alert.setCancelable(false);
alert.setButton(AlertDialog.BUTTON_NEUTRAL, "OK", new DialogInterface.OnClickListener() {
alert.setButton(AlertDialog.BUTTON_NEUTRAL, getResources().getString(R.string.okay), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
startActivity(new Intent(Settings.ACTION_SECURITY_SETTINGS));
......@@ -351,7 +352,7 @@ public class MainActivity extends AppCompatActivity {
tick = Helper.getByTag(ticks_status, Helper.status_tags[1]);
if (tick == null || !tick.ticked) { // no internet
AlertDialog alert = new AlertDialog.Builder(this).create();
alert.setTitle("Internetzugriff");
alert.setTitle(getResources().getString(R.string.alext_box_title_internet_access));
/*LinearLayout ll = new LinearLayout(this);
ll.setOrientation(LinearLayout.VERTICAL);
......@@ -414,19 +415,19 @@ public class MainActivity extends AppCompatActivity {
if (hasConfig && useCache == 0) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Neue Konfiguration anfordern?");
builder.setTitle(getResources().getString(R.string.alert_box_title_request_new_config));
builder.setMessage("Es wurde bereits eine Konfiguration geladen, soll diese verwendet werden?");
builder.setMessage(getResources().getString(R.string.alert_box_message_request_new_config));
// Set up the buttons
builder.setPositiveButton("Ja", new DialogInterface.OnClickListener() {
builder.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
useCache = 1;
setupEduroam();
}
});
builder.setNegativeButton("Nein", new DialogInterface.OnClickListener() {
builder.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
useCache = -1;
......@@ -446,13 +447,13 @@ public class MainActivity extends AppCompatActivity {
if (Helper.device_name.equals("") && (!hasConfig || useCache < 0)) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Gerätename");
builder.setTitle(getResources().getString(R.string.alert_box_title_device_name));
LinearLayout ll = new LinearLayout(this);
ll.setOrientation(LinearLayout.VERTICAL);
TextView tv = new TextView(this);
tv.setText("Bitte gib einen Namen für dieses Gerät an!\nDer Name kann später verwendet werden um das gerätespezifische Passwort im IdM-Portal zu verwalten.");
tv.setText(getResources().getString(R.string.alert_box_message_device_name));
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
params.setMargins(10, 0, 10, 0);
......@@ -462,21 +463,22 @@ public class MainActivity extends AppCompatActivity {
final EditText input = new EditText(this);
input.setInputType(InputType.TYPE_CLASS_TEXT);
if (Helper.device_name.equals(""))
input.setText(Build.MANUFACTURER + " - " + Build.MODEL + " (API " + Build.VERSION.SDK_INT + ")");
input.setText(getApplicationContext().getResources().getString(R.string.input_device_name, Build.MANUFACTURER, Build.MODEL, Build.VERSION.SDK_INT));
//input.setText(Build.MANUFACTURER + " - " + Build.MODEL + " (API " + Build.VERSION.SDK_INT + ")");
else
input.setText(Helper.device_name);
ll.addView(input, params);
builder.setView(ll);
// Set up the buttons
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
builder.setPositiveButton(getResources().getString(R.string.okay), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Helper.device_name = input.getText().toString();
setupEduroam();
}
});
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
builder.setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
......@@ -501,11 +503,11 @@ public class MainActivity extends AppCompatActivity {
}
if (login == null) {
AlertDialog alert = new AlertDialog.Builder(this).create();
alert.setTitle("Loginfehler");
alert.setTitle(getResources().getString(R.string.alert_box_title_login_error));
alert.setMessage("Konnte nicht feststellen ob Benutzer eingeloggt ist, bitte später erneut versuchen.");
alert.setMessage(getResources().getString(R.string.msg_user_not_found));
alert.setCancelable(false);
alert.setButton(AlertDialog.BUTTON_NEUTRAL, "OK", new DialogInterface.OnClickListener() {
alert.setButton(AlertDialog.BUTTON_NEUTRAL, getResources().getString(R.string.okay), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
inInstall = false;
......@@ -543,7 +545,7 @@ public class MainActivity extends AppCompatActivity {
TickLine completed = Helper.getByTag(Helper.ticks_install, Helper.install_order[3]);
if (completed != null) {
completed.ticked = res;
completed.text = res ? "Installation abgeschlossen!" : "Fehlgeschlagen, löschen Sie ggf. bestehende eduroam Konfiguration!";
completed.text = res ? getResources().getString(R.string.msg_installation_complete) : getResources().getString(R.string.msg_installation_failed);
}
MainActivity.this.runOnUiThread(new Runnable() {
@Override
......@@ -559,7 +561,7 @@ public class MainActivity extends AppCompatActivity {
} else if (!isReady.working) {
TickLine completed = Helper.getByTag(Helper.ticks_install, Helper.install_order[3]);
if (completed != null) {
completed.text = "Nicht ausführbar!";
completed.text = getResources().getString(R.string.msg_not_executed);
}
Helper.deletePreferences(MainActivity.this);
MainActivity.this.runOnUiThread(new Runnable() {
......@@ -587,15 +589,13 @@ public class MainActivity extends AppCompatActivity {
@Override
public void run() {
final AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle("Verbindungsprüfung");
builder.setTitle(getResources().getString(R.string.alert_box_title_connection_check));
LinearLayout ll = new LinearLayout(MainActivity.this);
ll.setOrientation(LinearLayout.VERTICAL);
TextView tv = new TextView(MainActivity.this);
tv.setText(
"Soll jetzt zu \"eduroam\" verbunden werden?\nDafür müssen Sie in Reichweite des WLANs sein (in Uninähe).\n" +
"Die Verbindungsprüfung verläuft im Hintergrund und kann bis zu einer Minute dauern.");
tv.setText(getResources().getString(R.string.msg_connection_check_alert_box));
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
params.setMargins(10, 0, 10, 0);
......@@ -605,9 +605,9 @@ public class MainActivity extends AppCompatActivity {
// inner dialog
final AlertDialog alert = new AlertDialog.Builder(MainActivity.this).create();
alert.setTitle("Verbindungstest");
alert.setTitle(getResources().getString(R.string.alert_box_title_connection_test));
alert.setCancelable(false);
alert.setButton(AlertDialog.BUTTON_NEUTRAL, "OK", new DialogInterface.OnClickListener() {
alert.setButton(AlertDialog.BUTTON_NEUTRAL, getResources().getString(R.string.okay), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
......@@ -615,7 +615,7 @@ public class MainActivity extends AppCompatActivity {
});
// Set up the buttons
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
builder.setPositiveButton(getResources().getString(R.string.okay), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
......@@ -676,17 +676,15 @@ public class MainActivity extends AppCompatActivity {
Log.e("postInstallCheck", "hasInternet join", e);
}
alert.setMessage(Helper.lastHasInternet ?
"Verbindung erfolgreich hergestellt!" :
"Kein Internetzugriff.\nProbieren Sie es später erneut.");
alert.setMessage(Helper.lastHasInternet ? getResources().getString(R.string.msg_connection_established_success) : getResources().getString(R.string.msg_connection_error));
alert.show();
} else {
alert.setMessage("Konnte eduroam nicht finden.\nProbieren Sie es später erneut.");
alert.setMessage(getResources().getString(R.string.msg_connection_not_found));
}
} else {
// currently unused
alert.setMessage("Konnte keine Verbindung herstellen.\nProbieren Sie es später erneut.");
alert.setMessage(getResources().getString(R.string.msg_connection_not_establish));
}
}
};
......@@ -698,10 +696,7 @@ public class MainActivity extends AppCompatActivity {
@Override
public void run() {
connectionTest.get().btn_cancel_Click(null);
alert.setMessage(
"Konnte kein \"eduroam\" finden.\nSie müssen sich in Reichweite des WLAN-Zugangs (in Uninähe) befinden.\n" +
"Versuchen Sie es später erneut.");
alert.setMessage( getResources().getString(R.string.msg_eduroam_not_foud));
alert.show();
}
});
......@@ -720,12 +715,12 @@ public class MainActivity extends AppCompatActivity {
//connectionTest.get().registerReceiver(ConnectionTestActivity.receiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
} else {
alert.setMessage("Konnte keine Verbindung herstellen.\nProbieren Sie es später erneut.");
alert.setMessage(getResources().getString(R.string.msg_connection_not_establish));
alert.show();
}
}
});
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
builder.setNegativeButton(getResources().getString(R.string.cancel), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
......@@ -742,12 +737,12 @@ public class MainActivity extends AppCompatActivity {
if (resultCode == Activity.RESULT_OK) {
TickLine login = Helper.getByTag(Helper.ticks_install, Helper.install_order[0]);
if (login != null) {
login.text = "Angemeldet als " + username;
login.text = getResources().getString(R.string.message_logged_in_as, username);
login.ticked = true;
}
TickLine got_config = Helper.getByTag(Helper.ticks_install, Helper.install_order[1]);
if (got_config != null) {
got_config.text = "Konfiguration erhalten";
got_config.text = getResources().getString(R.string.msg_configuration_received);
got_config.ticked = true;
}
redrawLayoutInstall();
......@@ -755,11 +750,11 @@ public class MainActivity extends AppCompatActivity {
} else {
// resultCode == Activity.RESULT_CANCELED
AlertDialog alert = new AlertDialog.Builder(this).create();
alert.setTitle("Loginfehler");
alert.setTitle(getResources().getString(R.string.alert_box_title_login_error));
alert.setMessage("Falls Sie den Login nicht abgebrochen haben, versuchen sie es bitte erneut, es scheint ein Fehler aufgetreten zu sein.");
alert.setMessage(getResources().getString(R.string.msg_login_failed_alertbox));
alert.setCancelable(false);
alert.setButton(AlertDialog.BUTTON_NEUTRAL, "OK", new DialogInterface.OnClickListener() {
alert.setButton(AlertDialog.BUTTON_NEUTRAL, getResources().getString(R.string.okay), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
......@@ -842,10 +837,10 @@ public class MainActivity extends AppCompatActivity {
@Override
public void onReceive(Context context, Intent intent) {
try {
Log.d("network_change_broadcast", "Get action: " + intent.getAction());
Log.d("networkChange_broadcast", "Get action: " + intent.getAction());
recomputeLayout();
} catch (Exception exception) {
Log.d("network_change_broadcast", "Error while recompute ticklist", exception);
Log.d("networkChange_broadcast", "Error while recompute ticklist", exception);
}
}
}
......
......@@ -10,7 +10,7 @@
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Verbindungstest"
android:text="@string/alert_box_title_connection_test"
android:textSize="18sp"
tools:layout_editor_absoluteX="16dp"
tools:layout_editor_absoluteY="16dp"
......@@ -26,7 +26,7 @@
android:layout_alignStart="@+id/textView"
android:layout_below="@+id/textView"
android:layout_marginTop="15dp"
android:text="Verbindungstest wird ausgeführt"
android:text="@string/msg_connection_check_alert_box"
tools:layout_editor_absoluteX="16dp"
tools:layout_editor_absoluteY="50dp" />
......@@ -38,5 +38,5 @@
android:layout_below="@+id/textView2"
android:layout_marginTop="18dp"
android:onClick="btn_cancel_Click"
android:text="Abbrechen" />
android:text="@string/cancel" />
</RelativeLayout>
<resources>
<string name="edurom_error_old_configuration">Outdated anonymous identity: %1$s</string>
<string name="tickline_message_connected_to_internet">Connected to the Internet</string>
<string name="tickline_message_not_connected_to_internet">Cannot connect to Internet</string>
<string name="tickline_category_connected">Connected</string>
<string name="tickline_message_wifi_disabled">Wi-Fi is disabled</string>
<string name="tickline_message_wifi_enabled">Wi-Fi is enabled</string>
<string name="tickline_category_wifi_availability">Available</string>
<string name="tickline_category_app_version">App Version</string>
<string name="tickline_message_server_subject_match_ok">OK</string>
<string name="tickline_message_wifi_writable">Access to Eduroam configuration</string>
<string name="tickline_subtext_wifi_writable">App is allowed to configure Eduroam</string>
<string name="tickline_subtext_wifi_notwritable">App may not configure eduraom. Please delete "eduroam" in the Wi-Fi settings of Android.</string>
<string name="dlg_wifi_fix_title">Delete existing eduroam configuration</string>
<string name="dlg_wifi_fix_message">You will now be redirected to the Android settings for Wi-Fi. Please delete there the configuration for the network "eduroam".</string>
<string name="dlg_conntest_pie">Unfortunately, For Android 9 onwards, the connection test can not be performed now.</string>
<string name="tickline_message_ca_cert">CA-Certificate</string>
<string name="tickline_subtext_ca_cert_certificate_ok">OK</string>
<string name="tickline_subtext_ca_cert_certificate_not_found">Certificate not found</string>
<string name="tickline_subtext_ca_cert_certificate_wrong">Wrong certificate</string>
<string name="tickline_subtext_user_identity_not_found">Unavailable</string>
<string name="tickline_category_user_identity">User Identity</string>
<string name="tickline_category_anonymous_identity">Anonymous identity</string>
<string name="tickline_message_techincal_parameters">Technical parameters </string>
<string name="tickline_message_are_correct">are correct</string>
<string name="tickline_message_not_correct">not correct</string>
<string name="tickline_message_locked_screen_set">Lock screen set!</string>
<string name="tickline_message_screen_lock_required">PIN or Password Lock Required</string>
<string name="tickline_message_not_logged_in">You are logged out!</string>
<plurals name="connect_to_internet_message">
<item quantity="one">Please make an internet connection via Wi-fi or mobile data.\nIn TU Chemnitz, you can use %1$s WLAN network .</item>
<item quantity="other">Please make an internet connection via Wi-Fi or mobile data.\nIn TU Chemnitz, you can use the following WLAN networks - %1$s.</item>
</plurals>
<string-array name="useable_wlans">
<item>eduroam</item>
</string-array>
<string name="error_message_invalid_format">Could not read file or Invalid Format!</string>
<string name="error_message_something_went_wrong">Something went wrong!</string>
<string name="error_message">Error</string>
<string name="alert_box_title_login_error">Login Error</string>
<string name="alert_box_title_locked_screen">Lock Screen</string>
<string name="alert_box_message_put_pin_password_lock">Please put a PIN or password lock screen.</string>
<string name="alert_box_title_device_name">Device Name</string>
<string name="alert_box_message_device_name">Please enter a name for this device!
\nThe name can be used later to manage the device-specific password in the IDM portal.</string>
<string name="alext_box_title_internet_access">Internet access</string>
<string name="alert_box_title_request_new_config">Request Configuration</string>
<string name=