Commit 7d6ac051 authored by Aaditya Prakash's avatar Aaditya Prakash

Merge branch 'adding-english-translations' onto 'orgin/master'

parent a3704b9b
Pipeline #25070 passed with stages
in 2 minutes and 32 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, Helper.lastWifi.SSID + context.getResources().getString(R.string.msg_successfully_applied), 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.msg_not_successfully_applied) + 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();
}
}
......@@ -494,9 +488,9 @@ class Helper {
* @return The {@link WifiConfiguration}
*/
private static WifiConfiguration createEapConfig(String ssid, String password, String eapMethod,
String phase2, String identity, String anonymousIdentity
/*,String caCert, String clientCert*/
, String subjectMatch, X509Certificate[] certs) {
String phase2, String identity, String anonymousIdentity
/*,String caCert, String clientCert*/
, String subjectMatch, X509Certificate[] certs) {
WifiConfiguration config = new WifiConfiguration();
config.SSID = "\"" + ssid + "\"";
......@@ -539,7 +533,7 @@ class Helper {
/**
* Get the EAP method from a string.
*
* @throws IllegalArgumentException if the string is not a supported EAP method.
* @throws //IllegalArgumentException if the string is not a supported EAP method.
*/
private static int getEapMethod(String eapMethod) {
if ("TLS".equalsIgnoreCase(eapMethod)) {
......@@ -557,7 +551,7 @@ class Helper {
/**
* Get the phase 2 method from a string.
*
* @throws IllegalArgumentException if the string is not a supported phase 2 method.
* @throws //IllegalArgumentException if the string is not a supported phase 2 method.
*/
private static int getPhase2(String phase2) {
if ("PAP".equalsIgnoreCase(phase2)) {
......@@ -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.msg_active_wifi), context.getResources().getString(R.string.msg_available ), false);
tick._tag = status_tags[0];
list.add(tick);
......@@ -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.msg_anonymous_identity), true));
ticked = true;
......@@ -687,7 +681,7 @@ class Helper {
String currentWifiConfigurationCaCertValue = currentWifiConfigurationValues.get("ca_cert");
if (currentWifiConfigurationCaCertValue != null) {
if ( currentWifiConfigurationCaCertValue.contains("PEAP") && currentWifiConfigurationCaCertValue.contains("eduroam")
&& currentWifiConfigurationCaCertValue.contains("EAPIEEE8021X") && currentWifiConfigurationCaCertValue.contains("PEAP")) {
&& currentWifiConfigurationCaCertValue.contains("EAPIEEE8021X") && currentWifiConfigurationCaCertValue.contains("PEAP")) {
message = context.getString(R.string.tickline_subtext_ca_cert_certificate_ok);
ticked = true;
} else {
......@@ -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.msg_technical_parameter);
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.sure);
ticked = true;
} else {
message += "unsicher";
message += " " + context.getResources().getString(R.string.not_sure);
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.msg_deactive_wifi), 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.msg_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.msg_not_logged_as), context.getResources().getString(R.string.title_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.title_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.msg_logged_in_as, username), context.getResources().getString(R.string.title_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), context.getResources().getString(R.string.title_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.msg_no_internet), context.getResources().getString(R.string.msg_available), false);
tick._tag = install_order[3];
ticks_install.add(tick);
}
......
package de.tu_chemnitz.wlan;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.KeyguardManager;
......@@ -13,7 +14,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 +114,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_msg_invalid_format), Toast.LENGTH_LONG).show();
Log.e("ACTION_VIEW - handler", getResources().getString(R.string.error_msg_something_went_wrong), e);
}
}
......@@ -138,6 +138,7 @@ public class MainActivity extends AppCompatActivity {
}*/
}
@SuppressLint("LongLogTag")
@Override
protected void onResume() {
super.onResume();
......@@ -188,6 +189,7 @@ public class MainActivity extends AppCompatActivity {
}
}
@SuppressLint("LongLogTag")
@Override
protected void onPause() {
super.onPause();
......@@ -203,7 +205,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.msg_connected) : getResources().getString(R.string.msg_no_internet), getResources().getString(R.string.connection), false);
tick._tag = Helper.status_tags[1];
ticks_status.add(0, tick);
}
......@@ -212,7 +214,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.msg_locked_screen_set) : getResources().getString(R.string.msg_lock_required), "", false);
tick._tag = Helper.status_tags[2];
ticks_status.add(tick);
......@@ -240,7 +242,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 +281,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 +326,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.msg_locked_screen));
/*LinearLayout ll = new LinearLayout(this);
ll.setOrientation(LinearLayout.VERTICAL);
......@@ -335,9 +339,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_msg_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 +355,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.msg_internet_access));
/*LinearLayout ll = new LinearLayout(this);
ll.setOrientation(LinearLayout.VERTICAL);
......@@ -414,19 +418,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.title_request_new_config));
builder.setMessage("Es wurde bereits eine Konfiguration geladen, soll diese verwendet werden?");
builder.setMessage(getResources().getString(R.string.msg_config_exits));
// 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 +450,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.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.msg_enter_device_name));
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
params.setMargins(10, 0, 10, 0);
......@@ -462,21 +466,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 +506,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.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 +548,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 +564,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 +592,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.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 +608,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.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 +618,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 +679,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 +699,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 +718,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 +740,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.msg_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 +753,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.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) {
......@@ -825,9 +823,9 @@ public class MainActivity extends AppCompatActivity {
params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
ll.addView(ll2, params);
ll.setLayoutParams(getLayoutParams(line.subentry));
return ll;
}
......@@ -839,6 +837,7 @@ public class MainActivity extends AppCompatActivity {
private class NetworkChangeReciever extends BroadcastReceiver {
@SuppressLint("LongLogTag")
@Override
public void onReceive(Context context, Intent intent) {
try {
......
......@@ -10,7 +10,7 @@
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Verbindungstest"
android:text="@string/title_connection_test"
android:textSize="18sp"
tools:layout_editor_absoluteX="16dp"
tools:lay