feat: localisation with lyricist
This commit is contained in:
@@ -64,6 +64,7 @@ import com.bitcointxoko.gudariwallet.ui.history.PaymentDetailScreen
|
||||
import com.bitcointxoko.gudariwallet.ui.nfc.NfcViewModel
|
||||
import com.bitcointxoko.gudariwallet.ui.receive.ReceiveScreen
|
||||
import com.bitcointxoko.gudariwallet.ui.send.SendScreen
|
||||
import com.bitcointxoko.gudariwallet.ui.send.SendStrings
|
||||
import com.bitcointxoko.gudariwallet.util.SendInputType
|
||||
import kotlinx.coroutines.delay
|
||||
|
||||
@@ -90,6 +91,22 @@ fun WalletScreen(
|
||||
lyricist : Lyricist<AppStrings>
|
||||
) {
|
||||
val strings = LocalAppStrings.current
|
||||
val sendStrings = remember(strings) {
|
||||
SendStrings(
|
||||
lnurlAuthNotSupported = strings.sendVmLnurlAuthNotSupported,
|
||||
unrecognisedInput = strings.sendVmUnrecognisedInput,
|
||||
paymentFailed = strings.sendVmPaymentFailed,
|
||||
couldNotFetchInvoice = strings.sendVmCouldNotFetchInvoice,
|
||||
couldNotDecodeInvoice = strings.sendVmCouldNotDecodeInvoice,
|
||||
onChainNotSupported = strings.sendVmOnChainNotSupported,
|
||||
channelRequestNotSupported = strings.sendVmChannelRequestNotSupported,
|
||||
couldNotResolveAddress = strings.sendVmCouldNotResolveAddress,
|
||||
emptyResponse = strings.sendVmEmptyResponse,
|
||||
unsupportedType = strings.sendVmUnsupportedType,
|
||||
paymentFailedRescan = strings.sendVmPaymentFailedRescan,
|
||||
authFailed = strings.sendVmAuthFailed,
|
||||
)
|
||||
}
|
||||
val navController = rememberNavController()
|
||||
val context = LocalContext.current
|
||||
val historyFactory = remember {
|
||||
@@ -153,7 +170,7 @@ fun WalletScreen(
|
||||
if (intentUri != null) {
|
||||
Log.d("WalletScreen", "INTENT [URI] deep link received: $intentUri")
|
||||
pendingPaymentUri.value = null
|
||||
vm.scan(intentUri)
|
||||
vm.scan(intentUri, sendStrings)
|
||||
navController.navigate(TabItem.Send.route) {
|
||||
launchSingleTop = true
|
||||
}
|
||||
@@ -316,7 +333,8 @@ fun WalletScreen(
|
||||
navController.navigate("payment_detail/$checkingId") {
|
||||
launchSingleTop = true
|
||||
}
|
||||
}
|
||||
},
|
||||
sendStrings
|
||||
)
|
||||
}
|
||||
|
||||
@@ -324,7 +342,7 @@ fun WalletScreen(
|
||||
composable(ROUTE_SCANNER) {
|
||||
QrScannerScreen(
|
||||
onScanned = { scanned ->
|
||||
vm.scan(scanned)
|
||||
vm.scan(scanned, sendStrings)
|
||||
val wentBack = navController.popBackStack(TabItem.Send.route, inclusive = false)
|
||||
if (!wentBack) {
|
||||
navController.navigate(TabItem.Send.route) {
|
||||
@@ -418,7 +436,7 @@ fun WalletScreen(
|
||||
.fillMaxWidth()
|
||||
.clickable {
|
||||
vm.dismissClipboardOffer()
|
||||
vm.scan(offer.raw)
|
||||
vm.scan(offer.raw, sendStrings)
|
||||
navController.navigate(TabItem.Send.route) {
|
||||
launchSingleTop = true
|
||||
}
|
||||
@@ -474,7 +492,7 @@ fun WalletScreen(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.clickable {
|
||||
vm.scan(offer.raw)
|
||||
vm.scan(offer.raw, sendStrings)
|
||||
nfcVm.dismissNfcOffer()
|
||||
navController.navigate(TabItem.Send.route) {
|
||||
launchSingleTop = true
|
||||
|
||||
Reference in New Issue
Block a user