summaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/Dashboard.java5
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/LeapSRPSession.java1
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/SessionDialog.java5
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/User.java8
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/UserSessionStatus.java60
-rw-r--r--app/src/main/res/layout/eip_service_fragment.xml18
-rw-r--r--app/src/main/res/values-es/strings.xml87
-rw-r--r--app/src/main/res/values/strings.xml15
8 files changed, 148 insertions, 51 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java
index ee64a1b3..4207872d 100644
--- a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java
+++ b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java
@@ -78,7 +78,7 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn
super.onCreate(savedInstanceState);
app = this;
- user_session_status = UserSessionStatus.getInstance();
+ user_session_status = UserSessionStatus.getInstance(getResources());
user_session_status.addObserver(this);
PRNGFixes.apply();
@@ -86,6 +86,7 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn
preferences = getSharedPreferences(SHARED_PREFERENCES, MODE_PRIVATE);
fragment_manager = new FragmentManagerEnhanced(getFragmentManager());
handleVersion();
+ User.init();
restoreProvider(savedInstanceState);
if (provider == null || provider.getName().isEmpty())
@@ -109,7 +110,7 @@ public class Dashboard extends Activity implements SessionDialog.SessionDialogIn
if (savedInstanceState != null)
if (savedInstanceState.containsKey(UserSessionStatus.TAG)) {
UserSessionStatus.SessionStatus status = (UserSessionStatus.SessionStatus) savedInstanceState.getSerializable(UserSessionStatus.TAG);
- user_session_status.updateStatus(status);
+ user_session_status.updateStatus(status, getResources());
}
}
diff --git a/app/src/main/java/se/leap/bitmaskclient/LeapSRPSession.java b/app/src/main/java/se/leap/bitmaskclient/LeapSRPSession.java
index b961350e..1ced6d60 100644
--- a/app/src/main/java/se/leap/bitmaskclient/LeapSRPSession.java
+++ b/app/src/main/java/se/leap/bitmaskclient/LeapSRPSession.java
@@ -42,7 +42,6 @@ public class LeapSRPSession {
final public static String AUTHORIZATION_HEADER = "Authorization";
final public static String TAG = "Leap SRP session class tag";
- private User user;
private SRPParameters params;
private String username;
private String password;
diff --git a/app/src/main/java/se/leap/bitmaskclient/SessionDialog.java b/app/src/main/java/se/leap/bitmaskclient/SessionDialog.java
index e92c6b7b..30344ff2 100644
--- a/app/src/main/java/se/leap/bitmaskclient/SessionDialog.java
+++ b/app/src/main/java/se/leap/bitmaskclient/SessionDialog.java
@@ -114,9 +114,10 @@ public class SessionDialog extends DialogFragment {
if (arguments.containsKey(ERRORS.USERNAME_MISSING.toString())) {
username_field.setError(getString(R.string.username_ask));
}
- if (arguments.containsKey(getString(R.string.user_message)))
+ if (arguments.containsKey(getString(R.string.user_message))) {
user_message.setText(arguments.getString(getString(R.string.user_message)));
- else if (user_message.getVisibility() != TextView.VISIBLE)
+ user_message.setVisibility(View.VISIBLE);
+ } else if (user_message.getVisibility() != TextView.VISIBLE)
user_message.setVisibility(View.GONE);
if (!username_field.getText().toString().isEmpty() && password_field.isFocusable())
diff --git a/app/src/main/java/se/leap/bitmaskclient/User.java b/app/src/main/java/se/leap/bitmaskclient/User.java
index 4bbd9a91..f3d3b8b1 100644
--- a/app/src/main/java/se/leap/bitmaskclient/User.java
+++ b/app/src/main/java/se/leap/bitmaskclient/User.java
@@ -17,10 +17,11 @@
package se.leap.bitmaskclient;
public class User {
- private static String user_name = "You";
+ private static String user_name = "";
private static User user;
+ public static int DEFAULT_CONJUGATION_PERSON = 1;
- public static User getInstance() {
+ public static User init() {
if (user == null) {
user = new User();
}
@@ -31,8 +32,7 @@ public class User {
User.user_name = user_name;
}
- private User() {
- }
+ private User() { }
public static String userName() {
return user_name;
diff --git a/app/src/main/java/se/leap/bitmaskclient/UserSessionStatus.java b/app/src/main/java/se/leap/bitmaskclient/UserSessionStatus.java
index e43c8a25..28c7ecc7 100644
--- a/app/src/main/java/se/leap/bitmaskclient/UserSessionStatus.java
+++ b/app/src/main/java/se/leap/bitmaskclient/UserSessionStatus.java
@@ -16,13 +16,14 @@
*/
package se.leap.bitmaskclient;
-import android.os.*;
+import android.content.res.*;
import java.util.*;
public class UserSessionStatus extends Observable {
public static String TAG = UserSessionStatus.class.getSimpleName();
private static UserSessionStatus current_status;
+ private static Resources resources;
public enum SessionStatus {
LOGGED_IN,
@@ -31,19 +32,41 @@ public class UserSessionStatus extends Observable {
DIDNT_LOG_OUT,
LOGGING_IN,
LOGGING_OUT,
- SIGNING_UP
+ SIGNING_UP;
+
+ @Override
+ public String toString() {
+ int id = 0;
+ if(this == SessionStatus.LOGGED_IN)
+ id = R.string.logged_in_user_status;
+ else if(this == SessionStatus.LOGGED_OUT)
+ id = R.string.logged_out_user_status;
+ else if(this == SessionStatus.NOT_LOGGED_IN)
+ id = R.string.not_logged_in_user_status;
+ else if(this == SessionStatus.DIDNT_LOG_OUT)
+ id = R.string.didnt_log_out_user_status;
+ else if(this == SessionStatus.LOGGING_IN)
+ id = R.string.logging_in_user_status;
+ else if(this == SessionStatus.LOGGING_OUT)
+ id = R.string.logging_out_user_status;
+ else if(this == SessionStatus.SIGNING_UP)
+ id = R.string.signingup_message;
+
+ return resources.getString(id);
+ }
}
private static SessionStatus session_status = SessionStatus.NOT_LOGGED_IN;
- public static UserSessionStatus getInstance() {
+ public static UserSessionStatus getInstance(Resources resources) {
if (current_status == null) {
- current_status = new UserSessionStatus();
+ current_status = new UserSessionStatus(resources);
}
return current_status;
}
- private UserSessionStatus() {
+ private UserSessionStatus(Resources resources) {
+ UserSessionStatus.resources = resources;
}
private void sessionStatus(SessionStatus session_status) {
@@ -59,8 +82,8 @@ public class UserSessionStatus extends Observable {
|| session_status == SessionStatus.LOGGING_OUT;
}
- public static void updateStatus(SessionStatus session_status) {
- current_status = getInstance();
+ public static void updateStatus(SessionStatus session_status, Resources resources) {
+ current_status = getInstance(resources);
current_status.sessionStatus(session_status);
current_status.setChanged();
current_status.notifyObservers();
@@ -68,20 +91,19 @@ public class UserSessionStatus extends Observable {
@Override
public String toString() {
- String username = User.userName();
+ String user_session_status = User.userName();
- return username + " " + conjugateToBe(username) + " "
- + session_status.toString().toLowerCase().replaceAll("_", " ");
- }
+ String default_username = resources.getString(R.string.default_user, "");
+ if(user_session_status.isEmpty() && !default_username.equalsIgnoreCase("null")) user_session_status = default_username;
+ user_session_status += " " + session_status.toString();
- private String conjugateToBe(String subject) {
- String conjugation = "";
- if(subject.equalsIgnoreCase("I"))
- conjugation = "am";
- else if(subject.equalsIgnoreCase("you") || subject.equalsIgnoreCase("we")|| subject.equalsIgnoreCase("they"))
- conjugation = "are";
- else conjugation = "is";
+ user_session_status = user_session_status.trim();
+ if(User.userName().isEmpty())
+ user_session_status = capitalize(user_session_status);
+ return user_session_status;
+ }
- return conjugation;
+ private String capitalize(String to_be_capitalized) {
+ return to_be_capitalized.substring(0,1).toUpperCase() + to_be_capitalized.substring(1);
}
}
diff --git a/app/src/main/res/layout/eip_service_fragment.xml b/app/src/main/res/layout/eip_service_fragment.xml
index 64d22147..6adcfab0 100644
--- a/app/src/main/res/layout/eip_service_fragment.xml
+++ b/app/src/main/res/layout/eip_service_fragment.xml
@@ -13,15 +13,7 @@
android:layout_marginLeft="10dp"
android:clickable="true"
android:text="@string/eip_service_label"
- android:textAppearance="?android:attr/textAppearanceLarge" />
-
- <Switch
- android:id="@+id/eipSwitch"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_alignParentTop="true"
- android:layout_marginRight="10dp" />
+ android:textAppearance="?android:attr/textAppearanceMedium" />
<ProgressBar
android:id="@+id/eipProgress"
@@ -48,4 +40,12 @@
android:clickable="true"
android:text="@string/eip_state_not_connected" />
+ <Switch
+ android:id="@+id/eipSwitch"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignTop="@+id/status_message"
+ android:layout_toRightOf="@+id/status_message"
+ android:layout_toEndOf="@+id/status_message" />
+
</RelativeLayout>
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index ec8c21ff..7ab5150e 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -1,11 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <string name="info">información</string>
- <string name="show_connection_details">Mostrar detalles de la conexión</string>
- <string name="routes_info">Rutas: %s</string>
- <string name="routes_info6">Rutas IPv6: %s</string>
- <string name="error_empty_username">El nombre de usuario no debe estar vacío.</string>
- <string name="cert_from_keystore">Conseguido el certificado de \'%s\' de almacén de claves</string>
- <string name="repository_url_text">Código fuente disponible en https://github.com/leapcode/bitmask_android/</string>
- <string name="leap_tracker">Tracker disponible en https://leap.se/code</string>
+
+
+ <string name="retry">Reintentar</string>
+ <string name="translation_project_text">Traducciones son bienvenidas. Puedes ir a nuestra página de Transifex: https://www.transifex.com/projects/p/bitmask-android/</string>
+ <string name="switch_provider_menu_option">Cambiar de proveedor</string>
+ <string name="info">información</string>
+ <string name="show_connection_details">Mostrar detalles de la conexión</string>
+ <string name="routes_info">Rutas: %s</string>
+ <string name="routes_info6">Rutas IPv6: %s</string>
+ <string name="error_empty_username">El usuario no puede estar vacío.</string>
+ <string name="cert_from_keystore">Certificado de \'%s\' obtenido de almacén de claves</string>
+ <string name="repository_url_text">Código fuente disponible en https://github.com/leapcode/bitmask_android/</string>
+ <string name="leap_tracker">Tracker disponible en https://leap.se/code</string>
+ <string name="title_activity_dashboard">Bitmask</string>
+ <string name="provider_label">Proveedor:</string>
+ <string name="provider_label_none">Ningún proveedor configurado</string>
+ <string name="status_unknown">Estado no definido.</string>
+ <string name="eip_service_label">Acceso a Internet Encriptado con VPN</string>
+ <string name="configuration_wizard_title">Elige un proveedor</string>
+ <string name="new_provider_button">Nuevo proveedor</string>
+ <string name="introduce_new_provider">Añadir un nuevo proveedor</string>
+ <string name="save">Guardar</string>
+ <string name="new_provider_uri">Dominio</string>
+ <string name="valid_url_entered">El dominio está bien formado</string>
+ <string name="not_valid_url_entered">Dominio no válido</string>
+ <string name="provider_details_fragment_title">Detalles del proveedor</string>
+ <string name="use_anonymously_button">Utilizar sin registrarse</string>
+ <string name="username_hint">usuario</string>
+ <string name="username_ask">Por favor, introduce tu usuario</string>
+ <string name="password_hint">contraseña</string>
+ <string name="user_message">Mensaje al usuario</string>
+ <string name="title_about_activity">Acerca de Bitmask"</string>
+ <string name="error_srp_math_error_user_message">Inténtalo de nuevo: error en el servidor.</string>
+ <string name="error_bad_user_password_user_message">Usuario o contraseña incorrectos.</string>
+ <string name="error_not_valid_password_user_message">Al menos 8 caracteres.</string>
+ <string name="error_client_http_user_message">Inténtalo de nuevo: error en el cliente HTTP</string>
+ <string name="error_io_exception_user_message">Inténtalo de nuevo: error de E/S</string>
+ <string name="error_json_exception_user_message">Inténtalo de nuevo: respuesta mal formada del servidor</string>
+ <string name="error_no_such_algorithm_exception_user_message">Actualiza Bitmask</string>
+ <string name="signup_or_login_button">Registrarse/Iniciar sesión</string>
+ <string name="login_button">Iniciar sesión</string>
+ <string name="logout_button">Cerrar sesión</string>
+ <string name="signup_button">Registrarse</string>
+ <string name="setup_error_title">Error de configuración</string>
+ <string name="setup_error_configure_button">Configurar</string>
+ <string name="setup_error_close_button">Salir</string>
+ <string name="setup_error_text">Sucedió un error configurando Bitmask con tu proveedor elegido.\n\nPuedes volver a intentarlo, o elegir otro proveedor.</string>
+ <string name="server_unreachable_message">No se ha detectado red para hablar con el servidor, inténtalo de nuevo.</string>
+ <string name="malformed_url">No parece que sea un proveedor de Bitmask.</string>
+ <string name="certificate_error">No es un proveedor de Bitmak de confianza.</string>
+ <string name="service_is_down_error">El servicio está caído.</string>
+ <string name="configuring_provider">Configurando el proveedor</string>
+ <string name="incorrectly_downloaded_certificate_message">Tu certificado VPN no pudo ser descargado. Intenta iniciar sesión si es posible.</string>
+ <string name="downloading_certificate_message">Descargando certificado VPN</string>
+ <string name="updating_certificate_message">Actualizando certificado VPN</string>
+ <string name="log_out_failed_message">No pudo cerrarse la sesión. Inténtalo más tarde, quizás sea un problema de la red o del proveedor. Si el problema persiste, borra los datos locales de Bitmask desde la configuración de Android.</string>
+ <string name="login.riseup.warning">"Usuarios de Riseup: es necesario crear una cuenta aparte para utilizar el servicio de VPN."</string>
+ <string name="succesful_authentication_message">Sesión iniciada.</string>
+ <string name="authentication_failed_message">Inicio de sesión fallido.</string>
+ <string name="registration_failed_message">Falló el registro de un nuevo usuario.</string>
+ <string name="eip_status_start_pending">Iniciando la conexión</string>
+ <string name="eip_cancel_connect_title">¿Abortar conexión?</string>
+ <string name="eip_cancel_connect_text">Hay una conexión iniciándose. ¿Quieres cancelarla?</string>
+ <string name="eip.warning.browser_inconsistency">Para salvaguardar la privacidad de tu información personal, te recomendamos que después de apagar la VPN cierres la sesión del navegador y abras una sesión privada en él. Gracias.</string>
+ <string name="yes">Sí</string>
+ <string name="no">No</string>
+ <string name="eip_state_not_connected">"¡Conexión no protegida!"</string>
+ <string name="eip_state_connected">Conexión protegida.</string>
+ <string name="provider_problem">Parece que hay un problema con el proveedor.</string>
+ <string name="try_another_provider">Prueba con otro proveedor, o contacta con este.</string>
+ <string name="default_user"></string>
+ <string name="logged_in_user_status">inició sesión.</string>
+ <string name="logged_out_user_status">cerró la sesión.</string>
+ <string name="didnt_log_out_user_status">no cerró la sesión.</string>
+ <string name="not_logged_in_user_status">no ha iniciado sesión.</string>
+ <string name="logging_in_user_status">está iniciando sesión.</string>
+ <string name="logging_out_user_status">está cerrando sesión.</string>
+ <string name="signingup_message">está siendo registrado.</string>
+
</resources>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index d1e33928..ac6191a9 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -16,7 +16,7 @@
<string name="provider_label">Provider:</string>
<string name="provider_label_none">No provider configured</string>
<string name="status_unknown">Status unknown.</string>
- <string name="eip_service_label">Encrypted Internet</string>
+ <string name="eip_service_label">VPN Encrypted Internet Access</string>
<string name="configuration_wizard_title">Select a service provider</string>
<string name="new_provider_button">Add new Provider</string>
<string name="introduce_new_provider">Add a new service provider</string>
@@ -54,11 +54,6 @@
<string name="incorrectly_downloaded_certificate_message">Your anon cert was not downloaded</string>
<string name="downloading_certificate_message">Downloading VPN certificate</string>
<string name="updating_certificate_message">Updating VPN certificate</string>
- <string name="authenticating_message">Logging in</string>
- <string name="signingup_message">Signing up</string>
- <string name="logout_message">Logging out from this session.</string>
- <string name="logged_out_message">Logged out.</string>
- <string name="log_out_failed_message">Didn\'t log out. Try later, it may be a problem in the network or in the provider. If the problem persists, then wipe Bitmask data from the Android settings</string>
<string name="login.riseup.warning">"Riseup users: You need to create a separate account to use the VPN service"</string>
<string name="succesful_authentication_message">Authentication succeeded.</string>
<string name="authentication_failed_message">Authentication failed.</string>
@@ -73,4 +68,12 @@
<string name="eip_state_connected">Connection Secure.</string>
<string name="provider_problem">It seems there is a problem with the provider.</string>
<string name="try_another_provider">Please try another provider, or contact yours.</string>
+ <string name="default_user">You</string>
+ <string name="logged_in_user_status">is logged in.</string>
+ <string name="logged_out_user_status">logged out.</string>
+ <string name="didnt_log_out_user_status">didn\'t log out. Try later, it may be a problem in the network or in the provider. If the problem persists, then wipe Bitmask data from the Android settings</string>
+ <string name="not_logged_in_user_status">have not logged in.</string>
+ <string name="logging_in_user_status">is logging in.</string>
+ <string name="logging_out_user_status">is logging out.</string>
+ <string name="signingup_message">is being registered.</string>
</resources>