Skip to content

Commit

Permalink
Import strings
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarX committed Aug 20, 2024
1 parent d139c98 commit e1e87a6
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
)
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -49,10 +50,10 @@ fun TransferTypeButtons(items: List<TransferType>, 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,
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
<string name="settingsOptionTheme">Thema</string>
<string name="settingsOptionValidityPeriod">Dauer der Gültigkeit</string>
<string name="settingsTitle">Einstellungen</string>
<string name="transferTypeEmail">E-Mail</string>
<string name="transferTypeLink">Link</string>
<string name="transferTypeProximity">In der Nähe</string>
<string name="transferTypeQrCode">QR-Code</string>
<string name="transferTypeTitle">Schicke deine Dateien per</string>
<string name="transferUploadSourceChoiceCamera">Kamera</string>
<string name="transferUploadSourceChoiceFiles">Dateien durchsuchen</string>
<string name="transferUploadSourceChoiceGallery">Foto- und Videogalerie</string>
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
<string name="settingsOptionTheme">Tema</string>
<string name="settingsOptionValidityPeriod">Periodo de validez</string>
<string name="settingsTitle">Parámetros</string>
<string name="transferTypeEmail">Correo electrónico</string>
<string name="transferTypeLink">Enlace</string>
<string name="transferTypeProximity">Proximidad</string>
<string name="transferTypeQrCode">Código QR</string>
<string name="transferTypeTitle">Envía tus archivos por</string>
<string name="transferUploadSourceChoiceCamera">Cámara</string>
<string name="transferUploadSourceChoiceFiles">Examinar archivos</string>
<string name="transferUploadSourceChoiceGallery">Galería de fotos y vídeos</string>
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
<string name="settingsOptionTheme">Thème</string>
<string name="settingsOptionValidityPeriod">Durée de validité</string>
<string name="settingsTitle">Paramètres</string>
<string name="transferTypeEmail">E-mail</string>
<string name="transferTypeLink">Lien</string>
<string name="transferTypeProximity">A proximité</string>
<string name="transferTypeQrCode">QR Code</string>
<string name="transferTypeTitle">Envoie tes fichiers par</string>
<string name="transferUploadSourceChoiceCamera">Appareil photo</string>
<string name="transferUploadSourceChoiceFiles">Parcourir les fichiers</string>
<string name="transferUploadSourceChoiceGallery">Galerie photos et vidéos</string>
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
<string name="settingsOptionTheme">Tema</string>
<string name="settingsOptionValidityPeriod">Periodo di validità</string>
<string name="settingsTitle">Parametri</string>
<string name="transferTypeEmail">Email</string>
<string name="transferTypeLink">Link</string>
<string name="transferTypeProximity">Vicino</string>
<string name="transferTypeQrCode">Codice QR</string>
<string name="transferTypeTitle">Inviate i vostri file tramite</string>
<string name="transferUploadSourceChoiceCamera">Macchina fotografica</string>
<string name="transferUploadSourceChoiceFiles">Sfogliare i file</string>
<string name="transferUploadSourceChoiceGallery">Galleria di foto e video</string>
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
<string name="settingsOptionTheme">Theme</string>
<string name="settingsOptionValidityPeriod">Validity period</string>
<string name="settingsTitle">Settings</string>
<string name="transferTypeEmail">Email</string>
<string name="transferTypeLink">Link</string>
<string name="transferTypeProximity">Proximity</string>
<string name="transferTypeQrCode">QR Code</string>
<string name="transferTypeTitle">Send your files by</string>
<string name="transferUploadSourceChoiceCamera">Camera</string>
<string name="transferUploadSourceChoiceFiles">Browse files</string>
<string name="transferUploadSourceChoiceGallery">Photo and video gallery</string>
Expand Down

0 comments on commit e1e87a6

Please sign in to comment.