From cac983d13f7162ea5294b02cf92e26966784ee59 Mon Sep 17 00:00:00 2001 From: Sixten Otto Date: Fri, 17 Feb 2023 12:36:56 -0700 Subject: [PATCH 1/3] fix some syntax errors --- .../Sources/Views/Resources/zh-Hans.lproj/Localizable.strings | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apple/OmnivoreKit/Sources/Views/Resources/zh-Hans.lproj/Localizable.strings b/apple/OmnivoreKit/Sources/Views/Resources/zh-Hans.lproj/Localizable.strings index c212f2dd0..e74dd268b 100644 --- a/apple/OmnivoreKit/Sources/Views/Resources/zh-Hans.lproj/Localizable.strings +++ b/apple/OmnivoreKit/Sources/Views/Resources/zh-Hans.lproj/Localizable.strings @@ -277,11 +277,11 @@ // Views/Profile/RecommendationGroupView.swift "Admins" = "管理员"; -"Members"" = "成员"; +"Members" = "成员"; "Invite link copied" = "已复制邀请链接"; // Views/Profile/RecommendationGroupsView.swift -"Error creating club" +"Error creating club" = "Error creating club"; "Club Rules" = "已复制邀请链接"; "Only admins can post" = "只有管理员可以发帖"; "Only admins can see members" = "只有管理员才能看到成员"; From 0bb176f21b3e1e50cb1fc1086c68d4d1f68e0ff5 Mon Sep 17 00:00:00 2001 From: Sixten Otto Date: Fri, 17 Feb 2023 12:37:29 -0700 Subject: [PATCH 2/3] move unitTestTrailingEntry to the end of the file --- .../Views/Resources/zh-Hans.lproj/Localizable.strings | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apple/OmnivoreKit/Sources/Views/Resources/zh-Hans.lproj/Localizable.strings b/apple/OmnivoreKit/Sources/Views/Resources/zh-Hans.lproj/Localizable.strings index e74dd268b..f55475139 100644 --- a/apple/OmnivoreKit/Sources/Views/Resources/zh-Hans.lproj/Localizable.strings +++ b/apple/OmnivoreKit/Sources/Views/Resources/zh-Hans.lproj/Localizable.strings @@ -204,10 +204,6 @@ // "saveArticleSavingState" = "保存中..."; // "Confirm Your Profile" = "确认您的个人资料"; -// Unit test Entry -- Do not remove this or add entries after this one. -// This allows us to check for syntax errors in this file with a unit test -"unitTestTrailingEntry" = "仅用于测试目的。"; - // Views/Home/HomeFeedViewIOS.swift file "Archive" = "存档"; "Unarchive" = "取消存档"; @@ -324,3 +320,7 @@ "View Privacy Policy" = "查看隐私策略"; "Self-hosting options" = "自我管选项"; "View Details" = "查看详情"; + +// Unit test Entry -- Do not remove this or add entries after this one. +// This allows us to check for syntax errors in this file with a unit test +"unitTestTrailingEntry" = "仅用于测试目的。"; From 4d8adfdeab2d0ab4071aaa7234982e68ee7e032d Mon Sep 17 00:00:00 2001 From: Sixten Otto Date: Fri, 17 Feb 2023 12:37:58 -0700 Subject: [PATCH 3/3] make localization test failure more explicit --- apple/OmnivoreKit/Tests/ViewsTests/LocalTextTests.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apple/OmnivoreKit/Tests/ViewsTests/LocalTextTests.swift b/apple/OmnivoreKit/Tests/ViewsTests/LocalTextTests.swift index 08800e54d..cb82ef681 100644 --- a/apple/OmnivoreKit/Tests/ViewsTests/LocalTextTests.swift +++ b/apple/OmnivoreKit/Tests/ViewsTests/LocalTextTests.swift @@ -4,12 +4,14 @@ import XCTest final class LocalTextTests: XCTestCase { func testThatLocalTextFindsStrings() { // Make sure that the same key is not returned when looking up a localized string by key - // Testing the first and last entry in teh strings file is adequate for finding syntax errors. + // Testing the first and last entry in the strings file is adequate for finding syntax errors. // If any entry is not proper than the key will be returned and the test will fail. for languageCode in LanguageCode.allCases { - XCTAssertNotEqual(languageCode.translation(key: "unitTestLeadingEntry"), "unitTestLeadingEntry") - XCTAssertNotEqual(languageCode.translation(key: "unitTestTrailingEntry"), "unitTestTrailingEntry") + // swiftlint:disable line_length + XCTAssertNotEqual(languageCode.translation(key: "unitTestLeadingEntry"), "unitTestLeadingEntry", "Got untranslated value for unitTestLeadingEntry in \(languageCode)") + XCTAssertNotEqual(languageCode.translation(key: "unitTestTrailingEntry"), "unitTestTrailingEntry", "Got untranslated value for unitTestTrailingEntry in \(languageCode)") + // swiftlint:enable line_length } }