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

Commit

Permalink
Added Italian translation, added strings to strings.xml and optimized…
Browse files Browse the repository at this point in the history
… a date for localization
  • Loading branch information
code-a1 committed Apr 24, 2022
1 parent 6ce9108 commit a277075
Show file tree
Hide file tree
Showing 6 changed files with 461 additions and 19 deletions.
8 changes: 5 additions & 3 deletions app/src/main/java/com/ivy/wallet/domain/data/entity/Budget.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package com.ivy.wallet.domain.data.entity

import androidx.room.Entity
import androidx.room.PrimaryKey
import com.ivy.wallet.R
import com.ivy.wallet.stringRes
import java.util.*

@Entity(tableName = "budgets")
Expand All @@ -26,9 +28,9 @@ data class Budget(

fun type(categoriesCount: Int): String {
return when (categoriesCount) {
0 -> "Total Budget"
1 -> "Category Budget"
else -> "Multi-Category ($categoriesCount) Budget"
0 -> stringRes(R.string.total_budget)
1 -> stringRes(R.string.category_budget)
else -> stringRes(R.string.multi_category_budget, categoriesCount.toString())
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/java/com/ivy/wallet/domain/data/entity/Loan.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package com.ivy.wallet.domain.data.entity

import androidx.room.Entity
import androidx.room.PrimaryKey
import com.ivy.wallet.R
import com.ivy.wallet.domain.data.LoanType
import com.ivy.wallet.stringRes
import java.util.*

@Entity(tableName = "loans")
Expand All @@ -22,6 +24,7 @@ data class Loan(
val id: UUID = UUID.randomUUID()
) {
fun humanReadableType(): String {
return if (type == LoanType.BORROW) "BORROWED" else "LENT"
return if (type == LoanType.BORROW) stringRes(R.string.borrowed_uppercase) else stringRes(
R.string.lent_uppercase)
}
}
26 changes: 14 additions & 12 deletions app/src/main/java/com/ivy/wallet/ui/theme/modal/model/Month.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.ivy.wallet.ui.theme.modal.model

import com.ivy.wallet.R
import com.ivy.wallet.stringRes
import com.ivy.wallet.ui.IvyWalletCtx
import com.ivy.wallet.ui.onboarding.model.TimePeriod
import com.ivy.wallet.utils.dateNowUTC
Expand All @@ -11,18 +13,18 @@ data class Month(
) {
companion object {
fun monthsList(): MutableList<Month> = mutableListOf(
Month(1, "January"),
Month(2, "February"),
Month(3, "March"),
Month(4, "April"),
Month(5, "May"),
Month(6, "June"),
Month(7, "July"),
Month(8, "August"),
Month(9, "September"),
Month(10, "October"),
Month(11, "November"),
Month(12, "December"),
Month(1, stringRes(R.string.january)),
Month(2, stringRes(R.string.february)),
Month(3, stringRes(R.string.march)),
Month(4, stringRes(R.string.april)),
Month(5, stringRes(R.string.may)),
Month(6, stringRes(R.string.june)),
Month(7, stringRes(R.string.july)),
Month(8, stringRes(R.string.august)),
Month(9, stringRes(R.string.september)),
Month(10, stringRes(R.string.october)),
Month(11, stringRes(R.string.november)),
Month(12, stringRes(R.string.december)),
)

fun fromMonthValue(code: Int): Month =
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/ivy/wallet/utils/DateExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ fun LocalDateTime.formatNicelyWithTime(
}
else -> {
if (isThisYear) {
this.formatLocal("EEE, dd MMM 'at' HH:mm", zone)
this.formatLocal("EEE, dd MMM HH:mm", zone)
} else {
this.formatLocal("dd MMM, yyyy 'at' HH:mm", zone)
this.formatLocal("dd MMM, yyyy HH:mm", zone)
}
}
}
Expand Down
Loading

0 comments on commit a277075

Please sign in to comment.