Skip to content

Commit

Permalink
feat: add localizations
Browse files Browse the repository at this point in the history
  • Loading branch information
zaneschepke committed Jun 10, 2024
1 parent fe4c116 commit 6e273b9
Show file tree
Hide file tree
Showing 8 changed files with 444 additions and 25 deletions.
4 changes: 4 additions & 0 deletions nym-vpn-android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ android {
namespace = "${Constants.NAMESPACE}.${Constants.APP_NAME}"
compileSdk = Constants.COMPILE_SDK

androidResources {
generateLocaleConfig = true
}

defaultConfig {
applicationId = "${Constants.NAMESPACE}.${Constants.APP_NAME}"
minSdk = Constants.MIN_SDK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.IntrinsicSize
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
Expand Down Expand Up @@ -37,7 +38,7 @@ fun RadioSurfaceButton(title: String, onClick: () -> Unit, selected: Boolean, le
modifier =
Modifier
.fillMaxWidth()
.height(64.dp.scaledHeight())
.height(IntrinsicSize.Min)
.clickable(interactionSource = interactionSource, indication = null) {
onClick()
},
Expand All @@ -48,7 +49,8 @@ fun RadioSurfaceButton(title: String, onClick: () -> Unit, selected: Boolean, le
Column(
modifier =
Modifier
.padding(end = 2.dp)
.padding(horizontal = 8.dp.scaledWidth(), vertical = 10.dp.scaledHeight())
.padding(end = 16.dp.scaledWidth()).padding(start = 8.dp.scaledWidth())
.fillMaxSize(),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.Start,
Expand All @@ -64,15 +66,15 @@ fun RadioSurfaceButton(title: String, onClick: () -> Unit, selected: Boolean, le
Modifier
.size(
iconSize,
)
.padding(start = 16.dp.scaledWidth()),
),
)
Row(
horizontalArrangement = Arrangement.spacedBy(16.dp.scaledHeight()),
horizontalArrangement = Arrangement.spacedBy(16.dp.scaledWidth()),
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.padding(vertical = if (description == null) 10.dp.scaledHeight() else 0.dp),
) {
leadingIcon?.let {
Icon(leadingIcon, leadingIcon.name, Modifier.size(iconSize))
Icon(leadingIcon, leadingIcon.name, Modifier.size(iconSize.scaledWidth()))
}
Column {
Text(title, style = MaterialTheme.typography.titleMedium)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
package net.nymtech.nymvpn.ui.common.buttons

import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Switch
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.scale
import androidx.compose.ui.unit.dp
import net.nymtech.nymvpn.util.scaledHeight

@Composable
fun ScaledSwitch(checked: Boolean, modifier: Modifier = Modifier, onClick: (checked: Boolean) -> Unit, enabled: Boolean = true) {
Switch(
checked,
{ onClick(it) },
modifier =
modifier.scale(1.2.dp.scaledHeight().value),
modifier.padding(0.dp),
enabled = enabled,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
Expand Down Expand Up @@ -47,20 +45,19 @@ fun SurfaceSelectionGroupButton(items: List<SelectionItem>) {
indication = null,
) {
it.onClick()
}.fillMaxWidth()
.width(360.dp.scaledWidth())
.height(it.height.dp.scaledHeight())
.padding(vertical = 8.dp.scaledHeight()),
}
.fillMaxWidth(),
) {
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween,
modifier = Modifier.fillMaxWidth(),
modifier = Modifier.fillMaxWidth().padding(vertical = 4.dp.scaledHeight()),
) {
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(16.dp.scaledWidth()),
modifier = Modifier.padding(start = 16.dp.scaledWidth()),
modifier = Modifier
.padding(start = 16.dp.scaledWidth())
.weight(4f, false)
.fillMaxWidth(),
) {
it.leadingIcon?.let { icon ->
Icon(
Expand All @@ -72,29 +69,37 @@ fun SurfaceSelectionGroupButton(items: List<SelectionItem>) {
Column(
horizontalAlignment = Alignment.Start,
verticalArrangement = Arrangement.spacedBy(2.dp, Alignment.CenterVertically),
modifier = Modifier.width(236.dp.scaledWidth()),
modifier = Modifier
.fillMaxWidth()
.padding(start = if (it.leadingIcon != null) 16.dp.scaledWidth() else 0.dp)
.padding(vertical = if (it.description == null) 16.dp.scaledHeight() else 6.dp.scaledHeight()),
) {
it.title()
it.description?.let { it() }
it.description?.let {
it()
}
}
}
it.trailing?.let {
Box(
contentAlignment = Alignment.CenterEnd,
modifier = Modifier
.padding(start = 16.dp.scaledWidth(), end = 24.dp.scaledWidth()),
.padding(end = 24.dp.scaledWidth(), start = 16.dp.scaledWidth())
.weight(1f),
) {
it()
}
}
?: Box(
contentAlignment = Alignment.CenterEnd,
modifier = Modifier
.padding(start = 16.dp.scaledWidth(), end = 12.dp.scaledWidth()),
.padding(end = 12.dp.scaledWidth())
.weight(1f),
) {
val icon = ImageVector.vectorResource(R.drawable.link_arrow_right)
Icon(
ImageVector.vectorResource(R.drawable.link_arrow_right),
"arrow",
icon,
icon.name,
Modifier.size(
iconSize,
),
Expand Down
1 change: 1 addition & 0 deletions nym-vpn-android/app/src/main/res/resources.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
unqualifiedResLocale=en-US
136 changes: 136 additions & 0 deletions nym-vpn-android/app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">NymVPN</string>
<string name="settings">Configuración</string>
<string name="connected">Conectado</string>
<string name="disconnected">Desconectado</string>
<string name="disconnecting">Desconectando</string>
<string name="connecting">Conectando</string>
<string name="five_hop_mixnet">5 saltos Mixnet</string>
<string name="five_hop_description">Mejor para pagos, correos electrónicos, mensajes</string>
<string name="two_hop_mixnet">2 saltos Mixnet</string>
<string name="two_hop_description">Mejor para navegar, streaming, compartir</string>
<string name="first_hop">Primer salto</string>
<string name="last_hop">Último salto</string>
<string name="connect">Conectar</string>
<string name="disconnect">Desconectar</string>
<string name="init_client">Iniciando cliente…</string>
<string name="establishing_connection">Estableciendo conexión</string>
<string name="connection_time">Tiempo de conexión</string>
<string name="select_network">Seleccionar red</string>
<string name="connect_to">Conectar a</string>
<string name="first_hop_selection">Selección del primer salto</string>
<string name="last_hop_selection">Selección del último salto</string>
<string name="display_theme">Tema de pantalla</string>
<string name="light_theme">Tema claro</string>
<string name="dark_theme">Tema oscuro</string>
<string name="automatic">Automático</string>
<string name="device_theme">Usar tema del dispositivo</string>
<string name="search">Buscar</string>
<string name="search_country">Buscar país</string>
<string name="is_selected">Seleccionado</string>
<string name="fastest">Más rápido</string>
<string name="auto_connect">Conexión automática</string>
<string name="auto_connect_description">Conectar automáticamente al reiniciar</string>
<string name="entry_location_description">Selecciona manualmente tu primer salto</string>
<string name="logs">Registros</string>
<string name="feedback">Retroalimentación</string>
<string name="support">Soporte</string>
<string name="error_reporting">Compartir informes de errores anónimos</string>
<string name="sentry">Sentry</string>
<string name="via">vía</string>
<string name="required_app_restart">aplica al reiniciar</string>
<string name="legal">Legal</string>
<string name="faq_link" translatable="false">https://nymtech.net</string>
<string name="privacy_link" translatable="false">https://nymvpn.com/en/privacy?type=apps</string>
<string name="terms_of_use">Términos de uso</string>
<string name="privacy_policy">Declaración de privacidad</string>
<string name="licenses">Licencias</string>
<string name="open_github">Abrir un problema en GitHub</string>
<string name="send_feedback">Envíanos tus comentarios</string>
<string name="check_faq">Consulta las preguntas frecuentes</string>
<string name="join_matrix">Únete a nosotros en Matrix</string>
<string name="join_discord">Únete a nosotros en Discord</string>
<string name="matrix_url" translatable="false">https://matrix.to/#/%23NymVPN:nymtech.chat</string>
<string name="discord_url" translatable="false">https://discord.com/invite/nym</string>
<string name="faq_url" translatable="false">https://support.nymvpn.com</string>
<string name="contact_url" translatable="false">https://support.nymvpn.com/hc/en-us/requests/new</string>
<string name="support_email" translatable="false">[email protected]</string>
<string name="github_issues_url" translatable="false">https://github.com/nymtech/nymvpn-android/issues/new/choose</string>
<string name="email_subject">Soporte de NymVPN</string>
<string name="email_chooser">Enviar un correo electrónico…</string>
<string name="login">Iniciar sesión</string>
<string name="add_credential">Agregar credencial</string>
<string name="add_cred_to_connect">Agregar credencial para conectar</string>
<string name="welcome_exclaim">¡Bienvenido!</string>
<string name="credential_message">Ingresa tu credencial para comenzar</string>
<string name="credential_disclaimer">Para generar una nueva credencial, utiliza el enlace proporcionado en el correo electrónico de invitación a la fase alfa.</string>
<string name="credential_label">Credencial</string>
<string name="credential_failed_message">Credencial inválida</string>
<string name="unknown_error">Ocurrió un error desconocido</string>
<string name="credential">Credencial</string>
<string name="left">Izquierda</string>
<string name="top_up_credential">Recargar tu credencial</string>
<string name="top_up">Recargar</string>
<string name="devices">Dispositivos</string>
<string name="android">Android</string>
<string name="windows">Windows</string>
<string name="macos">macOS</string>
<string name="linux">Linux</string>
<string name="ios">iOS</string>
<string name="credential_successful">Credencial agregada exitosamente</string>
<string name="no_browser_detected">No se detectó ningún navegador</string>
<string name="no_email_detected">No se detectó ninguna aplicación de correo electrónico</string>
<string name="unknown">Desconocido</string>
<string name="no_scm_found">URL del código fuente no encontrada</string>
<string name="terms_link" translatable="false">https://nymvpn.com/en/terms</string>
<string name="two_hop">2 saltos</string>
<string name="five_hop">5 saltos</string>
<string name="mode">Modo</string>
<string name="okay">De acuerdo</string>
<string name="error_reporting_alert">Los cambios en los informes de errores no se aplicarán completamente hasta que la aplicación se haya reiniciado.</string>
<string name="feature_in_progress">Esta función aún está en progreso.</string>
<string name="logs_saved">Registros guardados en la carpeta de descargas</string>
<string name="sentry_url">https://sentry.io</string>
<string name="anonymous_analytics">Análisis anónimos</string>
<string name="anonymous_analytics_description">Ayúdanos a mejorar NymVPN</string>
<string name="alpha_help_message">¡Ayúdanos a mejorar nuestra aplicación durante la fase alfa! Tus comentarios son cruciales para identificar y resolver problemas.</string>
<string name="opt_in_message_first">Opta por la monitorización de errores anónimos</string>
<string name="opt_in_message_second">y análisis cuando quieras, puedes optar por no participar en cualquier momento.</string>
<string name="thanks_for_support">¡Gracias por tu apoyo!</string>
<string name="to_alpha">a NymVPN alfa</string>
<string name="welcome">Bienvenido</string>
<string name="cont">Continuar</string>
<string name="continue_agree">Al continuar, aceptas los</string>
<string name="and_acknowledge">y reconoces los</string>
<string name="share_anonymous_analytics">Compartir análisis anónimos del producto</string>
<string name="anonymous_error_reports">Informes de errores anónimos</string>
<string name="gateways_error">No se pudo recuperar los gateways</string>
<string name="error_invalid_credential">La credencial importada es inválida</string>
<string name="missing_credential">Falta la credencial</string>
<string name="country_load_failure">No se pudieron cargar los países de salto</string>
<string name="app_shortcuts">Atajos de aplicación</string>
<string name="enable_shortcuts">Habilitar atajos de aplicación</string>
<string name="disabled_while_connected">Deshabilitado mientras estás conectado a la VPN</string>
<string name="experimental_software_disclaimer">Este es un software experimental. No confíes en él para obtener un anonimato fuerte (todavía).</string>
<string name="permission_required">Permiso requerido</string>
<string name="exception_cred_missing">No se encontró ninguna credencial importada.</string>
<string name="exception_permission_not_granted">No se ha concedido el permiso requerido.</string>
<string name="exception_cred_invalid">La credencial es inválida o ha expirado</string>
<string name="permission_message">Para asegurarse de que la aplicación funcione correctamente en su dispositivo, permita los siguientes permisos. Estos permisos son necesarios para que la aplicación funcione.</string>
<string name="notifications">Notificaciones</string>
<string name="allow_permissions">Permitir permisos</string>
<string name="notification_permission_message">Necesario para mantener los servicios VPN en funcionamiento mientras la aplicación está cerrada.</string>
<string name="error_gateway_lookup">No se pudo buscar los gateways de Nym. Por favor, comprueba tu conexión a la red e inténtalo de nuevo.</string>
<string name="error_bad_peer_cert">El gateway seleccionado tiene un certificado de par incorrecto. Inténtalo de nuevo para conectarte a un gateway diferente.</string>
<string name="error_no_hostname_address">El gateway no tiene una dirección de nombre de host. Inténtalo de nuevo para conectarte a un gateway diferente.</string>
<string name="error_vpn_halted_unexpectedly">La VPN se ha detenido inesperadamente. Intenta conectar de nuevo.</string>
<string name="kill_switch">Interruptor de emergencia</string>
<string name="contact_support">Contactar soporte</string>
<string name="hours">horas</string>
<string name="hour">hora</string>
<string name="days">días</string>
<string name="day">día</string>
<string name="scan_nym_vpn_credential">Escanear QR de la credencial NymVPN</string>
<string name="error_logs_not_saved">No se pudieron guardar los registros</string>
</resources>
Loading

0 comments on commit 6e273b9

Please sign in to comment.