From bcc93c3676120f1579bacfe1341150a76441ce90 Mon Sep 17 00:00:00 2001 From: Ryo Abe Date: Fri, 24 Aug 2018 12:57:56 +0900 Subject: [PATCH 1/5] Fixed buttons and labels were severally spoken. --- SmileLock/Classes/PasswordInputView.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SmileLock/Classes/PasswordInputView.swift b/SmileLock/Classes/PasswordInputView.swift index ae02165..d64026f 100644 --- a/SmileLock/Classes/PasswordInputView.swift +++ b/SmileLock/Classes/PasswordInputView.swift @@ -152,12 +152,14 @@ private extension PasswordInputView { //configure label NSLayoutConstraint.addEqualConstraintsFromSubView(label, toSuperView: self) label.textAlignment = .center + label.isAccessibilityElement = false //configure button NSLayoutConstraint.addEqualConstraintsFromSubView(button, toSuperView: self) button.isExclusiveTouch = true button.addTarget(self, action: #selector(PasswordInputView.touchDown), for: [.touchDown]) button.addTarget(self, action: #selector(PasswordInputView.touchUp), for: [.touchUpInside, .touchDragOutside, .touchCancel, .touchDragExit]) + button.accessibilityValue = numberString } //MARK: Animation From 2fa1b0c36d36c64bb4fcf9d19d3c7e437187cbba Mon Sep 17 00:00:00 2001 From: Ryo Abe Date: Fri, 24 Aug 2018 17:24:51 +0900 Subject: [PATCH 2/5] Fix speak the number of entered passwords --- SmileLock/Classes/PasswordDotView.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SmileLock/Classes/PasswordDotView.swift b/SmileLock/Classes/PasswordDotView.swift index b7ec41b..9ad4d27 100644 --- a/SmileLock/Classes/PasswordDotView.swift +++ b/SmileLock/Classes/PasswordDotView.swift @@ -14,6 +14,8 @@ open class PasswordDotView: UIView { @IBInspectable open var inputDotCount = 0 { didSet { + accessibilityLabel = "パスワード" + accessibilityValue = String(format: "%d個ちゅう%d個が入力されています", totalDotCount, inputDotCount) setNeedsDisplay() } } @@ -69,6 +71,7 @@ open class PasswordDotView: UIView { open override func awakeFromNib() { super.awakeFromNib() backgroundColor = UIColor.clear + isAccessibilityElement = true } open override func layoutSubviews() { super.layoutSubviews() From 32545f07f63fdcce28c64c9778550862eb562634 Mon Sep 17 00:00:00 2001 From: Ryo Abe Date: Fri, 7 Sep 2018 16:51:56 +0900 Subject: [PATCH 3/5] fix voiceover --- Localizable/en.lproj/Localizable.strings | 10 ++++++++++ Localizable/ja.lproj/Localizable.strings | 10 ++++++++++ .../Pods/Pods.xcodeproj/project.pbxproj | 18 ++++++++++++++++++ .../project.pbxproj | 5 +++++ .../ja.lproj/LaunchScreen.strings | 1 + SmileLock/Classes/PasswordDotView.swift | 5 +++-- 6 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 Localizable/en.lproj/Localizable.strings create mode 100644 Localizable/ja.lproj/Localizable.strings create mode 100644 SmileLock-Example/SmileLock-Example/ja.lproj/LaunchScreen.strings diff --git a/Localizable/en.lproj/Localizable.strings b/Localizable/en.lproj/Localizable.strings new file mode 100644 index 0000000..152f9e0 --- /dev/null +++ b/Localizable/en.lproj/Localizable.strings @@ -0,0 +1,10 @@ +/* + Localizable.strings + Pods + + Created by 阿部 諒 on 2018/08/03. + +*/ + +"PasswordDotViewAccessibilityLabel" = "Passcode"; +"PasswordDotViewAccessibilityValue" = "%d of %d enterd"; diff --git a/Localizable/ja.lproj/Localizable.strings b/Localizable/ja.lproj/Localizable.strings new file mode 100644 index 0000000..a8df823 --- /dev/null +++ b/Localizable/ja.lproj/Localizable.strings @@ -0,0 +1,10 @@ +/* + Localizable.strings + Pods + + Created by 阿部 諒 on 2018/08/03. + +*/ + +"PasswordDotViewAccessibilityLabel" = "パスコード"; +"PasswordDotViewAccessibilityValue" = "%d個ちゅう%d個が入力されています"; diff --git a/SmileLock-Example/Pods/Pods.xcodeproj/project.pbxproj b/SmileLock-Example/Pods/Pods.xcodeproj/project.pbxproj index a210213..3614495 100644 --- a/SmileLock-Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/SmileLock-Example/Pods/Pods.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 1C2EA93DE8622D1F11F2AD00654133D3 /* PasswordUIValidation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B18169A700B612B3F863F2CE365671A /* PasswordUIValidation.swift */; }; + 1D5F2193212FF87200AFEA02 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1D5F2191212FF87200AFEA02 /* Localizable.strings */; }; 2FE3C82CAF753A62B3C673975657EAB3 /* PasswordContainerView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 782077606F89C1249B4BFF1972AB0BD5 /* PasswordContainerView.xib */; }; 38D6CBB5B9D1F947D1C3B5827E023AC6 /* SmileLock-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = BBEF4C23DAF552BB52E58F1F0B3677BA /* SmileLock-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 571934E483C4FB6ED8CAF608ED5C81BD /* PasswordInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70AC8DB3251E1463F761E3CEF88D548A /* PasswordInputView.swift */; }; @@ -35,6 +36,8 @@ /* Begin PBXFileReference section */ 0C56AA50158983C14B71275CEA70B9D8 /* PasswordDotView.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PasswordDotView.swift; sourceTree = ""; }; 14EA57A308EC1B78534BCBC8981AD494 /* Pods-SmileLock-Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SmileLock-Example-frameworks.sh"; sourceTree = ""; }; + 1D5F2192212FF87200AFEA02 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ../../Localizable/ja.lproj/Localizable.strings; sourceTree = ""; }; + 1D7E32E4214242FA00A5227D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = ../../Localizable/en.lproj/Localizable.strings; sourceTree = ""; }; 2358AE01938DB09B2D3952F956721223 /* Pods-SmileLock-Example-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SmileLock-Example-resources.sh"; sourceTree = ""; }; 25AFF6969B408F2206B0CBB8A74DBA8B /* Pods-SmileLock-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SmileLock-Example.release.xcconfig"; sourceTree = ""; }; 279E8767BFEDA0EBC710CC47C8528629 /* SmileLock-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "SmileLock-prefix.pch"; sourceTree = ""; }; @@ -113,6 +116,7 @@ children = ( 782077606F89C1249B4BFF1972AB0BD5 /* PasswordContainerView.xib */, AE7AB29D1D3EC82400E8C9A3 /* Assets.xcassets */, + 1D5F2191212FF87200AFEA02 /* Localizable.strings */, ); path = Assets; sourceTree = ""; @@ -304,6 +308,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + ja, ); mainGroup = 7DB346D0F39D3F0E887471402A8071AB; productRefGroup = 82C452AF10C4675854B4E9B9C27E479A /* Products */; @@ -322,6 +327,7 @@ buildActionMask = 2147483647; files = ( AE24929F1D3F56B6001EEE96 /* Assets.xcassets in Resources */, + 1D5F2193212FF87200AFEA02 /* Localizable.strings in Resources */, 2FE3C82CAF753A62B3C673975657EAB3 /* PasswordContainerView.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -360,6 +366,18 @@ }; /* End PBXTargetDependency section */ +/* Begin PBXVariantGroup section */ + 1D5F2191212FF87200AFEA02 /* Localizable.strings */ = { + isa = PBXVariantGroup; + children = ( + 1D5F2192212FF87200AFEA02 /* ja */, + 1D7E32E4214242FA00A5227D /* en */, + ); + name = Localizable.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + /* Begin XCBuildConfiguration section */ 2BA259EFE267BC7D8B85E27612D8B80B /* Debug */ = { isa = XCBuildConfiguration; diff --git a/SmileLock-Example/SmileLock-Example.xcodeproj/project.pbxproj b/SmileLock-Example/SmileLock-Example.xcodeproj/project.pbxproj index 27bfa38..f1398ec 100644 --- a/SmileLock-Example/SmileLock-Example.xcodeproj/project.pbxproj +++ b/SmileLock-Example/SmileLock-Example.xcodeproj/project.pbxproj @@ -40,6 +40,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 1D7E32E52142604800A5227D /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/LaunchScreen.strings; sourceTree = ""; }; 3DA1702F1AC31AA3EDCA5FE7 /* Pods_SmileLock_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SmileLock_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 7C52457304DEFE4405D2D34B /* Pods-SmileLock-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SmileLock-Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SmileLock-Example/Pods-SmileLock-Example.debug.xcconfig"; sourceTree = ""; }; B7A42F861CD2588B00FEB7B0 /* BlurPasswordLoginViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BlurPasswordLoginViewController.swift; sourceTree = ""; }; @@ -235,6 +236,7 @@ TargetAttributes = { B7E3A1A91CCC6448005F680E = { CreatedOnToolsVersion = 7.3; + DevelopmentTeam = 788GL33659; LastSwiftMigration = 0800; }; B7E3A1BD1CCC6449005F680E = { @@ -395,6 +397,7 @@ isa = PBXVariantGroup; children = ( B7E3A1B71CCC6449005F680E /* Base */, + 1D7E32E52142604800A5227D /* ja */, ); name = LaunchScreen.storyboard; sourceTree = ""; @@ -406,6 +409,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -454,6 +458,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; diff --git a/SmileLock-Example/SmileLock-Example/ja.lproj/LaunchScreen.strings b/SmileLock-Example/SmileLock-Example/ja.lproj/LaunchScreen.strings new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/SmileLock-Example/SmileLock-Example/ja.lproj/LaunchScreen.strings @@ -0,0 +1 @@ + diff --git a/SmileLock/Classes/PasswordDotView.swift b/SmileLock/Classes/PasswordDotView.swift index 9ad4d27..6a4b58b 100644 --- a/SmileLock/Classes/PasswordDotView.swift +++ b/SmileLock/Classes/PasswordDotView.swift @@ -14,8 +14,8 @@ open class PasswordDotView: UIView { @IBInspectable open var inputDotCount = 0 { didSet { - accessibilityLabel = "パスワード" - accessibilityValue = String(format: "%d個ちゅう%d個が入力されています", totalDotCount, inputDotCount) + let format = Bundle(for: type(of: self)).localizedString(forKey: "PasswordDotViewAccessibilityValue", value: nil, table: nil) + accessibilityValue = String(format: format, totalDotCount, inputDotCount) setNeedsDisplay() } } @@ -72,6 +72,7 @@ open class PasswordDotView: UIView { super.awakeFromNib() backgroundColor = UIColor.clear isAccessibilityElement = true + accessibilityLabel = Bundle(for: type(of: self)).localizedString(forKey: "PasswordDotViewAccessibilityLabel", value: nil, table: nil) } open override func layoutSubviews() { super.layoutSubviews() From a93f1dd50663e5bf68b0b3f9f8a078c4a21302aa Mon Sep 17 00:00:00 2001 From: Ryo Abe Date: Fri, 7 Sep 2018 16:58:09 +0900 Subject: [PATCH 4/5] tidy up --- SmileLock-Example/SmileLock-Example.xcodeproj/project.pbxproj | 1 - 1 file changed, 1 deletion(-) diff --git a/SmileLock-Example/SmileLock-Example.xcodeproj/project.pbxproj b/SmileLock-Example/SmileLock-Example.xcodeproj/project.pbxproj index f1398ec..a8aa8fb 100644 --- a/SmileLock-Example/SmileLock-Example.xcodeproj/project.pbxproj +++ b/SmileLock-Example/SmileLock-Example.xcodeproj/project.pbxproj @@ -236,7 +236,6 @@ TargetAttributes = { B7E3A1A91CCC6448005F680E = { CreatedOnToolsVersion = 7.3; - DevelopmentTeam = 788GL33659; LastSwiftMigration = 0800; }; B7E3A1BD1CCC6449005F680E = { From e80fdfe119b379161a0e147c7943da0f47731480 Mon Sep 17 00:00:00 2001 From: Ryo Abe Date: Thu, 20 Sep 2018 11:06:17 +0900 Subject: [PATCH 5/5] fix typo --- Localizable/en.lproj/Localizable.strings | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Localizable/en.lproj/Localizable.strings b/Localizable/en.lproj/Localizable.strings index 152f9e0..1fe2497 100644 --- a/Localizable/en.lproj/Localizable.strings +++ b/Localizable/en.lproj/Localizable.strings @@ -6,5 +6,5 @@ */ -"PasswordDotViewAccessibilityLabel" = "Passcode"; -"PasswordDotViewAccessibilityValue" = "%d of %d enterd"; +"PasswordDotViewAccessibilityLabel" = "Passcode Field"; +"PasswordDotViewAccessibilityValue" = "%d of %d entered";