From 72a96b6850abc0e0e749bca13acff4128110c447 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 5 Oct 2023 17:26:02 +0300 Subject: [PATCH] Advanced settings fixes (#1857) * vector-im/element-meta/issues/2042 - Fix advanced options ordering and capitalisation * Bump swiftlint's type_body_length warning to 1000, make it match error. * Fix unit tests --- .swiftlint.yml | 2 +- .../Resources/Localizations/en.lproj/Localizable.strings | 5 +++-- ElementX/Sources/Generated/Strings.swift | 6 ++++-- .../AvancedOptionsScreen/View/AdvancedSettingsScreen.swift | 6 +++--- .../PreviewTests/test_advancedSettingsScreen.1.png | 4 ++-- .../PreviewTests/test_reportContentScreen.1.png | 4 ++-- .../__Snapshots__/PreviewTests/test_timelineItemMenu.1.png | 4 ++-- 7 files changed, 17 insertions(+), 14 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index b304435f3..1166ea1f5 100755 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -34,7 +34,7 @@ type_name: error: 1000 type_body_length: - warning: 700 + warning: 1000 error: 1000 function_body_length: diff --git a/ElementX/Resources/Localizations/en.lproj/Localizable.strings b/ElementX/Resources/Localizations/en.lproj/Localizable.strings index 536f943ce..b0d8f65ba 100644 --- a/ElementX/Resources/Localizations/en.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en.lproj/Localizable.strings @@ -54,7 +54,7 @@ "action_reply" = "Reply"; "action_reply_in_thread" = "Reply in thread"; "action_report_bug" = "Report bug"; -"action_report_content" = "Report Content"; +"action_report_content" = "Report content"; "action_retry" = "Retry"; "action_retry_decryption" = "Retry decryption"; "action_save" = "Save"; @@ -69,7 +69,7 @@ "action_start_verification" = "Start verification"; "action_static_map_load" = "Tap to load map"; "action_take_photo" = "Take photo"; -"action_view_source" = "View Source"; +"action_view_source" = "View source"; "action_yes" = "Yes"; "action.edit_poll" = "Edit poll"; "common_about" = "About"; @@ -122,6 +122,7 @@ "common_room_name_placeholder" = "e.g. your project name"; "common_search_for_someone" = "Search for someone"; "common_search_results" = "Search results"; +"common_secure_backup" = "Secure backup"; "common_security" = "Security"; "common_select_your_server" = "Select your server"; "common_sending" = "Sending…"; diff --git a/ElementX/Sources/Generated/Strings.swift b/ElementX/Sources/Generated/Strings.swift index c568229b7..d11d9c007 100644 --- a/ElementX/Sources/Generated/Strings.swift +++ b/ElementX/Sources/Generated/Strings.swift @@ -124,7 +124,7 @@ public enum L10n { public static var actionReplyInThread: String { return L10n.tr("Localizable", "action_reply_in_thread") } /// Report bug public static var actionReportBug: String { return L10n.tr("Localizable", "action_report_bug") } - /// Report Content + /// Report content public static var actionReportContent: String { return L10n.tr("Localizable", "action_report_content") } /// Retry public static var actionRetry: String { return L10n.tr("Localizable", "action_retry") } @@ -154,7 +154,7 @@ public enum L10n { public static var actionStaticMapLoad: String { return L10n.tr("Localizable", "action_static_map_load") } /// Take photo public static var actionTakePhoto: String { return L10n.tr("Localizable", "action_take_photo") } - /// View Source + /// View source public static var actionViewSource: String { return L10n.tr("Localizable", "action_view_source") } /// Yes public static var actionYes: String { return L10n.tr("Localizable", "action_yes") } @@ -280,6 +280,8 @@ public enum L10n { public static var commonSearchForSomeone: String { return L10n.tr("Localizable", "common_search_for_someone") } /// Search results public static var commonSearchResults: String { return L10n.tr("Localizable", "common_search_results") } + /// Secure backup + public static var commonSecureBackup: String { return L10n.tr("Localizable", "common_secure_backup") } /// Security public static var commonSecurity: String { return L10n.tr("Localizable", "common_security") } /// Select your server diff --git a/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/View/AdvancedSettingsScreen.swift b/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/View/AdvancedSettingsScreen.swift index b67a15a32..44ca86ea8 100644 --- a/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/View/AdvancedSettingsScreen.swift +++ b/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/View/AdvancedSettingsScreen.swift @@ -28,11 +28,11 @@ struct AdvancedSettingsScreen: View { kind: .picker(selection: $context.timelineStyle, items: TimelineStyle.allCases.map { (title: $0.name, tag: $0) })) - ListRow(label: .default(title: L10n.actionViewSource, systemIcon: .mailAndTextMagnifyingglass), - kind: .toggle($context.viewSourceEnabled)) - ListRow(label: .default(title: L10n.commonRichTextEditor, icon: Image(asset: Asset.Images.textFormat)), kind: .toggle($context.richTextEditorEnabled)) + + ListRow(label: .default(title: L10n.actionViewSource, systemIcon: .mailAndTextMagnifyingglass), + kind: .toggle($context.viewSourceEnabled)) } } .compoundList() diff --git a/UnitTests/__Snapshots__/PreviewTests/test_advancedSettingsScreen.1.png b/UnitTests/__Snapshots__/PreviewTests/test_advancedSettingsScreen.1.png index 7346cfc38..8a2ef29be 100644 --- a/UnitTests/__Snapshots__/PreviewTests/test_advancedSettingsScreen.1.png +++ b/UnitTests/__Snapshots__/PreviewTests/test_advancedSettingsScreen.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:931a0c343482e9dd06e924b4ee76c0d88637e31432186a9bddd46e480f7a10ad -size 110737 +oid sha256:611a03f4bfe757a2840db576c57c9b2864cdc551d20d317205e61394cb1f9530 +size 110573 diff --git a/UnitTests/__Snapshots__/PreviewTests/test_reportContentScreen.1.png b/UnitTests/__Snapshots__/PreviewTests/test_reportContentScreen.1.png index 2545174d9..2f30256e0 100644 --- a/UnitTests/__Snapshots__/PreviewTests/test_reportContentScreen.1.png +++ b/UnitTests/__Snapshots__/PreviewTests/test_reportContentScreen.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ffa2ef6254a555d432f742e81ddaf25fcc89b25be5341c21825ef5ac7154c62b -size 133399 +oid sha256:d7383aa48cdf3b936c00086f2f5167e17daaf0c4ee0c49c6ab0682869b202cd9 +size 133244 diff --git a/UnitTests/__Snapshots__/PreviewTests/test_timelineItemMenu.1.png b/UnitTests/__Snapshots__/PreviewTests/test_timelineItemMenu.1.png index 6ffe9d9aa..5e6e90980 100644 --- a/UnitTests/__Snapshots__/PreviewTests/test_timelineItemMenu.1.png +++ b/UnitTests/__Snapshots__/PreviewTests/test_timelineItemMenu.1.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0c5e6481885e148812d7ef2707fe206245f3787d757335b49a29892d6a54a7e2 -size 148746 +oid sha256:4b0ae9219b95452891d536ab89bc71ebfe6b5ef64070a35e275955bb331325ed +size 148475