diff --git a/app/src/main/java/com/ivy/wallet/ui/accounts/AccountsTab.kt b/app/src/main/java/com/ivy/wallet/ui/accounts/AccountsTab.kt index d2c22ad2d8..e47cc15cd8 100644 --- a/app/src/main/java/com/ivy/wallet/ui/accounts/AccountsTab.kt +++ b/app/src/main/java/com/ivy/wallet/ui/accounts/AccountsTab.kt @@ -10,6 +10,7 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.toArgb import androidx.compose.ui.platform.testTag +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @@ -98,7 +99,7 @@ private fun BoxWithConstraintsScope.UI( Column { Text( - text = "Accounts", + text = stringResource(R.string.accounts), style = UI.typo.b1.style( color = UI.colors.pureInverse, fontWeight = FontWeight.ExtraBold @@ -109,11 +110,10 @@ private fun BoxWithConstraintsScope.UI( Spacer(Modifier.height(4.dp)) Text( - text = "Total: $baseCurrency ${ + text = stringResource(R.string.total, baseCurrency, totalBalanceWithExcluded.format( - baseCurrency - ) - }", + baseCurrency + )), style = UI.typo.nB2.style( color = Gray, fontWeight = FontWeight.Bold @@ -233,9 +233,9 @@ private fun AccountCard( IncomeExpensesRow( currency = currency, - incomeLabel = "INCOME THIS MONTH", + incomeLabel = stringResource(R.string.month_income), income = accountData.monthlyIncome, - expensesLabel = "EXPENSES THIS MONTH", + expensesLabel = stringResource(R.string.month_expenses), expenses = accountData.monthlyExpenses ) @@ -289,7 +289,7 @@ private fun AccountHeader( modifier = Modifier .align(Alignment.Bottom) .padding(bottom = 4.dp), - text = "(excluded)", + text = stringResource(R.string.excluded), style = UI.typo.c.style( color = account.color.toComposeColor().dynamicContrast() ) @@ -389,4 +389,4 @@ private fun PreviewAccountsTab() { onEditAccount = { _, _ -> } ) } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/ivy/wallet/ui/accounts/IncomeExpensesRow.kt b/app/src/main/java/com/ivy/wallet/ui/accounts/IncomeExpensesRow.kt index 534e14d203..619e637076 100644 --- a/app/src/main/java/com/ivy/wallet/ui/accounts/IncomeExpensesRow.kt +++ b/app/src/main/java/com/ivy/wallet/ui/accounts/IncomeExpensesRow.kt @@ -7,9 +7,11 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp +import com.ivy.wallet.R import com.ivy.design.l0_system.UI import com.ivy.design.l0_system.style import com.ivy.wallet.ui.theme.wallet.AmountCurrencyB1 @@ -19,9 +21,9 @@ fun IncomeExpensesRow( modifier: Modifier = Modifier, textColor: Color = UI.colors.pureInverse, dividerColor: Color = UI.colors.medium, - incomeLabel: String = "INCOME", + incomeLabel: String = stringResource(R.string.income_uppercase), income: Double, - expensesLabel: String = "EXPENSES", + expensesLabel: String = stringResource(R.string.expenses_uppercase), expenses: Double, currency: String, center: Boolean = true, @@ -113,4 +115,4 @@ private fun LabelAmountColumn( } } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/ivy/wallet/ui/balance/BalanceScreen.kt b/app/src/main/java/com/ivy/wallet/ui/balance/BalanceScreen.kt index f104515347..b16638dfc6 100644 --- a/app/src/main/java/com/ivy/wallet/ui/balance/BalanceScreen.kt +++ b/app/src/main/java/com/ivy/wallet/ui/balance/BalanceScreen.kt @@ -6,6 +6,7 @@ import androidx.compose.runtime.* import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.rotate +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @@ -144,7 +145,7 @@ private fun ColumnScope.CurrentBalance( ) { Text( modifier = Modifier.align(Alignment.CenterHorizontally), - text = "CURRENT BALANCE", + text = stringResource(R.string.current_balance), style = UI.typo.b2.style( color = Gray, fontWeight = FontWeight.ExtraBold @@ -170,7 +171,7 @@ private fun ColumnScope.BalanceAfterPlannedPayments( Text( modifier = Modifier .padding(horizontal = 32.dp), - text = "BALANCE AFTER PLANNED PAYMENTS", + text = stringResource(R.string.balance_after_payments), style = UI.typo.b2.style( color = Orange, fontWeight = FontWeight.ExtraBold diff --git a/app/src/main/java/com/ivy/wallet/ui/bankintegrations/ConnectBankScreen.kt b/app/src/main/java/com/ivy/wallet/ui/bankintegrations/ConnectBankScreen.kt index ae625181c4..1723dd09ca 100644 --- a/app/src/main/java/com/ivy/wallet/ui/bankintegrations/ConnectBankScreen.kt +++ b/app/src/main/java/com/ivy/wallet/ui/bankintegrations/ConnectBankScreen.kt @@ -8,11 +8,13 @@ import androidx.compose.runtime.livedata.observeAsState import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.lifecycle.viewmodel.compose.viewModel import com.google.accompanist.insets.systemBarsPadding +import com.ivy.wallet.R import com.ivy.design.l0_system.UI import com.ivy.design.l0_system.style import com.ivy.wallet.ui.ConnectBank @@ -69,13 +71,13 @@ private fun UI( horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center ) { - IvyButton(text = "Connect") { + IvyButton(text = stringResource(R.string.connect)) { onConnect() } Spacer(Modifier.height(24.dp)) - IvyButton(text = "Sync transactions") { + IvyButton(text = stringResource(R.string.sync_transactions)) { onFetchTransactions() } @@ -83,7 +85,7 @@ private fun UI( Spacer(Modifier.height(24.dp)) Text( - text = "Syncing transactions...", + text = stringResource(R.string.syncing_transactions), style = UI.typo.b2.style( color = Orange, fontWeight = FontWeight.ExtraBold @@ -97,7 +99,7 @@ private fun UI( verticalAlignment = Alignment.CenterVertically ) { Text( - "Bank sync enabled:" + stringResource(R.string.bank_sync_enabled) ) Spacer(Modifier.width(16.dp)) @@ -111,7 +113,7 @@ private fun UI( Spacer(Modifier.height(24.dp)) - IvyButton(text = "Remove customer") { + IvyButton(text = stringResource(R.string.remove_customer)) { onRemoveCustomer() } } @@ -128,4 +130,4 @@ private fun Preview() { onConnect = {} ) } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/ivy/wallet/ui/budget/BudgetBottomBar.kt b/app/src/main/java/com/ivy/wallet/ui/budget/BudgetBottomBar.kt index dbffc7125c..29f2731c0a 100644 --- a/app/src/main/java/com/ivy/wallet/ui/budget/BudgetBottomBar.kt +++ b/app/src/main/java/com/ivy/wallet/ui/budget/BudgetBottomBar.kt @@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import com.ivy.wallet.R import com.ivy.wallet.ui.IvyWalletPreview @@ -20,7 +21,7 @@ internal fun BoxWithConstraintsScope.BudgetBottomBar( ) { BackBottomBar(onBack = onClose) { IvyButton( - text = "Add budget", + text = stringResource(R.string.add_budget), iconStart = R.drawable.ic_plus ) { onAdd() @@ -45,4 +46,4 @@ private fun PreviewBottomBar() { onClose = {} ) } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/ivy/wallet/ui/budget/BudgetScreen.kt b/app/src/main/java/com/ivy/wallet/ui/budget/BudgetScreen.kt index 985f9a1f65..08916b5347 100644 --- a/app/src/main/java/com/ivy/wallet/ui/budget/BudgetScreen.kt +++ b/app/src/main/java/com/ivy/wallet/ui/budget/BudgetScreen.kt @@ -9,6 +9,7 @@ import androidx.compose.runtime.livedata.observeAsState import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.testTag +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview @@ -131,9 +132,8 @@ private fun BoxWithConstraintsScope.UI( Spacer(Modifier.weight(1f)) NoBudgetsEmptyState( - emptyStateTitle = "No budgets", - emptyStateText = "You don't have any budgets set.\n" + - "Tap the \"+ Add budget\" to add one." + emptyStateTitle = stringResource(R.string.no_budgets), + emptyStateText = stringResource(R.string.no_budgets) ) Spacer(Modifier.weight(1f)) @@ -208,7 +208,7 @@ private fun Toolbar( .padding(start = 24.dp, end = 16.dp) ) { Text( - text = "Budgets", + text = stringResource(R.string.budgets), style = UI.typo.h2.style( color = UI.colors.pureInverse, fontWeight = FontWeight.ExtraBold @@ -231,11 +231,11 @@ private fun Toolbar( Spacer(Modifier.height(4.dp)) val categoryBudgetText = if (categoryBudgetsTotal > 0) { - "${categoryBudgetsTotal.format(baseCurrency)} $baseCurrency for categories" + stringResource(R.string.for_categories, categoryBudgetsTotal.format(baseCurrency), baseCurrency) } else "" val appBudgetMaxText = if (appBudgetMax > 0) { - "${appBudgetMax.format(baseCurrency)} $baseCurrency app budget" + stringResource(R.string.app_budget, appBudgetMax.format(baseCurrency), baseCurrency) } else "" val hasBothBudgetTypes = @@ -243,7 +243,8 @@ private fun Toolbar( Text( modifier = Modifier.testTag("budgets_info_text"), text = if (hasBothBudgetTypes) - "Budget info: $categoryBudgetText / $appBudgetMaxText" else "Budget info: $categoryBudgetText$appBudgetMaxText", + stringResource(R.string.budget_info_both, categoryBudgetText, appBudgetMaxText) + else stringResource(R.string.budget_info, categoryBudgetText, appBudgetMaxText), style = UI.typo.nC.style( color = Gray, fontWeight = FontWeight.ExtraBold @@ -437,4 +438,4 @@ private fun Preview_Budgets() { onReorder = {} ) } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/ivy/wallet/ui/category/CategoriesBottomBar.kt b/app/src/main/java/com/ivy/wallet/ui/category/CategoriesBottomBar.kt index cc12efca00..32efc856ab 100644 --- a/app/src/main/java/com/ivy/wallet/ui/category/CategoriesBottomBar.kt +++ b/app/src/main/java/com/ivy/wallet/ui/category/CategoriesBottomBar.kt @@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import com.ivy.wallet.R import com.ivy.wallet.ui.IvyWalletPreview @@ -20,7 +21,7 @@ internal fun BoxWithConstraintsScope.CategoriesBottomBar( ) { BackBottomBar(onBack = onClose) { IvyButton( - text = "Add category", + text = stringResource(R.string.add_category), iconStart = R.drawable.ic_plus ) { onAddCategory() @@ -45,4 +46,4 @@ private fun PreviewBottomBar() { onClose = {} ) } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/ivy/wallet/ui/charts/ChartsScreen.kt b/app/src/main/java/com/ivy/wallet/ui/charts/ChartsScreen.kt index c40ddfebd6..bd4751e839 100644 --- a/app/src/main/java/com/ivy/wallet/ui/charts/ChartsScreen.kt +++ b/app/src/main/java/com/ivy/wallet/ui/charts/ChartsScreen.kt @@ -10,6 +10,7 @@ import androidx.compose.runtime.* import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview @@ -19,6 +20,7 @@ import com.google.accompanist.insets.systemBarsPadding import com.ivy.design.api.navigation import com.ivy.design.l0_system.UI import com.ivy.design.l0_system.style +import com.ivy.wallet.R import com.ivy.wallet.domain.data.entity.Category import com.ivy.wallet.domain.fp.charts.ChartPeriod import com.ivy.wallet.domain.fp.charts.IncomeExpenseChartPoint @@ -169,7 +171,7 @@ private fun Toolbar() { Spacer(Modifier.width(32.dp)) Text( - text = "Charts", + text = stringResource(R.string.charts), style = UI.typo.h2.style( fontWeight = FontWeight.ExtraBold ) @@ -202,7 +204,7 @@ private fun Period( modifier = Modifier.clickable { togglePeriod() }, - text = "Period:", + text = stringResource(R.string.period), style = UI.typo.b1 ) @@ -275,4 +277,4 @@ private fun Preview() { baseCurrencyCode = "BGN", ) } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/ivy/wallet/ui/charts/charts/CategoryCharts.kt b/app/src/main/java/com/ivy/wallet/ui/charts/charts/CategoryCharts.kt index 27946ea082..c1297b8931 100644 --- a/app/src/main/java/com/ivy/wallet/ui/charts/charts/CategoryCharts.kt +++ b/app/src/main/java/com/ivy/wallet/ui/charts/charts/CategoryCharts.kt @@ -18,6 +18,7 @@ import com.ivy.design.l0_system.style import com.ivy.wallet.R import com.ivy.wallet.domain.data.entity.Category import com.ivy.wallet.domain.fp.charts.ChartPeriod +import com.ivy.wallet.stringRes import com.ivy.wallet.ui.charts.CategoryValues import com.ivy.wallet.ui.charts.toValue import com.ivy.wallet.ui.onboarding.model.toCloseTimeRangeUnsafe @@ -81,7 +82,7 @@ fun LazyListScope.categoryCharts( item { CategoriesChart( period = period, - title = "Expenses", + title = stringRes(R.string.expenses), baseCurrencyCode = baseCurrencyCode, categoryValues = categoryExpenseValues, countChart = false @@ -91,7 +92,7 @@ fun LazyListScope.categoryCharts( item { CategoriesChart( period = period, - title = "Expenses count", + title = stringRes(R.string.expenses_count), baseCurrencyCode = baseCurrencyCode, categoryValues = categoryExpenseCount, countChart = true @@ -101,7 +102,7 @@ fun LazyListScope.categoryCharts( item { CategoriesChart( period = period, - title = "Income", + title = stringRes(R.string.income), titleColor = Green, baseCurrencyCode = baseCurrencyCode, categoryValues = categoryIncomeValues, @@ -112,7 +113,7 @@ fun LazyListScope.categoryCharts( item { CategoriesChart( period = period, - title = "Income count", + title = stringRes(R.string.income_count), titleColor = Green, baseCurrencyCode = baseCurrencyCode, categoryValues = categoryIncomeCount, @@ -192,4 +193,4 @@ private fun CategoriesChart( // ) } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/ivy/wallet/ui/charts/charts/WalletCharts.kt b/app/src/main/java/com/ivy/wallet/ui/charts/charts/WalletCharts.kt index 8ed2e7595c..97ca7c9977 100644 --- a/app/src/main/java/com/ivy/wallet/ui/charts/charts/WalletCharts.kt +++ b/app/src/main/java/com/ivy/wallet/ui/charts/charts/WalletCharts.kt @@ -8,9 +8,11 @@ import androidx.compose.runtime.* import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import com.ivy.design.l0_system.UI import com.ivy.design.l0_system.style +import com.ivy.wallet.R import com.ivy.wallet.domain.fp.charts.ChartPeriod import com.ivy.wallet.domain.fp.charts.SingleChartPoint import com.ivy.wallet.ui.charts.toValues2 @@ -107,7 +109,7 @@ fun BalanceChart( Text( modifier = Modifier.padding(start = 24.dp), - text = "Balance chart", + text = stringResource(R.string.balance_chart), style = UI.typo.b1 ) @@ -118,7 +120,7 @@ fun BalanceChart( IvyLineChart( modifier = Modifier.padding(horizontal = 8.dp), height = 400.dp, - title = "BALANCE ${period.display().uppercase()}", + title = stringResource(R.string.balance, period.display().uppercase()), functions = listOf( Function( values = values, @@ -186,4 +188,4 @@ fun ChartInfoCard( Spacer(Modifier.width(24.dp)) } -} \ No newline at end of file +} diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7e3c045be9..58f8744d15 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,6 +1,37 @@ + Accounts + Total: %1$s %2$s + INCOME THIS MONTH + EXPENSES THIS MONTH + (excluded) + INCOME + EXPENSES APP LOCKED Authenticate to enter the app Unlock + CURRENT BALANCE + BALANCE AFTER PLANNED PAYMENTS + Connect + Sync transactions + Syncing transactions… + Bank sync enabled: + Remove customer + Add budget + No budgets + You don\'t have any budgets set.\nTap the "+ Add budget" to add one. + Budgets + %1$s %2$s for categories + %1$s %2$s app budget + Budget info: %1$s / %2$s + Budget info: %1$s%2$s + Add category + Expenses + Expenses count + Income + Income count + Balance chart + BALANCE %1$s + Charts + Period: