Implemented setting user's language to bank's default language

This commit is contained in:
dankl 2019-10-17 15:15:20 +02:00 committed by dankito
parent 9672136a77
commit d6cf9388c0
1 changed files with 6 additions and 2 deletions

View File

@ -485,8 +485,6 @@ open class FinTsClient @JvmOverloads constructor(
} }
response.getFirstSegmentById<CommunicationInfo>(InstituteSegmentId.CommunicationInfo)?.let { communicationInfo -> response.getFirstSegmentById<CommunicationInfo>(InstituteSegmentId.CommunicationInfo)?.let { communicationInfo ->
// TODO: set default language, also for user
communicationInfo.parameters.firstOrNull { it.type == Kommunikationsdienst.Https }?.address?.let { address -> communicationInfo.parameters.firstOrNull { it.type == Kommunikationsdienst.Https }?.address?.let { address ->
bank.finTs3ServerAddress = if (address.startsWith("https://", true)) address else "https://$address" bank.finTs3ServerAddress = if (address.startsWith("https://", true)) address else "https://$address"
} }
@ -564,6 +562,12 @@ open class FinTsClient @JvmOverloads constructor(
// TODO: may also make use of other info // TODO: may also make use of other info
} }
response.getFirstSegmentById<CommunicationInfo>(InstituteSegmentId.CommunicationInfo)?.let { communicationInfo ->
if (customer.selectedLanguage != communicationInfo.defaultLanguage) {
customer.selectedLanguage == communicationInfo.defaultLanguage
}
}
val supportedJobs = response.supportedJobs val supportedJobs = response.supportedJobs
if (supportedJobs.isNotEmpty()) { // if allowedJobsForBank is empty than bank didn't send any allowed job if (supportedJobs.isNotEmpty()) { // if allowedJobsForBank is empty than bank didn't send any allowed job
for (account in customer.accounts) { for (account in customer.accounts) {