summaryrefslogtreecommitdiffhomepage
path: root/android/app/src
diff options
context:
space:
mode:
Diffstat (limited to 'android/app/src')
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/connectioninfo/FeatureIndicatorsPanel.kt2
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DaitaDirectOnlyConfirmationDialog.kt9
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/info/DaitaDirectOnlyInfoDialog.kt7
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DaitaScreen.kt71
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/location/SelectLocationList.kt14
5 files changed, 81 insertions, 22 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/connectioninfo/FeatureIndicatorsPanel.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/connectioninfo/FeatureIndicatorsPanel.kt
index c31608949d..6d032e1af0 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/connectioninfo/FeatureIndicatorsPanel.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/connectioninfo/FeatureIndicatorsPanel.kt
@@ -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)
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DaitaDirectOnlyConfirmationDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DaitaDirectOnlyConfirmationDialog.kt
index a1b6e7bba0..13c3d04e77 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DaitaDirectOnlyConfirmationDialog.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DaitaDirectOnlyConfirmationDialog.kt
@@ -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(),
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/info/DaitaDirectOnlyInfoDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/info/DaitaDirectOnlyInfoDialog.kt
index 64e5cd46de..3a16bb83b3 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/info/DaitaDirectOnlyInfoDialog.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/info/DaitaDirectOnlyInfoDialog.kt
@@ -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() },
)
}
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DaitaScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DaitaScreen.kt
index c7c3b61752..a6a2a279dc 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DaitaScreen.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/DaitaScreen.kt
@@ -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)
},
)
}
@@ -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),
+ )
+ },
),
}
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/location/SelectLocationList.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/location/SelectLocationList.kt
index 3538aacff1..08a35f13d8 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/location/SelectLocationList.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/location/SelectLocationList.kt
@@ -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
@@ -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,
@@ -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),
)