From e1e87a6337f59c12769cc4ec30b2ad6e8cf957cb Mon Sep 17 00:00:00 2001 From: Gibran Chevalley Date: Tue, 20 Aug 2024 16:49:15 +0200 Subject: [PATCH] Import strings --- .../newtransfer/importfiles/TransferTypeScreen.kt | 14 ++++++++------ .../importfiles/components/TransferTypeButtons.kt | 5 +++-- app/src/main/res/values-de/strings.xml | 5 +++++ app/src/main/res/values-es/strings.xml | 5 +++++ app/src/main/res/values-fr/strings.xml | 5 +++++ app/src/main/res/values-it/strings.xml | 5 +++++ app/src/main/res/values/strings.xml | 5 +++++ 7 files changed, 36 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/TransferTypeScreen.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/TransferTypeScreen.kt index e57a4e3a4b..af551c8c39 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/TransferTypeScreen.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/TransferTypeScreen.kt @@ -18,6 +18,7 @@ package com.infomaniak.swisstransfer.ui.screen.newtransfer.importfiles +import androidx.annotation.StringRes import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding @@ -54,7 +55,7 @@ fun TransferTypeScreen(navigateToTransfer: (TransferType) -> Unit) { modifier = Modifier .fillMaxWidth() .padding(vertical = Margin.Large, horizontal = Margin.Medium), - text = stringResource(R.string.appName), + text = stringResource(R.string.transferTypeTitle), style = SwissTransferTheme.typography.h1, textAlign = TextAlign.Center, ) @@ -65,31 +66,32 @@ fun TransferTypeScreen(navigateToTransfer: (TransferType) -> Unit) { } enum class TransferType( - val label: String, + @StringRes + val titleRes: Int, val background: @Composable () -> Color, val foreground: @Composable () -> Color, val icon: ImageVector, ) { LINK( - "Lien", + R.string.transferTypeLink, { SwissTransferTheme.colors.transferTypeLinkContainer }, { SwissTransferTheme.colors.transferTypeLinkOnContainer }, AppIcons.Illu.ChainTilted ), EMAIL( - "Mail", + R.string.transferTypeEmail, { SwissTransferTheme.colors.transferTypeEmailContainer }, { SwissTransferTheme.colors.transferTypeEmailOnContainer }, AppIcons.Illu.EnvelopeTilted ), QR_CODE( - "QR Code", + R.string.transferTypeQrCode, { SwissTransferTheme.colors.transferTypeQrContainer }, { SwissTransferTheme.colors.transferTypeQrOnContainer }, AppIcons.Illu.QrCodeTilted ), PROXIMITY( - "A proximité", + R.string.transferTypeProximity, { SwissTransferTheme.colors.transferTypeProximityContainer }, { SwissTransferTheme.colors.transferTypeProximityOnContainer }, AppIcons.Illu.WaveSignalTilted diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferTypeButtons.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferTypeButtons.kt index d852d790d7..bdc8b1e91b 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferTypeButtons.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/screen/newtransfer/importfiles/components/TransferTypeButtons.kt @@ -29,6 +29,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @@ -49,10 +50,10 @@ fun TransferTypeButtons(items: List, navigateToTransfer: (Transfer verticalArrangement = Arrangement.spacedBy(SPACE_AROUND_BUTTONS), horizontalArrangement = Arrangement.spacedBy(SPACE_AROUND_BUTTONS), ) { - items(items = items, key = { it.label }) { item -> + items(items = items, key = { it.titleRes }) { item -> TransferTypeButton( modifier = Modifier.aspectRatio(0.87f), - label = item.label, + label = stringResource(item.titleRes), background = item.background(), foreground = item.foreground(), icon = item.icon, diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index aa5b427437..da0b9f8ace 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -35,6 +35,11 @@ Thema Dauer der Gültigkeit Einstellungen + E-Mail + Link + In der Nähe + QR-Code + Schicke deine Dateien per Kamera Dateien durchsuchen Foto- und Videogalerie diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 7882db19ef..35daa1d371 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -35,6 +35,11 @@ Tema Periodo de validez Parámetros + Correo electrónico + Enlace + Proximidad + Código QR + Envía tus archivos por Cámara Examinar archivos Galería de fotos y vídeos diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index ac5185aeee..1e149e3eac 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -35,6 +35,11 @@ Thème Durée de validité Paramètres + E-mail + Lien + A proximité + QR Code + Envoie tes fichiers par Appareil photo Parcourir les fichiers Galerie photos et vidéos diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 6b540844df..6ea448e151 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -35,6 +35,11 @@ Tema Periodo di validità Parametri + Email + Link + Vicino + Codice QR + Inviate i vostri file tramite Macchina fotografica Sfogliare i file Galleria di foto e video diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 11fd8a0156..51f388933a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -38,6 +38,11 @@ Theme Validity period Settings + Email + Link + Proximity + QR Code + Send your files by Camera Browse files Photo and video gallery