Skip to content

Commit

Permalink
Merge branch 'fix-android-daita-translations-droid-1642'
Browse files Browse the repository at this point in the history
  • Loading branch information
albin-mullvad committed Dec 13, 2024
2 parents efecc8e + b29cae1 commit d1f2a58
Show file tree
Hide file tree
Showing 27 changed files with 222 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private fun FeatureIndicator.text(): String {
FeatureIndicator.CUSTOM_DNS -> R.string.feature_custom_dns
FeatureIndicator.SERVER_IP_OVERRIDE -> R.string.feature_server_ip_override
FeatureIndicator.CUSTOM_MTU -> R.string.feature_custom_mtu
FeatureIndicator.DAITA -> R.string.feature_daita
FeatureIndicator.DAITA -> R.string.daita
FeatureIndicator.MULTIHOP -> R.string.feature_multihop
}
return textResource(resource)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,16 @@ fun DaitaDirectOnlyConfirmation(navigator: ResultBackNavigator<Boolean>) {
InfoConfirmationDialog(
navigator = navigator,
titleType = InfoConfirmationDialogTitleType.IconOnly,
confirmButtonTitle = stringResource(R.string.enable_direct_only),
confirmButtonTitle =
stringResource(R.string.enable_direct_only, stringResource(R.string.direct_only)),
cancelButtonTitle = stringResource(R.string.cancel),
) {
Text(
text = stringResource(id = R.string.direct_only_description),
text =
stringResource(
id = R.string.direct_only_description,
stringResource(id = R.string.daita),
),
color = MaterialTheme.colorScheme.onSurface,
style = MaterialTheme.typography.bodySmall,
modifier = Modifier.fillMaxWidth(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ private fun PreviewDaitaDirectOnlyInfoDialog() {
@Composable
fun DaitaDirectOnlyInfo(navigator: DestinationsNavigator) {
InfoDialog(
message = stringResource(id = R.string.daita_info),
message =
stringResource(
id = R.string.daita_info,
stringResource(id = R.string.direct_only),
stringResource(id = R.string.daita),
),
onDismiss = dropUnlessResumed { navigator.navigateUp() },
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,25 +138,29 @@ private fun DescriptionPager(pagerState: PagerState) {
contentDescription = stringResource(R.string.daita),
)
DescriptionText(
firstParagraph = page.textFirstParagraph,
secondParagraph = page.textSecondParagraph,
thirdParagraph = page.textThirdParagraph,
firstParagraph = page.textFirstParagraph(),
secondParagraph = page.textSecondParagraph(),
thirdParagraph = page.textThirdParagraph(),
)
}
}
}

@Composable
private fun DescriptionText(firstParagraph: Int, secondParagraph: Int, thirdParagraph: Int) {
private fun DescriptionText(
firstParagraph: String,
secondParagraph: String,
thirdParagraph: String,
) {
SwitchComposeSubtitleCell(
modifier = Modifier.padding(vertical = Dimens.smallPadding),
text =
buildString {
appendLine(stringResource(firstParagraph))
appendLine(firstParagraph)
appendLine()
appendLine(stringResource(secondParagraph))
appendLine(secondParagraph)
appendLine()
append(stringResource(thirdParagraph))
append(thirdParagraph)
},
)
}
Expand Down Expand Up @@ -185,20 +189,55 @@ private fun PageIndicator(pagerState: PagerState) {

private enum class DaitaPages(
val image: Int,
val textFirstParagraph: Int,
val textSecondParagraph: Int,
val textThirdParagraph: Int,
val textFirstParagraph: @Composable () -> String,
val textSecondParagraph: @Composable () -> String,
val textThirdParagraph: @Composable () -> String,
) {
FIRST(
image = R.drawable.daita_illustration_1,
textFirstParagraph = R.string.daita_description_slide_1_first_paragraph,
textSecondParagraph = R.string.daita_description_slide_1_second_paragraph,
textThirdParagraph = R.string.daita_description_slide_1_third_paragraph,
textFirstParagraph =
@Composable {
stringResource(
R.string.daita_description_slide_1_first_paragraph,
stringResource(id = R.string.daita),
stringResource(id = R.string.daita_full),
)
},
textSecondParagraph =
@Composable { stringResource(R.string.daita_description_slide_1_second_paragraph) },
textThirdParagraph =
@Composable {
stringResource(
R.string.daita_description_slide_1_third_paragraph,
stringResource(id = R.string.daita),
)
},
),
SECOND(
image = R.drawable.daita_illustration_2,
textFirstParagraph = R.string.daita_description_slide_2_first_paragraph,
textSecondParagraph = R.string.daita_description_slide_2_second_paragraph,
textThirdParagraph = R.string.daita_description_slide_2_third_paragraph,
textFirstParagraph =
@Composable {
stringResource(
R.string.daita_description_slide_2_first_paragraph,
stringResource(id = R.string.daita),
)
},
textSecondParagraph =
@Composable {
stringResource(
R.string.daita_description_slide_2_second_paragraph,
// Duplicated argument to keep compatibility with our common string template
// (messages.pot) while also keeping lint happy.
stringResource(id = R.string.daita),
stringResource(id = R.string.daita),
)
},
textThirdParagraph =
@Composable {
stringResource(
R.string.daita_description_slide_2_third_paragraph,
stringResource(id = R.string.daita),
)
},
),
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.intl.Locale
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.toLowerCase
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import net.mullvad.mullvadvpn.R
import net.mullvad.mullvadvpn.compose.button.PrimaryButton
Expand Down Expand Up @@ -106,7 +108,14 @@ private fun LazyListScope.loading() {
private fun LazyListScope.entryBlocked(openDaitaSettings: () -> Unit) {
item(contentType = ContentType.DESCRIPTION) {
Text(
text = stringResource(R.string.multihop_entry_disabled_description),
text =
stringResource(
R.string.multihop_entry_disabled_description,
stringResource(R.string.multihop).toLowerCase(Locale.current),
stringResource(id = R.string.daita),
stringResource(R.string.direct_only),
stringResource(id = R.string.daita),
),
style = MaterialTheme.typography.labelMedium,
textAlign = TextAlign.Center,
color = MaterialTheme.colorScheme.onSurfaceVariant,
Expand All @@ -118,7 +127,8 @@ private fun LazyListScope.entryBlocked(openDaitaSettings: () -> Unit) {
}
item(contentType = ContentType.BUTTON) {
PrimaryButton(
text = stringResource(R.string.open_daita_settings),
text =
stringResource(R.string.open_feature_settings, stringResource(id = R.string.daita)),
onClick = openDaitaSettings,
modifier = Modifier.padding(horizontal = Dimens.mediumPadding),
)
Expand Down
16 changes: 16 additions & 0 deletions android/config/lint-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,22 @@
column="5"/>
</issue>

<issue
id="StringFormatCount"
message="Inconsistent number of arguments in formatting string `daita_description_slide_2_second_paragraph`; found both 1 here and 2 in values/strings.xml"
errorLine1=" &lt;string name=&quot;daita_description_slide_2_second_paragraph&quot;>Daher verwenden wir automatisch Multihop, um %1$s mit jedem Server zu aktivieren.&lt;/string>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="src/main/res/values-de/strings.xml"
line="100"
column="5"/>
<location
file="src/main/res/values/strings.xml"
line="416"
column="5"
message="Conflicting number of arguments (2) here"/>
</issue>

<issue
id="SyntheticAccessor"
message="Access to `private` method `generateOtherStates` of class `AccountUiStatePreviewParameterProviderKt` requires synthetic accessor"
Expand Down
6 changes: 6 additions & 0 deletions android/lib/resource/src/main/res/values-da/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@
<string name="custom_port_dialog_submit">Indstil port</string>
<string name="custom_port_dialog_valid_ranges">Gyldige områder: %1$s</string>
<string name="custom_tunnel_host_resolution_error">Kunne ikke fortolke værten for den tilpassede tunnel. Prøv at ændre dine indstillinger.</string>
<string name="daita_description_slide_1_first_paragraph">%1$s (%2$s) skjuler mønstre i din krypterede VPN-trafik.</string>
<string name="daita_description_slide_1_second_paragraph">Ved at bruge sofistikeret AI er det muligt at analysere trafikken af datapakker, der går ind og ud af din enhed (selv hvis trafikken er krypteret).</string>
<string name="daita_description_slide_1_third_paragraph">Hvis en observatør overvåger disse datapakker, gør %1$s det betydeligt sværere for dem at identificere, hvilke hjemmesider du besøger, eller hvem du kommunikerer med.</string>
<string name="daita_description_slide_2_first_paragraph">%1$s gør dette ved omhyggeligt at tilføje netværksstøj og gøre alle netværkspakker lige store.</string>
<string name="daita_description_slide_2_second_paragraph">Ikke alle vores servere er %1$s-kompatible. Derfor bruger vi automatisk multihop til at aktivere %2$s med enhver server.</string>
<string name="daita_info">Hvis du aktiverer \"%1$s\", skal du manuelt vælge en server, der er %2$s-aktiveret. Det kan medføre, at du ender i en blokeret tilstand, indtil du har valgt en kompatibel server i visningen \"Vælg placering\".</string>
<string name="daita_relay_subset_warning">Denne funktion er ikke tilgængelig på alle servere. Du skal muligvis ændre placering efter aktivering.</string>
<string name="daita_warning">Bemærk: Da dette øger din samlede netværkstrafik, skal du være forsigtig, hvis du har et abonnement med begrænset datamængde. Det kan også påvirke din netværkshastighed og dit batteriforbrug negativt.</string>
<string name="delete">Slet</string>
Expand All @@ -110,6 +115,7 @@
<string name="device_name_info_second_paragraph">Du kan have op til 5 enheder logget ind på én Mullvad-konto.</string>
<string name="device_name_info_third_paragraph">Hvis du logger ud, fjernes enheden og enhedsnavnet. Når du logger på igen, får enheden et nyt navn.</string>
<string name="direct_only">Kun direkte</string>
<string name="direct_only_description">Ikke alle vores servere er %1$s-kompatible. For at kunne bruge internettet skal du muligvis vælge en ny placering efter aktivering.</string>
<string name="discard">Kassér</string>
<string name="discard_changes">Vil du kassere ændringer?</string>
<string name="disconnect">Afbryd forbindelse</string>
Expand Down
6 changes: 6 additions & 0 deletions android/lib/resource/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@
<string name="custom_port_dialog_submit">Port festlegen</string>
<string name="custom_port_dialog_valid_ranges">Gültige Bereiche: %1$s</string>
<string name="custom_tunnel_host_resolution_error">Der Host des benutzerdefinierten Tunnels konnte nicht aufgelöst werden. Versuchen Sie, Ihre Einstellungen zu ändern.</string>
<string name="daita_description_slide_1_first_paragraph">%1$s (%2$s) verbirgt Muster in Ihrem verschlüsselten VPN-Traffic.</string>
<string name="daita_description_slide_1_second_paragraph">Durch den Einsatz hochentwickelter KI ist es möglich, den Traffic von Datenpaketen zu analysieren, die auf Ihrem Gerät ein- und ausgehen (selbst wenn der Verkehr verschlüsselt ist).</string>
<string name="daita_description_slide_1_third_paragraph">Wenn ein Beobachter diese Datenpakete überwacht, macht %1$s es für ihn wesentlich schwieriger zu erkennen, welche Websites Sie besuchen oder mit wem Sie kommunizieren.</string>
<string name="daita_description_slide_2_first_paragraph">%1$s tut dies, indem es Netzwerkrauschen gezielt hinzufügt und alle Netzwerkpakete gleich groß macht.</string>
<string name="daita_description_slide_2_second_paragraph">Daher verwenden wir automatisch Multihop, um %1$s mit jedem Server zu aktivieren.</string>
<string name="daita_info">Wenn Sie „%1$s“ aktivieren, müssen Sie manuell einen Server auswählen, der %2$s-fähig ist. Dies kann dazu führen, dass Sie in einem blockierten Zustand landen, bis Sie einen kompatiblen Server in der Ansicht „Standort auswählen“ ausgewählt haben.</string>
<string name="daita_relay_subset_warning">Diese Funktion ist nicht auf allen Servern verfügbar. Möglicherweise müssen Sie nach der Aktivierung den Standort wechseln.</string>
<string name="daita_warning">Achtung! Da dies Ihren gesamten Netzwerk-Traffic erhöht, sollten Sie vorsichtig sein, wenn Sie einen begrenzten Datentarif haben. Es kann sich auch negativ auf Ihre Netzwerkgeschwindigkeit und den Akkuverbrauch auswirken.</string>
<string name="delete">Löschen</string>
Expand All @@ -110,6 +115,7 @@
<string name="device_name_info_second_paragraph">Es sind pro Mullvad-Konto bis zu 5 angemeldete Geräte möglich.</string>
<string name="device_name_info_third_paragraph">Wenn Sie sich abmelden, werden das Gerät und der Gerätename entfernt. Wenn Sie sich wieder anmelden, erhält das Gerät einen neuen Namen.</string>
<string name="direct_only">Nur direkt</string>
<string name="direct_only_description">Nicht alle unsere Server sind %1$s-fähig. Um das Internet nutzen zu können, müssen Sie nach der Aktivierung möglicherweise einen neuen Standort auswählen.</string>
<string name="discard">Verwerfen</string>
<string name="discard_changes">Änderungen verwerfen?</string>
<string name="disconnect">Verbindung trennen</string>
Expand Down
6 changes: 6 additions & 0 deletions android/lib/resource/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@
<string name="custom_port_dialog_submit">Establecer puerto</string>
<string name="custom_port_dialog_valid_ranges">Intervalos válidos: %1$s</string>
<string name="custom_tunnel_host_resolution_error">No se puede resolver el host del túnel personalizado. Pruebe a cambiar la configuración.</string>
<string name="daita_description_slide_1_first_paragraph">%1$s (%2$s) oculta los patrones en su tráfico VPN cifrado.</string>
<string name="daita_description_slide_1_second_paragraph">Al utilizar IA sofisticada, se puede analizar el tráfico de paquetes de datos que entran y salen de su dispositivo (incluso si el tráfico está cifrado).</string>
<string name="daita_description_slide_1_third_paragraph">Si un observador supervisa estos paquetes de datos, %1$s les dificulta notablemente la tarea de identificar qué sitios web está visitando o con quién se está comunicando.</string>
<string name="daita_description_slide_2_first_paragraph">%1$s lo realiza añadiendo con cuidado ruido de red y haciendo que todos los paquetes de red tengan el mismo tamaño.</string>
<string name="daita_description_slide_2_second_paragraph">No todos nuestros servidores están habilitados para %1$s. Por lo tanto, utilizamos el salto múltiple de forma automática para habilitar %2$s con cualquier servidor.</string>
<string name="daita_info">Si habilita «%1$s», deberá seleccionar manualmente un servidor que esté habilitado para %2$s. Esto puede provocar que termine bloqueado hasta que seleccione un servidor compatible en la vista «Seleccionar ubicación».</string>
<string name="daita_relay_subset_warning">Esta característica no está disponible en todos los servidores. Podría tener que cambiar de ubicación tras habilitarla.</string>
<string name="daita_warning">Atención: Como esto aumenta el tráfico total de su red, tenga cuidado si tiene un plan de datos limitado. También puede afectar negativamente a la velocidad de su red y al uso de la batería.</string>
<string name="delete">Eliminar</string>
Expand All @@ -110,6 +115,7 @@
<string name="device_name_info_second_paragraph">Puede tener hasta 5 dispositivos conectados a una cuenta de Mullvad.</string>
<string name="device_name_info_third_paragraph">Si cierra sesión, se quita el dispositivo y el nombre del dispositivo. Cuando vuelve a iniciar sesión, el dispositivo recibirá un nombre nuevo.</string>
<string name="direct_only">Conexión directa</string>
<string name="direct_only_description">No todos nuestros servidores están habilitados para %1$s. Para usar Internet, quizá deba seleccionar una nueva ubicación tras habilitar esta característica.</string>
<string name="discard">Descartar</string>
<string name="discard_changes">¿Descartar los cambios?</string>
<string name="disconnect">Desconectar</string>
Expand Down
Loading

0 comments on commit d1f2a58

Please sign in to comment.