Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #848 from mhss1/develop
Browse files Browse the repository at this point in the history
Added Arabic translation.
  • Loading branch information
ILIYANGERMANOV authored May 6, 2022
2 parents d3b9ee4 + 949ba75 commit c72f951
Show file tree
Hide file tree
Showing 7 changed files with 450 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.ivy.wallet.ui.planned.list

import androidx.compose.foundation.layout.*
import androidx.compose.ui.res.stringResource
import androidx.compose.foundation.lazy.*
import androidx.compose.material.Text
import androidx.compose.runtime.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.lifecycle.viewmodel.compose.viewModel
import com.google.accompanist.insets.systemBarsPadding
import com.ivy.design.api.navigation
import com.ivy.design.l0_system.UI
import androidx.compose.ui.res.stringResource
import com.ivy.design.l0_system.style
import com.ivy.wallet.R
import com.ivy.wallet.domain.data.TransactionType
Expand Down Expand Up @@ -210,7 +211,6 @@ private fun BoxWithConstraintsScope.UI(
onEventHandler.invoke(ReportScreenEvent.OnPayOrGet(transaction = it))
},
emptyStateTitle = stringRes(R.string.no_transactions),

emptyStateText = stringRes(R.string.no_transactions_for_your_filter)
)
} else {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/ivy/wallet/ui/search/SearchScreen.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.ivy.wallet.ui.search

import androidx.compose.ui.res.stringResource
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.core.tween
import androidx.compose.foundation.background
Expand Down
12 changes: 7 additions & 5 deletions app/src/main/java/com/ivy/wallet/ui/theme/modal/BudgetModal.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.res.stringResource
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.core.Account
import com.ivy.wallet.domain.data.core.Budget
import com.ivy.wallet.domain.data.core.Category
Expand Down Expand Up @@ -119,7 +121,7 @@ fun BoxWithConstraintsScope.BudgetModal(
verticalAlignment = Alignment.CenterVertically
) {
ModalTitle(
text = if (modal?.budget != null) "Edit budget" else "Create budget"
text = if (modal?.budget != null) stringResource(R.string.edit_budget) else stringResource(R.string.create_budget)
)

if (initialBudget != null) {
Expand All @@ -137,7 +139,7 @@ fun BoxWithConstraintsScope.BudgetModal(
Spacer(Modifier.height(24.dp))

ModalNameInput(
hint = "Budget name",
hint = stringResource(R.string.budget_name),
autoFocusKeyboard = modal?.autoFocusKeyboard ?: true,
textFieldValue = nameTextFieldValue,
setTextFieldValue = {
Expand All @@ -158,7 +160,7 @@ fun BoxWithConstraintsScope.BudgetModal(
Spacer(Modifier.height(24.dp))

ModalAmountSection(
label = "BUDGET AMOUNT",
label = stringResource(R.string.budget_amount_uppercase),
currency = modal?.baseCurrency ?: "",
amount = amount,
amountPaddingTop = 24.dp,
Expand All @@ -183,8 +185,8 @@ fun BoxWithConstraintsScope.BudgetModal(

DeleteModal(
visible = deleteModalVisible,
title = "Confirm deletion",
description = "Are you sure that you want to delete \"${nameTextFieldValue.text}\" budget?",
title = stringResource(R.string.confirm_deletion),
description = stringResource(R.string.confirm_budget_deletion_warning, nameTextFieldValue.text),
dismiss = { deleteModalVisible = false }
) {
if (initialBudget != null) {
Expand Down
14 changes: 9 additions & 5 deletions app/src/main/java/com/ivy/wallet/utils/UtilExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,24 @@ fun <T> MutableList<T>?.orEmpty(): MutableList<T> {
return this ?: mutableListOf()
}

fun String.nullifyEmpty() = if (this.isBlank()) null else this
fun String.nullifyEmpty() = this.ifBlank { null }

fun getDefaultFIATCurrency(): Currency =
Currency.getInstance(Locale.getDefault()) ?: Currency.getInstance("USD")
?: Currency.getInstance("usd") ?: Currency.getAvailableCurrencies().firstOrNull()
?: Currency.getInstance("EUR")

fun String.toUpperCaseLocal() = this.toUpperCase(Locale.getDefault())
fun String.toUpperCaseLocal() = this.uppercase(Locale.getDefault())

fun String.toLowerCaseLocal() = this.toLowerCase(Locale.getDefault())
fun String.toLowerCaseLocal() = this.lowercase(Locale.getDefault())

fun String.uppercaseLocal(): String = this.toUpperCase(Locale.getDefault())
fun String.uppercaseLocal(): String = this.uppercase(Locale.getDefault())

fun String.capitalizeLocal(): String = this.capitalize(Locale.getDefault())
fun String.capitalizeLocal(): String = this.replaceFirstChar {
if (it.isLowerCase()) it.titlecase(
Locale.getDefault()
) else it.toString()
}

fun String.capitalizeWords(): String {
return split(" ").joinToString(" ") { it.capitalizeLocal() }
Expand Down
Loading

0 comments on commit c72f951

Please sign in to comment.