Added translations for BankAccountTypes

This commit is contained in:
dankito 2020-10-04 21:58:04 +02:00
parent f053b2728d
commit b7c760e26e
6 changed files with 89 additions and 5 deletions

View File

@ -6,10 +6,10 @@ import android.view.*
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.dialog_bank_account_settings.*
import kotlinx.android.synthetic.main.dialog_bank_account_settings.view.*
import kotlinx.android.synthetic.main.dialog_bank_settings.view.toolbar
import net.dankito.banking.ui.android.R
import net.dankito.banking.ui.android.adapter.CheckableValueAdapterItem
import net.dankito.banking.ui.android.adapter.FastAdapterRecyclerView
import net.dankito.banking.ui.model.BankAccountType
import net.dankito.banking.ui.model.TypedBankAccount
@ -55,7 +55,7 @@ open class BankAccountSettingsDialog : SettingsDialogBase() {
lvlAccountIdentifier.value = account.identifier
lvlSubAccountNumber.setValueAndVisibilityIfValueIsSet(account.subAccountNumber)
lvlIban.setValueAndVisibilityIfValueIsSet(account.iban)
lvlAccountType.value = account.type.toString() // TODO: translate
lvlAccountType.value = getString(getBankAccountTypeResId(account.type))
val context = view.context
val accountFeaturesItems = listOf(
@ -66,8 +66,23 @@ open class BankAccountSettingsDialog : SettingsDialogBase() {
)
FastAdapterRecyclerView(view.rcyAccountFeatures, accountFeaturesItems)
}
protected open fun getBankAccountTypeResId(type: BankAccountType): Int {
return when (type) {
BankAccountType.CheckingAccount -> R.string.checking_account
BankAccountType.SavingsAccount -> R.string.savings_account
BankAccountType.FixedTermDepositAccount -> R.string.fixed_term_deposit_account
BankAccountType.SecuritiesAccount -> R.string.securities_account
BankAccountType.LoanAccount -> R.string.loan_account
BankAccountType.CreditCardAccount -> R.string.credit_card_account
BankAccountType.FundDeposit -> R.string.fund_deposit
BankAccountType.BuildingLoanContract -> R.string.building_loan_contract
BankAccountType.InsuranceContract -> R.string.insurance_contract
else -> R.string.other
}
}
protected open fun shareAccountData() {
val accountData = StringBuilder(account.accountHolderName + "\n" + account.bank.bankName)

View File

@ -29,6 +29,17 @@
<string name="customer_name">Kontoinhaber</string>
<string name="fints_server_address">FinTS Server</string>
<string name="checking_account">Girokonto</string>
<string name="savings_account">Sparkonto</string>
<string name="fixed_term_deposit_account">Festgeldkonto</string>
<string name="securities_account">Wertpapierdepot</string>
<string name="loan_account">Darlehenskonto</string>
<string name="credit_card_account">Kreditkartenkonto</string>
<string name="fund_deposit">Fondsdepot</string>
<string name="building_loan_contract">Bausparvertrag</string>
<string name="insurance_contract">Versicherungsvertrag</string>
<string name="other">Sonstige</string>
<string name="activity_login_authenticate_with_password_prompt">Geben Sie Ihr Passwort ein</string>
<string name="activity_login_authenticate_with_password_hint">Passwort eingeben</string>

View File

@ -29,6 +29,17 @@
<string name="customer_name">Customer name</string>
<string name="fints_server_address">FinTS server</string>
<string name="checking_account">Checking account</string>
<string name="savings_account">Savings account</string>
<string name="fixed_term_deposit_account">Fixed term deposit account</string>
<string name="securities_account">Securities account</string>
<string name="loan_account">Loan account</string>
<string name="credit_card_account">Credit card account</string>
<string name="fund_deposit">Fund deposit</string>
<string name="building_loan_contract">Building loan ontract</string>
<string name="insurance_contract">Insurance Contract</string>
<string name="other">Other</string>
<string name="activity_login_authenticate_with_password_prompt">Please enter your password</string>
<string name="activity_login_authenticate_with_password_hint">Enter your password</string>

View File

@ -31,6 +31,17 @@
"Settings" = "Settings";
"Checking account" = "Checking account";
"Savings account" = "Savings account";
"Fixed term deposit account" = "Fixed term deposit account";
"Securities account" = "Securities account";
"Loan account" = "Loan account";
"Credit card account" = "Credit card account";
"Fund deposit" = "Fund deposit";
"Building loan contract" = "Building loan contract";
"Insurance contract" = "Insurance Contract";
"Other" = "Other";
/* LoginDialog */

View File

@ -31,6 +31,17 @@
"Settings" = "Einstellungen";
"Checking account" = "Girokonto";
"Savings account" = "Sparkonto";
"Fixed term deposit account" = "Festgeldkonto";
"Securities account" = "Wertpapierdepot";
"Loan account" = "Darlehenskonto";
"Credit card account" = "Kreditkartenkonto";
"Fund deposit" = "Fondsdepot";
"Building loan contract" = "Bausparvertrag";
"Insurance contract" = "Versicherungsvertrag";
"Other" = "Sonstige";
/* LoginDialog */

View File

@ -60,7 +60,7 @@ struct BankAccountSettingsDialog: View {
LabelledValue("IBAN", iban)
}
LabelledValue("Bank account type", account.type.name) // TODO: senseful?
LabelledValue("Bank account type", getBankAccountKey(account.type).localize())
}
Section(header: Text("Supports")) {
@ -92,6 +92,31 @@ struct BankAccountSettingsDialog: View {
.padding(.bottom, 4)
}
private func getBankAccountKey(_ type: BankAccountType) -> String {
switch type {
case .checkingaccount:
return "Checking account"
case .savingsaccount:
return "Savings account"
case .fixedtermdepositaccount:
return "Fixed term deposit account"
case .securitiesaccount:
return "Securities account"
case .loanaccount:
return "Loan account"
case .creditcardaccount:
return "Credit card account"
case .funddeposit:
return "Fund deposit"
case .buildingloancontract:
return "Building loan contract"
case .insurancecontract:
return "Insurance contract"
default:
return "Other"
}
}
private func shareAccountData() {
var accountData = account.accountHolderName + "\n" + account.bank.bankName