From 14a021c62d215cf26406397539e33406231efd73 Mon Sep 17 00:00:00 2001 From: nostrbuddha Date: Tue, 26 Nov 2024 12:47:55 +0530 Subject: [PATCH] - added translation keys/strings to CurrencyList/OfferList screens (missed staging the files) --- .../network/bisq/mobile/i18n/FrStrings.kt | 6 +++++ .../network/bisq/mobile/i18n/Strings.kt | 6 +++++ .../ui/components/CurrencyProfileCard.kt | 4 ++- .../molecules/ConfirmationDialog.kt | 1 + .../ui/uicases/offers/CurrencyListScreen.kt | 2 +- .../ui/uicases/offers/OffersListScreen.kt | 26 ++++++------------- 6 files changed, 25 insertions(+), 20 deletions(-) diff --git a/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/i18n/FrStrings.kt b/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/i18n/FrStrings.kt index c4d5d745..56df8ec3 100644 --- a/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/i18n/FrStrings.kt +++ b/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/i18n/FrStrings.kt @@ -148,4 +148,10 @@ val FRStrings = Strings( buttons_next = "[FR] Next", buttons_submit = "[FR] Submit", buttons_cancel = "[FR] Cancel", + + common_offers = "[FR] offers", + common_search = "[FR] Search", + + offers_list_buy_from = "[FR] Buy from", + offers_list_sell_to = "[FR] Sell to", ) diff --git a/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/i18n/Strings.kt b/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/i18n/Strings.kt index b23042f6..2ab2c063 100644 --- a/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/i18n/Strings.kt +++ b/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/i18n/Strings.kt @@ -144,4 +144,10 @@ data class Strings( val buttons_next: String, val buttons_submit: String, val buttons_cancel: String, + + val common_offers: String, + val common_search: String, + + val offers_list_buy_from: String, + val offers_list_sell_to: String, ) \ No newline at end of file diff --git a/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/components/CurrencyProfileCard.kt b/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/components/CurrencyProfileCard.kt index ea2c7b36..9334e7a2 100644 --- a/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/components/CurrencyProfileCard.kt +++ b/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/components/CurrencyProfileCard.kt @@ -10,6 +10,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import bisqapps.shared.presentation.generated.resources.Res +import cafe.adriel.lyricist.LocalStrings import coil3.compose.AsyncImage import network.bisq.mobile.domain.data.model.FiatCurrency import network.bisq.mobile.presentation.ui.components.atoms.BisqText @@ -26,6 +27,7 @@ fun CurrencyProfileCard( currency: FiatCurrency, onClick: (FiatCurrency) -> Unit) { + val strings = LocalStrings.current val interactionSource = remember { MutableInteractionSource() } Row( @@ -61,7 +63,7 @@ fun CurrencyProfileCard( } } BisqText.smallRegular( - text = "${currency.offerCount.toString()} offers", + text = "${currency.offerCount.toString()} ${strings.common_offers}", color = BisqTheme.colors.primary, ) } diff --git a/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/components/molecules/ConfirmationDialog.kt b/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/components/molecules/ConfirmationDialog.kt index 057e72bc..94b6722d 100644 --- a/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/components/molecules/ConfirmationDialog.kt +++ b/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/components/molecules/ConfirmationDialog.kt @@ -11,6 +11,7 @@ import network.bisq.mobile.presentation.ui.components.atoms.BisqText import network.bisq.mobile.presentation.ui.components.molecules.BisqDialog import network.bisq.mobile.presentation.ui.theme.BisqTheme +// TODO: Update default params with translation keys @Composable fun ConfirmationDialog( title: String = "", diff --git a/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/uicases/offers/CurrencyListScreen.kt b/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/uicases/offers/CurrencyListScreen.kt index aa17641c..7c4ea07a 100644 --- a/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/uicases/offers/CurrencyListScreen.kt +++ b/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/uicases/offers/CurrencyListScreen.kt @@ -40,7 +40,7 @@ fun CurrencyListScreen() { verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.SpaceBetween, ) { - MaterialTextField(text = "Search", onValueChanged = {}) + MaterialTextField(text = strings.common_search, onValueChanged = {}) SortIcon(modifier = Modifier.size(24.dp)) } Spacer(modifier = Modifier.height(12.dp)) diff --git a/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/uicases/offers/OffersListScreen.kt b/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/uicases/offers/OffersListScreen.kt index df48474b..e903a93b 100644 --- a/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/uicases/offers/OffersListScreen.kt +++ b/bisqapps/shared/presentation/src/commonMain/kotlin/network/bisq/mobile/presentation/ui/uicases/offers/OffersListScreen.kt @@ -19,6 +19,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.blur import androidx.compose.ui.unit.dp import androidx.navigation.NavController +import cafe.adriel.lyricist.LocalStrings import network.bisq.mobile.presentation.ViewPresenter import network.bisq.mobile.presentation.ui.components.layout.BisqStaticScaffold import network.bisq.mobile.presentation.ui.components.molecules.* @@ -31,12 +32,12 @@ interface IOffersList : ViewPresenter { @Composable fun OffersListScreen() { val presenter: ICurrencyList = koinInject() + val strings = LocalStrings.current + val states = listOf( - "Buy from", - "Sell to" + strings.offers_list_buy_from, + strings.offers_list_sell_to ) - val openDialog = remember { mutableStateOf(false) } - val rootNavController: NavController LaunchedEffect(Unit) { presenter.onViewAttached() @@ -44,10 +45,10 @@ fun OffersListScreen() { BisqStaticScaffold( topBar = { - TopBar(title = "Offers") + TopBar(title = strings.common_offers) }, ) { - Box(modifier = Modifier.fillMaxSize().blur(if (openDialog.value) 12.dp else 0.dp)) { + Box(modifier = Modifier.fillMaxSize()) { Column { Column( modifier = Modifier.fillMaxWidth(), @@ -62,22 +63,11 @@ fun OffersListScreen() { ) { items(3) { OfferCard(onClick = { - openDialog.value = !openDialog.value + // TODO: Do navigation here }) } } - if (openDialog.value) { - ConfirmationDialog( - message = "Do you want to take this trade?", - confirmButtonText = "Yes, please", - cancelButtonText = "Cancel", - onDismissRequest = { - openDialog.value = !openDialog.value - }, - ) - } - } } }