diff --git a/DGCAWallet.xcodeproj/project.pbxproj b/DGCAWallet.xcodeproj/project.pbxproj index 30e5c21..69809a2 100644 --- a/DGCAWallet.xcodeproj/project.pbxproj +++ b/DGCAWallet.xcodeproj/project.pbxproj @@ -15,6 +15,7 @@ CE1D1EF6263597A2004C8919 /* LocalData.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE1D1EF5263597A2004C8919 /* LocalData.swift */; }; CE1F155C2639F9E700736D48 /* SwiftyJSON in Frameworks */ = {isa = PBXBuildFile; productRef = CE1F155B2639F9E700736D48 /* SwiftyJSON */; }; CE260F56263DD1720083A200 /* WalletCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE260F55263DD1720083A200 /* WalletCell.swift */; }; + CE345FB826447A9F003B457E /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = CE345FB726447A9F003B457E /* Localizable.strings */; }; CE37B643263867D700DEE13D /* SecureBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE37B642263867D700DEE13D /* SecureBackground.swift */; }; CE56B5052639F48E00FB31B1 /* SwiftDGC in Frameworks */ = {isa = PBXBuildFile; productRef = CE56B5042639F48E00FB31B1 /* SwiftDGC */; }; CE56BC07264068110044FD3F /* GatewayConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE56BC06264068110044FD3F /* GatewayConnection.swift */; }; @@ -22,7 +23,6 @@ CE81533A263FF7EC0030D777 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = CE815339263FF7EC0030D777 /* README.md */; }; CE8912FB2634C6B900CB92AF /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = CE8912FA2634C6B900CB92AF /* Alamofire */; }; CE891305263581D900CB92AF /* Home.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE891304263581D900CB92AF /* Home.swift */; }; - CEA1555D262F63B30024B7AC /* EuDgcSchema.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEA1555C262F63B30024B7AC /* EuDgcSchema.swift */; }; CEA15563262F6DAB0024B7AC /* CertViewerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEA15562262F6DAB0024B7AC /* CertViewerDelegate.swift */; }; CEA1556B262F784E0024B7AC /* SelfSizedTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEA1556A262F784E0024B7AC /* SelfSizedTableView.swift */; }; CEA15570262F79DE0024B7AC /* InfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEA1556F262F79DE0024B7AC /* InfoCell.swift */; }; @@ -68,12 +68,12 @@ CE13CF22262DDF810070C80E /* RoundedButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoundedButton.swift; sourceTree = ""; }; CE1D1EF5263597A2004C8919 /* LocalData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalData.swift; sourceTree = ""; }; CE260F55263DD1720083A200 /* WalletCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalletCell.swift; sourceTree = ""; }; + CE345FB726447A9F003B457E /* Localizable.strings */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = ""; }; CE37B642263867D700DEE13D /* SecureBackground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecureBackground.swift; sourceTree = ""; }; CE56BC06264068110044FD3F /* GatewayConnection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GatewayConnection.swift; sourceTree = ""; }; CE8096D8263B07BB00A65AD6 /* UIColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIColor.swift; sourceTree = ""; }; CE815339263FF7EC0030D777 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = SOURCE_ROOT; }; CE891304263581D900CB92AF /* Home.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home.swift; sourceTree = ""; }; - CEA1555C262F63B30024B7AC /* EuDgcSchema.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EuDgcSchema.swift; sourceTree = ""; }; CEA15562262F6DAB0024B7AC /* CertViewerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CertViewerDelegate.swift; sourceTree = ""; }; CEA1556A262F784E0024B7AC /* SelfSizedTableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelfSizedTableView.swift; sourceTree = ""; }; CEA1556F262F79DE0024B7AC /* InfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfoCell.swift; sourceTree = ""; }; @@ -197,7 +197,7 @@ CEA6D6ED261F8D2700715333 /* SceneDelegate.swift */, CEA6D6F4261F8D2900715333 /* Assets.xcassets */, CEA6D6F9261F8D2900715333 /* Info.plist */, - CEA1555C262F63B30024B7AC /* EuDgcSchema.swift */, + CE345FB726447A9F003B457E /* Localizable.strings */, ); path = SupportingFiles; sourceTree = ""; @@ -396,6 +396,7 @@ buildActionMask = 2147483647; files = ( CE13CF05262DCDCD0070C80E /* CertificateViewer.storyboard in Resources */, + CE345FB826447A9F003B457E /* Localizable.strings in Resources */, CEA6D6F8261F8D2900715333 /* LaunchScreen.storyboard in Resources */, CE81533A263FF7EC0030D777 /* README.md in Resources */, CEA6D6F5261F8D2900715333 /* Assets.xcassets in Resources */, @@ -436,7 +437,6 @@ CED2726026398683003D47A9 /* UIFont.swift in Sources */, CEE9DA55263C7D4000A31532 /* CertCode.swift in Sources */, CE56BC07264068110044FD3F /* GatewayConnection.swift in Sources */, - CEA1555D262F63B30024B7AC /* EuDgcSchema.swift in Sources */, CEA6D6F0261F8D2700715333 /* Scan.swift in Sources */, CE13CF23262DDF810070C80E /* RoundedButton.swift in Sources */, CEA6E561264058B50066DC8E /* UIViewController.swift in Sources */, diff --git a/DGCAWallet/Components/WalletCell.swift b/DGCAWallet/Components/WalletCell.swift index cd45f28..f09dd60 100644 --- a/DGCAWallet/Components/WalletCell.swift +++ b/DGCAWallet/Components/WalletCell.swift @@ -39,6 +39,6 @@ class WalletCell: UITableViewCell { typeLabel.text = cert.certTypeString nameLabel.text = cert.fullName - dateLabel.text = "scanned \(dated.date.dateString)" + dateLabel.text = String(format: l10n("list.cell.scanned-at"), dated.date.dateString) } } diff --git a/DGCAWallet/Extensions/UIViewController.swift b/DGCAWallet/Extensions/UIViewController.swift index fb2392f..7a28529 100644 --- a/DGCAWallet/Extensions/UIViewController.swift +++ b/DGCAWallet/Extensions/UIViewController.swift @@ -27,13 +27,14 @@ import UIKit +import SwiftDGC extension UIViewController { func showInputDialog( title: String? = nil, subtitle: String? = nil, - actionTitle: String? = "Okay", - cancelTitle: String? = "Cancel", + actionTitle: String? = l10n("btn.okay"), + cancelTitle: String? = l10n("btn.cancel"), inputPlaceholder: String? = nil, inputKeyboardType: UIKeyboardType = UIKeyboardType.default, handler: ((_ text: String?) -> Void)? = nil @@ -59,7 +60,7 @@ extension UIViewController { func showAlert( title: String? = nil, subtitle: String? = nil, - actionTitle: String? = "Okay", + actionTitle: String? = l10n("btn.okay"), cancelTitle: String? = nil, handler: ((Bool) -> Void)? = nil ) { diff --git a/DGCAWallet/Models/LocalData.swift b/DGCAWallet/Models/LocalData.swift index 1146b3d..6f7ff86 100644 --- a/DGCAWallet/Models/LocalData.swift +++ b/DGCAWallet/Models/LocalData.swift @@ -59,7 +59,8 @@ struct LocalData: Codable { guard let result = success else { return } - print("\(result.certStrings.count) certs loaded.") + let format = l10n("log.certs-loaded") + print(String.localizedStringWithFormat(format, result.certStrings.count)) LocalData.sharedInstance = result completion() } diff --git a/DGCAWallet/Services/GatewayConnection.swift b/DGCAWallet/Services/GatewayConnection.swift index 8d7ca8e..dbe3034 100644 --- a/DGCAWallet/Services/GatewayConnection.swift +++ b/DGCAWallet/Services/GatewayConnection.swift @@ -71,7 +71,7 @@ struct GatewayConnection { let status = $0.response?.statusCode, status == 204 else { - completion?(false, nil) + completion?(true, nil) return } diff --git a/DGCAWallet/Services/SecureBackground.swift b/DGCAWallet/Services/SecureBackground.swift index 614e9ad..d4fd785 100644 --- a/DGCAWallet/Services/SecureBackground.swift +++ b/DGCAWallet/Services/SecureBackground.swift @@ -29,6 +29,7 @@ import Foundation import UIKit import LocalAuthentication +import SwiftDGC struct SecureBackground { static var imageView: UIImageView? @@ -66,8 +67,8 @@ struct SecureBackground { } paused = true let context = LAContext() - context.localizedCancelTitle = "Try Later" - let reason = "Confirm Identity" + context.localizedCancelTitle = l10n("auth.later") + let reason = l10n("auth.confirm") var error: NSError? guard context.canEvaluatePolicy(.deviceOwnerAuthentication, error: &error) else { paused = false diff --git a/DGCAWallet/Storyboards/Base.lproj/Main.storyboard b/DGCAWallet/Storyboards/Base.lproj/Main.storyboard index a79869f..ca60d24 100644 --- a/DGCAWallet/Storyboards/Base.lproj/Main.storyboard +++ b/DGCAWallet/Storyboards/Base.lproj/Main.storyboard @@ -53,7 +53,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Localization/DGCAWallet/en.xcloc/Source Contents/DGCAWallet/SupportingFiles/en.lproj/InfoPlist.strings b/Localization/DGCAWallet/en.xcloc/Source Contents/DGCAWallet/SupportingFiles/en.lproj/InfoPlist.strings new file mode 100644 index 0000000..5780145 --- /dev/null +++ b/Localization/DGCAWallet/en.xcloc/Source Contents/DGCAWallet/SupportingFiles/en.lproj/InfoPlist.strings @@ -0,0 +1,8 @@ +/* Bundle display name */ +"CFBundleDisplayName" = "Wallet App"; +/* Bundle name */ +"CFBundleName" = "DGCAWallet"; +/* Privacy - Camera Usage Description */ +"NSCameraUsageDescription" = "Scan barcodes with your camera."; +/* Privacy - Face ID Usage Description */ +"NSFaceIDUsageDescription" = "Unlock sensitive data."; diff --git a/Localization/DGCAWallet/en.xcloc/contents.json b/Localization/DGCAWallet/en.xcloc/contents.json new file mode 100644 index 0000000..573d789 --- /dev/null +++ b/Localization/DGCAWallet/en.xcloc/contents.json @@ -0,0 +1,12 @@ +{ + "developmentRegion" : "en", + "project" : "DGCAWallet.xcodeproj", + "targetLocale" : "en", + "toolInfo" : { + "toolBuildNumber" : "12E262", + "toolID" : "com.apple.dt.xcode", + "toolName" : "Xcode", + "toolVersion" : "12.5" + }, + "version" : "1.0" +} \ No newline at end of file