From c08e9bd8c4064d4c89d964a01f8c9687d86bf25d Mon Sep 17 00:00:00 2001
From: code-a1 <68858676+code-a1@users.noreply.github.com>
Date: Thu, 21 Apr 2022 23:19:35 +0200
Subject: [PATCH] Added strings in strings.xml
---
.../com/ivy/wallet/ui/main/MainBottomBar.kt | 13 ++--
.../components/OnboardingToolbar.kt | 4 +-
.../ui/onboarding/components/Suggestions.kt | 3 +-
.../ui/onboarding/model/FromToTimeRange.kt | 8 ++-
.../ui/onboarding/steps/OnboardingAccounts.kt | 7 ++-
.../onboarding/steps/OnboardingCategories.kt | 7 ++-
.../onboarding/steps/OnboardingSetCurrency.kt | 6 +-
.../onboarding/steps/OnboardingSplashLogin.kt | 29 ++++-----
.../ui/onboarding/steps/OnboardingType.kt | 11 ++--
.../steps/archived/OnboardingPrivacyTC.kt | 17 +++---
.../steps/archived/OnboardingSetName.kt | 7 ++-
.../ui/planned/edit/EditPlannedScreen.kt | 8 ++-
.../wallet/ui/planned/edit/RecurringRule.kt | 7 ++-
.../ui/planned/list/PlannedPaymentCard.kt | 11 ++--
.../planned/list/PlannedPaymentsBottomBar.kt | 3 +-
.../planned/list/PlannedPaymentsLazyColumn.kt | 10 ++--
.../ui/planned/list/PlannedPaymentsScreen.kt | 4 +-
app/src/main/res/values/strings.xml | 59 +++++++++++++++++++
18 files changed, 148 insertions(+), 66 deletions(-)
diff --git a/app/src/main/java/com/ivy/wallet/ui/main/MainBottomBar.kt b/app/src/main/java/com/ivy/wallet/ui/main/MainBottomBar.kt
index e3ffd78416..df946ad9eb 100644
--- a/app/src/main/java/com/ivy/wallet/ui/main/MainBottomBar.kt
+++ b/app/src/main/java/com/ivy/wallet/ui/main/MainBottomBar.kt
@@ -19,6 +19,7 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.layout.layout
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.unit.dp
@@ -97,7 +98,7 @@ fun BoxWithConstraintsScope.BottomBar(
) {
Tab(
icon = R.drawable.ic_home,
- name = "Home",
+ name = stringResource(R.string.home),
selected = tab == MainTab.HOME,
selectedColor = Ivy
) {
@@ -108,7 +109,7 @@ fun BoxWithConstraintsScope.BottomBar(
Tab(
icon = R.drawable.ic_accounts,
- name = "Accounts",
+ name = stringResource(R.string.accounts),
selected = tab == MainTab.ACCOUNTS,
selectedColor = Green
) {
@@ -272,7 +273,7 @@ private fun TransactionButtons(
.alpha(buttonsShownPercent)
.zIndex(200f),
iconStart = R.drawable.ic_planned_payments,
- text = "Add planned payment",
+ text = stringResource(R.string.add_planned_payment),
solidBackground = true
) {
onAddPlannedPayment()
@@ -371,7 +372,7 @@ private fun AddIncomeButton(
onAddIncome()
}
.zIndex(200f),
- text = "ADD INCOME",
+ text = stringResource(R.string.add_income_uppercase),
style = UI.typo.c.style(
color = UI.colors.pureInverse,
fontWeight = FontWeight.ExtraBold,
@@ -457,7 +458,7 @@ private fun AddExpenseButton(
onAddExpense()
}
.zIndex(200f),
- text = "ADD EXPENSE",
+ text = stringResource(R.string.add_expense_uppercase),
style = UI.typo.c.style(
color = UI.colors.pureInverse,
fontWeight = FontWeight.ExtraBold,
@@ -543,7 +544,7 @@ private fun AddTransferButton(
onAddTransfer()
}
.zIndex(200f),
- text = "ACCOUNT TRANSFER",
+ text = stringResource(R.string.account_transfer),
style = UI.typo.c.style(
color = UI.colors.pureInverse,
fontWeight = FontWeight.ExtraBold,
diff --git a/app/src/main/java/com/ivy/wallet/ui/onboarding/components/OnboardingToolbar.kt b/app/src/main/java/com/ivy/wallet/ui/onboarding/components/OnboardingToolbar.kt
index 851550c730..0971f3c9f1 100644
--- a/app/src/main/java/com/ivy/wallet/ui/onboarding/components/OnboardingToolbar.kt
+++ b/app/src/main/java/com/ivy/wallet/ui/onboarding/components/OnboardingToolbar.kt
@@ -8,11 +8,13 @@ import androidx.compose.material.Text
import androidx.compose.runtime.Composable
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.tooling.preview.Preview
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.ui.IvyWalletComponentPreview
import com.ivy.wallet.ui.theme.Gray
import com.ivy.wallet.ui.theme.components.IvyToolbar
@@ -35,7 +37,7 @@ fun OnboardingToolbar(
onSkip()
}
.padding(all = 16.dp), //enlarge click area
- text = "Skip",
+ text = stringResource(R.string.skip),
style = UI.typo.b2.style(
color = Gray,
fontWeight = FontWeight.Bold
diff --git a/app/src/main/java/com/ivy/wallet/ui/onboarding/components/Suggestions.kt b/app/src/main/java/com/ivy/wallet/ui/onboarding/components/Suggestions.kt
index 549cc6666a..ef962be248 100644
--- a/app/src/main/java/com/ivy/wallet/ui/onboarding/components/Suggestions.kt
+++ b/app/src/main/java/com/ivy/wallet/ui/onboarding/components/Suggestions.kt
@@ -9,6 +9,7 @@ import androidx.compose.runtime.Composable
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.tooling.preview.Preview
import androidx.compose.ui.unit.dp
@@ -117,7 +118,7 @@ private fun AddNewButton(
Text(
modifier = Modifier.padding(vertical = 16.dp),
- text = "Add new",
+ text = stringResource(R.string.add_new),
style = UI.typo.b2.style(
color = UI.colors.pure,
fontWeight = FontWeight.Bold
diff --git a/app/src/main/java/com/ivy/wallet/ui/onboarding/model/FromToTimeRange.kt b/app/src/main/java/com/ivy/wallet/ui/onboarding/model/FromToTimeRange.kt
index 87495eefc9..8921b93819 100644
--- a/app/src/main/java/com/ivy/wallet/ui/onboarding/model/FromToTimeRange.kt
+++ b/app/src/main/java/com/ivy/wallet/ui/onboarding/model/FromToTimeRange.kt
@@ -1,7 +1,9 @@
package com.ivy.wallet.ui.onboarding.model
+import com.ivy.wallet.R
import com.ivy.wallet.domain.data.entity.Transaction
import com.ivy.wallet.domain.fp.data.ClosedTimeRange
+import com.ivy.wallet.stringRes
import com.ivy.wallet.utils.*
import java.time.LocalDateTime
@@ -36,13 +38,13 @@ data class FromToTimeRange(
"${from.toLocalDate().formatDateOnly()} - ${to.toLocalDate().formatDateOnly()}"
}
from != null && to == null -> {
- "From ${from.toLocalDate().formatDateOnly()}"
+ stringRes(R.string.from_date, from.toLocalDate().formatDateOnly())
}
from == null && to != null -> {
- "To ${to.toLocalDate().formatDateOnly()}"
+ stringRes(R.string.to_date, to.toLocalDate().formatDateOnly())
}
else -> {
- "Range"
+ stringRes(R.string.range)
}
}
}
diff --git a/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingAccounts.kt b/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingAccounts.kt
index ec857356e8..491f4aa236 100644
--- a/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingAccounts.kt
+++ b/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingAccounts.kt
@@ -12,6 +12,7 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.res.painterResource
+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
@@ -78,7 +79,7 @@ fun BoxWithConstraintsScope.OnboardingAccounts(
Text(
modifier = Modifier.padding(horizontal = 32.dp),
- text = "Add accounts",
+ text = stringResource(R.string.add_accounts),
style = UI.typo.h2.style(
fontWeight = FontWeight.Black
)
@@ -130,7 +131,7 @@ fun BoxWithConstraintsScope.OnboardingAccounts(
Text(
modifier = Modifier.padding(horizontal = 32.dp),
- text = "Suggestions",
+ text = stringResource(R.string.suggestion),
style = UI.typo.b1.style(
fontWeight = FontWeight.ExtraBold
)
@@ -173,7 +174,7 @@ fun BoxWithConstraintsScope.OnboardingAccounts(
.navigationBarsPadding()
.padding(bottom = 20.dp),
- text = "Next",
+ text = stringResource(R.string.next),
textColor = White,
backgroundGradient = GradientIvy,
hasNext = true,
diff --git a/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingCategories.kt b/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingCategories.kt
index d30ecd1840..e51dbb96dd 100644
--- a/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingCategories.kt
+++ b/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingCategories.kt
@@ -15,6 +15,7 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.res.painterResource
+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
@@ -73,7 +74,7 @@ fun BoxWithConstraintsScope.OnboardingCategories(
Text(
modifier = Modifier.padding(horizontal = 32.dp),
- text = "Add categories",
+ text = stringResource(R.string.add_categories),
style = UI.typo.h2.style(
fontWeight = FontWeight.Black
)
@@ -121,7 +122,7 @@ fun BoxWithConstraintsScope.OnboardingCategories(
Text(
modifier = Modifier.padding(horizontal = 32.dp),
- text = "Suggestions",
+ text = stringResource(R.string.suggestions),
style = UI.typo.b1.style(
fontWeight = FontWeight.ExtraBold
)
@@ -162,7 +163,7 @@ fun BoxWithConstraintsScope.OnboardingCategories(
.navigationBarsPadding()
.padding(bottom = 20.dp),
- text = "Finish",
+ text = stringResource(R.string.finish),
textColor = White,
backgroundGradient = GradientIvy,
hasNext = false,
diff --git a/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingSetCurrency.kt b/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingSetCurrency.kt
index 0646629ffc..8c4c140f27 100644
--- a/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingSetCurrency.kt
+++ b/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingSetCurrency.kt
@@ -5,6 +5,7 @@ import androidx.compose.material.Text
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
+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
@@ -13,6 +14,7 @@ import com.google.accompanist.insets.statusBarsPadding
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.IvyCurrency
import com.ivy.wallet.ui.IvyWalletPreview
import com.ivy.wallet.ui.theme.GradientIvy
@@ -56,7 +58,7 @@ fun BoxWithConstraintsScope.OnboardingSetCurrency(
Text(
modifier = Modifier.padding(horizontal = 32.dp),
- text = "Set currency",
+ text = stringResource(R.string.set_currency),
style = UI.typo.h2.style(
fontWeight = FontWeight.Black
)
@@ -92,7 +94,7 @@ fun BoxWithConstraintsScope.OnboardingSetCurrency(
.navigationBarsPadding()
.padding(bottom = 20.dp),
- text = "Set",
+ text = stringResource(R.string.set),
textColor = White,
backgroundGradient = GradientIvy,
hasNext = true,
diff --git a/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingSplashLogin.kt b/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingSplashLogin.kt
index 75d1cae573..640bce1293 100644
--- a/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingSplashLogin.kt
+++ b/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingSplashLogin.kt
@@ -20,6 +20,7 @@ import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.layout.layout
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.res.painterResource
+import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.font.FontWeight
@@ -181,7 +182,7 @@ fun BoxWithConstraintsScope.OnboardingSplashLogin(
ivyContext = ivyContext,
percentTransition = percentTransition
),
- text = "Your personal money manager",
+ text = stringResource(R.string.your_personal_money_manager),
style = UI.typo.b2.style(
color = UI.colors.pureInverse,
fontWeight = FontWeight.SemiBold
@@ -203,7 +204,7 @@ fun BoxWithConstraintsScope.OnboardingSplashLogin(
}
.padding(vertical = 8.dp)
.padding(end = 8.dp),
- text = "#opensource",
+ text = stringResource(R.string.opensource),
style = UI.typo.c.style(
color = Green,
fontWeight = FontWeight.Bold
@@ -261,10 +262,10 @@ private fun LoginSection(
LoginButton(
text = when (opGoogleSignIn) {
- is OpResult.Failure -> "Error. Try again: ${opGoogleSignIn.error()}"
- OpResult.Loading -> "Signing in..."
- is OpResult.Success -> "Success!"
- null -> "Login with Google"
+ is OpResult.Failure -> stringResource(R.string.google_error_try_again, opGoogleSignIn.error())
+ OpResult.Loading -> stringResource(R.string.google_signing_in)
+ is OpResult.Success -> stringResource(R.string.google_signing_in_success)
+ null -> stringResource(R.string.login_with_google)
},
textColor = White,
backgroundGradient = GradientRed,
@@ -288,7 +289,7 @@ private fun LoginSection(
LoginButton(
icon = R.drawable.ic_local_account,
- text = "Offline account",
+ text = stringResource(R.string.offline_account),
textColor = UI.colors.pureInverse,
backgroundGradient = Gradient.solid(UI.colors.medium),
hasShadow = false
@@ -322,7 +323,7 @@ private fun LoginWithGoogleExplanation() {
Column {
Text(
- text = "SYNC YOUR DATA ON THE IVY CLOUD",
+ text = stringResource(R.string.sync_data_ivy_cloud),
style = UI.typo.c.style(
color = Green,
fontWeight = FontWeight.ExtraBold
@@ -332,7 +333,7 @@ private fun LoginWithGoogleExplanation() {
Spacer(Modifier.height(2.dp))
Text(
- text = "Data integrity and protection aren't guaranteed!",
+ text = stringResource(R.string.data_integrity_protection_warning),
style = UI.typo.c.style(
color = UI.colors.pureInverse,
fontWeight = FontWeight.Medium
@@ -346,7 +347,7 @@ private fun LoginWithGoogleExplanation() {
private fun LocalAccountExplanation() {
Text(
modifier = Modifier.padding(start = 32.dp),
- text = "OR ENTER WITH OFFLINE ACCOUNT",
+ text = stringResource(R.string.or_enter_with_offline_account),
style = UI.typo.c.style(
color = Gray,
fontWeight = FontWeight.ExtraBold
@@ -357,7 +358,7 @@ private fun LocalAccountExplanation() {
Text(
modifier = Modifier.padding(start = 32.dp, end = 32.dp),
- text = "Your data will be saved locally (only on your phone) and won't be synced with the cloud. You risk losing it if you uninstall the app or change your device. You can always activate sync later if you decide to.",
+ text = stringResource(R.string.offline_warning),
style = UI.typo.c.style(
color = Gray,
fontWeight = FontWeight.Medium
@@ -367,9 +368,9 @@ private fun LocalAccountExplanation() {
@Composable
private fun PrivacyPolicyAndTC() {
- val terms = "Terms & Conditions"
- val privacy = "Privacy Policy"
- val text = "By signing in, you agree with our $terms and $privacy."
+ val terms = stringResource(R.string.terms_conditions)
+ val privacy = stringResource(R.string.privacy_policy)
+ val text = stringResource(R.string.by_signing_in, terms, privacy)
val tcStart = text.indexOf(terms)
val tcEnd = tcStart + terms.length
diff --git a/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingType.kt b/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingType.kt
index e90c616dca..1a0504715d 100644
--- a/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingType.kt
+++ b/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/OnboardingType.kt
@@ -7,6 +7,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
+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
@@ -48,7 +49,7 @@ fun OnboardingType(
Text(
modifier = Modifier.padding(horizontal = 32.dp),
- text = "Import CSV file",
+ text = stringResource(R.string.import_csv_file),
style = UI.typo.h2.style(
fontWeight = FontWeight.Black
)
@@ -58,7 +59,7 @@ fun OnboardingType(
Text(
modifier = Modifier.padding(horizontal = 32.dp),
- text = "from Ivy or another app",
+ text = stringResource(R.string.from_ivy_or_another_app),
style = UI.typo.nB2.style(
fontWeight = FontWeight.Bold,
color = Gray
@@ -84,7 +85,7 @@ fun OnboardingType(
Text(
modifier = Modifier.padding(horizontal = 32.dp),
- text = "Importing a backup file from another can take up to 5 min. You can always import your data later if you want to.",
+ text = stringResource(R.string.importing_another_time_warning),
style = UI.typo.b2.style(
fontWeight = FontWeight.Bold
)
@@ -95,7 +96,7 @@ fun OnboardingType(
IvyOutlinedButtonFillMaxWidth(
modifier = Modifier
.padding(horizontal = 16.dp),
- text = "Import backup file",
+ text = stringResource(R.string.import_backup_file),
iconStart = R.drawable.ic_export_csv,
iconTint = Green,
textColor = Green
@@ -109,7 +110,7 @@ fun OnboardingType(
modifier = Modifier
.padding(horizontal = 16.dp)
.fillMaxWidth(),
- text = "Start fresh",
+ text = stringResource(R.string.start_fresh),
textColor = White,
backgroundGradient = GradientIvy,
hasNext = true,
diff --git a/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/archived/OnboardingPrivacyTC.kt b/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/archived/OnboardingPrivacyTC.kt
index a6d4496ee2..2a88e58e3f 100644
--- a/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/archived/OnboardingPrivacyTC.kt
+++ b/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/archived/OnboardingPrivacyTC.kt
@@ -17,6 +17,7 @@ import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
+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
@@ -67,7 +68,7 @@ fun OnboardingPrivacyTC(
Text(
modifier = Modifier.padding(start = 32.dp),
- text = "Privacy and\ndata collection",
+ text = stringResource(R.string.privacy_and_data_collection),
style = UI.typo.h2.style(
fontWeight = FontWeight.ExtraBold
)
@@ -87,8 +88,8 @@ fun OnboardingPrivacyTC(
var privacyAccepted by remember { mutableStateOf(false) }
SwipeToAgree(
- swipeToAgreeText = "Swipe to agree with our Terms and conditions",
- agreedText = "Agreed with our Terms and conditions"
+ swipeToAgreeText = stringResource(R.string.swipe_to_agree_terms_conditions),
+ agreedText = stringResource(R.string.agreed_terms_conditions)
) {
tcAccepted = it
}
@@ -96,8 +97,8 @@ fun OnboardingPrivacyTC(
Spacer(Modifier.height(24.dp))
SwipeToAgree(
- swipeToAgreeText = "Swipe to agree with our Privacy policy",
- agreedText = "Agreed with our Privacy policy"
+ swipeToAgreeText = stringResource(R.string.swipe_to_agree_privacy_policy),
+ agreedText = stringResource(R.string.agreed_privacy_policy)
) {
privacyAccepted = it
}
@@ -116,14 +117,14 @@ private fun URLsRow() {
Spacer(Modifier.width(32.dp))
TextLink(
- text = "Terms and conditions",
+ text = stringResource(R.string.terms_and_conditions),
url = Constants.URL_TC
)
Spacer(Modifier.width(36.dp))
TextLink(
- text = "Privacy policy",
+ text = stringResource(R.string.privacy_policy),
url = Constants.URL_PRIVACY_POLICY
)
@@ -138,7 +139,7 @@ private fun LongText() {
start = 32.dp,
end = 48.dp
),
- text = "Track your income, expenses and budget with Ivy.\n\nIntuitive UI, recurring and planned payments, manage multiple accounts, organize transactions in categories, meaningful statistics, export to CSV and so much more.",
+ text = stringResource(R.string.wallet_description),
style = UI.typo.b2.style(
fontWeight = FontWeight.Medium
)
diff --git a/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/archived/OnboardingSetName.kt b/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/archived/OnboardingSetName.kt
index fa299f4d88..eeb41e6449 100644
--- a/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/archived/OnboardingSetName.kt
+++ b/app/src/main/java/com/ivy/wallet/ui/onboarding/steps/archived/OnboardingSetName.kt
@@ -13,6 +13,7 @@ import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalView
import androidx.compose.ui.res.painterResource
+import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardCapitalization
@@ -76,7 +77,7 @@ fun OnboardingSetName(
Text(
modifier = Modifier.padding(horizontal = 32.dp),
- text = "Enter your name\nto personalize your\nwallet",
+ text = stringResource(R.string.enter_your_name),
style = UI.typo.h2.style(
fontWeight = FontWeight.ExtraBold
)
@@ -99,7 +100,7 @@ fun OnboardingSetName(
.fillMaxWidth()
.focusRequester(nameFocus),
value = nameTextField,
- hint = "What's your name?",
+ hint = stringResource(R.string.what_is_your_name),
keyboardOptions = KeyboardOptions(
capitalization = KeyboardCapitalization.Words,
autoCorrect = false,
@@ -123,7 +124,7 @@ fun OnboardingSetName(
Modifier
.padding(horizontal = 24.dp)
.fillMaxWidth(),
- text = "Enter",
+ text = stringResource(R.string.enter),
textColor = White,
backgroundGradient = GradientIvy,
hasNext = true,
diff --git a/app/src/main/java/com/ivy/wallet/ui/planned/edit/EditPlannedScreen.kt b/app/src/main/java/com/ivy/wallet/ui/planned/edit/EditPlannedScreen.kt
index 4fcc8b3b5b..7570d7140d 100644
--- a/app/src/main/java/com/ivy/wallet/ui/planned/edit/EditPlannedScreen.kt
+++ b/app/src/main/java/com/ivy/wallet/ui/planned/edit/EditPlannedScreen.kt
@@ -9,12 +9,14 @@ import androidx.compose.runtime.livedata.observeAsState
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.platform.testTag
+import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.lifecycle.viewmodel.compose.viewModel
import com.google.accompanist.insets.navigationBarsPadding
import com.google.accompanist.insets.statusBarsPadding
+import com.ivy.wallet.R
import com.ivy.wallet.domain.data.IntervalType
import com.ivy.wallet.domain.data.TransactionType
import com.ivy.wallet.domain.data.entity.Account
@@ -357,15 +359,15 @@ private fun BoxWithConstraintsScope.UI(
DeleteModal(
visible = deleteTrnModalVisible,
- title = "Confirm deletion",
- description = "Deleting this planned payment will delete all non-paid upcoming or overdue transactions associated with it.",
+ title = stringResource(R.string.confirm_deletion),
+ description = stringResource(R.string.planned_payment_confirm_deletion_description),
dismiss = { deleteTrnModalVisible = false }
) {
onDelete()
}
ChangeTransactionTypeModal(
- title = "Set payment type",
+ title = stringResource(R.string.set_payment_type),
visible = changeTransactionTypeModalVisible,
includeTransferType = false,
initialType = type,
diff --git a/app/src/main/java/com/ivy/wallet/ui/planned/edit/RecurringRule.kt b/app/src/main/java/com/ivy/wallet/ui/planned/edit/RecurringRule.kt
index eef5fdc675..f8fe902beb 100644
--- a/app/src/main/java/com/ivy/wallet/ui/planned/edit/RecurringRule.kt
+++ b/app/src/main/java/com/ivy/wallet/ui/planned/edit/RecurringRule.kt
@@ -8,6 +8,7 @@ import androidx.compose.runtime.Composable
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.tooling.preview.Preview
import androidx.compose.ui.unit.dp
@@ -52,7 +53,7 @@ fun RecurringRule(
} else {
AddPrimaryAttributeButton(
icon = R.drawable.ic_planned_payments,
- text = "Add planned date of payment",
+ text = stringResource(R.string.add_planned_date_payment),
onClick = onShowRecurringRuleModal
)
}
@@ -94,7 +95,7 @@ private fun RecurringRuleCard(
Column {
Text(
- text = if (oneTime) "Planned for" else "Planned start at",
+ text = if (oneTime) stringResource(R.string.planned_for) else stringResource(R.string.planned_start_at),
style = UI.typo.b2.style(
fontWeight = FontWeight.ExtraBold,
color = UI.colors.pureInverse
@@ -106,7 +107,7 @@ private fun RecurringRuleCard(
val intervalTypeLabel = intervalType.forDisplay(intervalN).uppercaseLocal()
Text(
- text = "REPEATS EVERY $intervalN $intervalTypeLabel",
+ text = stringResource(R.string.repeats_every, intervalN, intervalTypeLabel),
style = UI.typo.c.style(
fontWeight = FontWeight.ExtraBold,
color = Orange
diff --git a/app/src/main/java/com/ivy/wallet/ui/planned/list/PlannedPaymentCard.kt b/app/src/main/java/com/ivy/wallet/ui/planned/list/PlannedPaymentCard.kt
index 1323067ea0..cf4f689437 100644
--- a/app/src/main/java/com/ivy/wallet/ui/planned/list/PlannedPaymentCard.kt
+++ b/app/src/main/java/com/ivy/wallet/ui/planned/list/PlannedPaymentCard.kt
@@ -13,6 +13,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
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
@@ -158,7 +159,7 @@ private fun PlannedPaymentHeaderRow(
val account = accounts.find { it.id == plannedPayment.accountId }
IvyButton(
backgroundGradient = Gradient.solid(UI.colors.pure),
- text = account?.name ?: "deleted",
+ text = account?.name ?: stringResource(R.string.deleted),
iconTint = UI.colors.pureInverse,
iconStart = getCustomIconIdS(account?.icon, R.drawable.ic_custom_account_s),
textStyle = UI.typo.c.style(
@@ -196,7 +197,7 @@ private fun RuleTextRow(
if (oneTime) {
Text(
- text = "PLANNED FOR ",
+ text = stringResource(R.string.planned_for_uppercase),
style = UI.typo.nC.style(
color = Orange,
fontWeight = FontWeight.SemiBold
@@ -205,7 +206,7 @@ private fun RuleTextRow(
Text(
modifier = Modifier.padding(bottom = 1.dp),
text = startDate?.toLocalDate()?.formatDateOnlyWithYear()?.uppercaseLocal()
- ?: "null",
+ ?: stringResource(R.string.null_text),
style = UI.typo.nC.style(
color = Orange,
fontWeight = FontWeight.ExtraBold
@@ -214,7 +215,7 @@ private fun RuleTextRow(
} else {
val startDateFormatted = startDate?.toLocalDate()?.formatDateOnly()?.uppercaseLocal()
Text(
- text = "STARTS $startDateFormatted ",
+ text = stringResource(R.string.starts_date, startDateFormatted ?: ""),
style = UI.typo.nC.style(
color = Orange,
fontWeight = FontWeight.SemiBold
@@ -223,7 +224,7 @@ private fun RuleTextRow(
val intervalTypeFormatted = intervalType?.forDisplay(intervalN ?: 0)?.uppercaseLocal()
Text(
modifier = Modifier.padding(bottom = 1.dp),
- text = "REPEATS EVERY $intervalN $intervalTypeFormatted",
+ text = stringResource(R.string.repeats_every, intervalN ?: 0 , intervalTypeFormatted ?: ""),
style = UI.typo.nC.style(
color = Orange,
fontWeight = FontWeight.ExtraBold
diff --git a/app/src/main/java/com/ivy/wallet/ui/planned/list/PlannedPaymentsBottomBar.kt b/app/src/main/java/com/ivy/wallet/ui/planned/list/PlannedPaymentsBottomBar.kt
index cbe3d977fd..dc50a864f0 100644
--- a/app/src/main/java/com/ivy/wallet/ui/planned/list/PlannedPaymentsBottomBar.kt
+++ b/app/src/main/java/com/ivy/wallet/ui/planned/list/PlannedPaymentsBottomBar.kt
@@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.width
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
+import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
@@ -42,7 +43,7 @@ fun BoxWithConstraintsScope.PlannedPaymentsBottomBar(
IvyOutlinedButton(
iconStart = R.drawable.ic_planned_payments,
- text = "Add payment",
+ text = stringResource(R.string.add_payment),
solidBackground = true
) {
onAdd()
diff --git a/app/src/main/java/com/ivy/wallet/ui/planned/list/PlannedPaymentsLazyColumn.kt b/app/src/main/java/com/ivy/wallet/ui/planned/list/PlannedPaymentsLazyColumn.kt
index 76ba02e91e..f94775464b 100644
--- a/app/src/main/java/com/ivy/wallet/ui/planned/list/PlannedPaymentsLazyColumn.kt
+++ b/app/src/main/java/com/ivy/wallet/ui/planned/list/PlannedPaymentsLazyColumn.kt
@@ -6,6 +6,7 @@ import androidx.compose.material.Text
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
+import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
@@ -19,6 +20,7 @@ import com.ivy.wallet.R
import com.ivy.wallet.domain.data.entity.Account
import com.ivy.wallet.domain.data.entity.Category
import com.ivy.wallet.domain.data.entity.PlannedPaymentRule
+import com.ivy.wallet.stringRes
import com.ivy.wallet.ui.EditPlanned
import com.ivy.wallet.ui.theme.Gray
@@ -111,7 +113,7 @@ private fun LazyListScope.plannedPaymentItems(
SectionDivider(
expanded = oneTimeExpanded,
setExpanded = setOneTimeExpanded,
- title = "One time payments",
+ title = stringRes(R.string.one_time_payments),
titleColor = UI.colors.pureInverse,
baseCurrency = currency,
income = oneTimeIncome,
@@ -143,7 +145,7 @@ private fun LazyListScope.plannedPaymentItems(
SectionDivider(
expanded = recurringExpanded,
setExpanded = setRecurringExpanded,
- title = "Recurring payments",
+ title = stringRes(R.string.recurring_payments),
titleColor = UI.colors.pureInverse,
baseCurrency = currency,
income = recurringIncome,
@@ -212,7 +214,7 @@ private fun LazyItemScope.NoPlannedPaymentsEmptyState() {
Spacer(Modifier.height(24.dp))
Text(
- text = "No planned payments",
+ text = stringResource(R.string.no_planned_payments),
style = UI.typo.b1.style(
color = Gray,
fontWeight = FontWeight.ExtraBold
@@ -222,7 +224,7 @@ private fun LazyItemScope.NoPlannedPaymentsEmptyState() {
Spacer(Modifier.height(8.dp))
Text(
- text = "You don't have any planed payments.\nPress the '⚡' bottom at the bottom to add one.",
+ text = stringResource(R.string.no_planned_payments_description),
style = UI.typo.b2.style(
color = Gray,
fontWeight = FontWeight.Medium,
diff --git a/app/src/main/java/com/ivy/wallet/ui/planned/list/PlannedPaymentsScreen.kt b/app/src/main/java/com/ivy/wallet/ui/planned/list/PlannedPaymentsScreen.kt
index 6639c8a096..8568c94325 100644
--- a/app/src/main/java/com/ivy/wallet/ui/planned/list/PlannedPaymentsScreen.kt
+++ b/app/src/main/java/com/ivy/wallet/ui/planned/list/PlannedPaymentsScreen.kt
@@ -10,6 +10,7 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.livedata.observeAsState
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.toArgb
+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
@@ -17,6 +18,7 @@ import androidx.lifecycle.viewmodel.compose.viewModel
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.IntervalType
import com.ivy.wallet.domain.data.TransactionType
import com.ivy.wallet.domain.data.entity.Account
@@ -81,7 +83,7 @@ private fun BoxWithConstraintsScope.UI(
Text(
modifier = Modifier.padding(start = 24.dp),
- text = "Planned payments",
+ text = stringResource(R.string.planned_payments_inline),
style = UI.typo.h2.style(
fontWeight = FontWeight.ExtraBold,
color = UI.colors.pureInverse
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index dae1a431c1..1b119bd8bc 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -132,4 +132,63 @@
Note: Deleting this category will remove it permanently.
Edit
transactions
+ Home
+ Add planned payment
+ ADD INCOME
+ ADD EXPENSE
+ ACCOUNT TRANSFER
+ Skip
+ Add new
+ From %1$s
+ To %1$s
+ Range
+ Privacy and\ndata collection
+ Swipe to agree with our Terms and conditions
+ Agreed with our Terms and conditions
+ Swipe to agree with our Privacy policy
+ Agreed with our Privacy policy
+ Terms and conditions
+ Privacy policy
+ Track your income, expenses and budget with Ivy.\n\nIntuitive UI, recurring and planned payments, manage multiple accounts, organize transactions in categories, meaningful statistics, export to CSV and so much more.
+ Enter your name\nto personalize your\nwallet
+ What\'s your name?
+ Enter
+ Add accounts
+ Suggestions
+ Next
+ Add categories
+ Suggestions
+ Set
+ Your personal money manager
+ #opensource
+ Error. Try again: %1$s
+ Signing in...
+ Success!
+ Login with Google
+ Offline account
+ SYNC YOUR DATA ON THE IVY CLOUD
+ Data integrity and protection aren\'t guaranteed!
+ OR ENTER WITH OFFLINE ACCOUNT
+ Your data will be saved locally (only on your phone) and won\'t be synced with the cloud. You risk losing it if you uninstall the app or change your device. You can always activate sync later if you decide to.
+
+ By signing in, you agree with our %1$s and %2$s.
+ Import CSV file
+ from Ivy or another app
+ Importing a backup file from another can take up to 5 min. You can always import your data later if you want to.
+ Import backup file
+ Start fresh
+ Deleting this planned payment will delete all non-paid upcoming or overdue transactions associated with it.
+ Set payment type
+ Planned start at
+ REPEATS EVERY %1$d %2$s
+ deleted
+ "PLANNED FOR "
+ null
+ "STARTS %1$s "
+ Add payment
+ One time payments
+ Recurring payments
+ No planned payments
+ You don\'t have any planned payments.\nPress the \'⚡\' bottom at the bottom to add one.
+ Planned payments