From d6cf9388c0f01efb14a2d26d546249e54f3835f6 Mon Sep 17 00:00:00 2001 From: dankl Date: Thu, 17 Oct 2019 15:15:20 +0200 Subject: [PATCH] Implemented setting user's language to bank's default language --- .../src/main/kotlin/net/dankito/fints/FinTsClient.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fints4javaLib/src/main/kotlin/net/dankito/fints/FinTsClient.kt b/fints4javaLib/src/main/kotlin/net/dankito/fints/FinTsClient.kt index 98590a35..c379bc4f 100644 --- a/fints4javaLib/src/main/kotlin/net/dankito/fints/FinTsClient.kt +++ b/fints4javaLib/src/main/kotlin/net/dankito/fints/FinTsClient.kt @@ -485,8 +485,6 @@ open class FinTsClient @JvmOverloads constructor( } response.getFirstSegmentById(InstituteSegmentId.CommunicationInfo)?.let { communicationInfo -> - // TODO: set default language, also for user - communicationInfo.parameters.firstOrNull { it.type == Kommunikationsdienst.Https }?.address?.let { 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 } + response.getFirstSegmentById(InstituteSegmentId.CommunicationInfo)?.let { communicationInfo -> + if (customer.selectedLanguage != communicationInfo.defaultLanguage) { + customer.selectedLanguage == communicationInfo.defaultLanguage + } + } + val supportedJobs = response.supportedJobs if (supportedJobs.isNotEmpty()) { // if allowedJobsForBank is empty than bank didn't send any allowed job for (account in customer.accounts) {