Skip to content

Commit

Permalink
Merge pull request #191 from decentralised-dataexchange/feature/190-L…
Browse files Browse the repository at this point in the history
…ocalisation-string-file-path-issue

Add #190: Localisation string file path issue fix
  • Loading branch information
georgepadayatti authored Nov 21, 2023
2 parents c6543c2 + c5936c4 commit 45e7eca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions PrivacyDashboardiOS/Classes/Extension/ExtensionMethods.swift
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,11 @@ extension NSMutableAttributedString {
extension String {
var localized: String {
let languageCode = BBConsentPrivacyDashboardiOS.shared.languageCode
let bundle = Bundle(url: Bundle.main.bundleURL.appendingPathComponent("Frameworks").appendingPathComponent("PrivacyDashboardiOS.framework").appendingPathComponent("/\(languageCode).lproj")) ?? Bundle.main
return NSLocalizedString(self, tableName: nil, bundle: bundle, value: "", comment: "")
if let bundle = Bundle(url: Bundle.main.bundleURL.appendingPathComponent("Frameworks").appendingPathComponent("PrivacyDashboardiOS.framework").appendingPathComponent("/\(languageCode).lproj")) {
return NSLocalizedString(self, tableName: nil, bundle: bundle, value: "", comment: "")
} else {
let bundle = Bundle(url: Bundle.main.bundleURL.appendingPathComponent("PrivacyDashboardiOS.bundle").appendingPathComponent("\(languageCode).lproj")) ?? Bundle.main
return NSLocalizedString(self, tableName: nil, bundle: bundle, value: "", comment: "")
}
}
}
4 changes: 2 additions & 2 deletions PrivacyDashboardiOS/Classes/PrivacyDashboard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public class PrivacyDashboard {
public static var receiveDataBackFromPrivacyDashboard : (([String: Any]) -> Void)?

// MARK: - Invoking 'PrivacyDashboard' iOS SDK
public static func showPrivacyDashboard(withApiKey: String, withUserId: String, withOrgId: String, withBaseUrl: String, withLocale: String?, accessToken: String = "", turnOnAskme: Bool, turnOnUserRequest: Bool, turnOnAttributeDetail: Bool) {
BBConsentPrivacyDashboardiOS.shared.languageCode = withLocale ?? "en"
public static func showPrivacyDashboard(withApiKey: String, withUserId: String, withOrgId: String, withBaseUrl: String, withLocale: String = "en", accessToken: String = "", turnOnAskme: Bool, turnOnUserRequest: Bool, turnOnAttributeDetail: Bool) {
BBConsentPrivacyDashboardiOS.shared.languageCode = withLocale
BBConsentPrivacyDashboardiOS.shared.turnOnUserRequests = turnOnUserRequest
BBConsentPrivacyDashboardiOS.shared.turnOnAskMeSection = turnOnAskme
BBConsentPrivacyDashboardiOS.shared.turnOnAttributeDetailScreen = turnOnAttributeDetail
Expand Down

0 comments on commit 45e7eca

Please sign in to comment.