From 6b3df75f951d7af518caa3b0390b6e0f34224693 Mon Sep 17 00:00:00 2001 From: CMK Date: Mon, 2 Aug 2021 16:39:33 +0800 Subject: [PATCH 01/15] chore: setup Crowdin integration --- crowdin.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 crowdin.yml diff --git a/crowdin.yml b/crowdin.yml new file mode 100644 index 00000000..9c86d096 --- /dev/null +++ b/crowdin.yml @@ -0,0 +1,30 @@ +# +# Files configuration +# +files: [ + { + # + # Source files filter + # e.g. "/resources/en/*.json" + # + "source" : "/Localization/app.json", + + # + # Where translations will be placed + # e.g. "/resources/%two_letters_code%/%original_file_name%" + # + "translation" : "/Localization/StringsConvertor/input/%two_letters_code%/%original_file_name%", + + # + # The parameter "update_option" is optional. If it is not set, after the files update the translations for changed strings will be removed. Use to fix typos and for minor changes in the source strings + # e.g. "update_as_unapproved" or "update_without_changes" + # + "update_option" : "update_as_unapproved", + # + }, + { + "source" : "/Localization/ios-infoPlist.json", + "translation" : "/Localization/StringsConvertor/input/%two_letters_code%/%original_file_name%", + "update_option" : "update_as_unapproved", + } +] \ No newline at end of file From d3fe6075598f4400039bf088afb598490bedf408 Mon Sep 17 00:00:00 2001 From: CMK Date: Mon, 2 Aug 2021 17:00:03 +0800 Subject: [PATCH 02/15] chore: update translation settings --- crowdin.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crowdin.yml b/crowdin.yml index 9c86d096..6d47ef91 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -13,7 +13,7 @@ files: [ # Where translations will be placed # e.g. "/resources/%two_letters_code%/%original_file_name%" # - "translation" : "/Localization/StringsConvertor/input/%two_letters_code%/%original_file_name%", + "translation" : "/Localization/StringsConvertor/input/%locale_with_underscore%/%original_file_name%", # # The parameter "update_option" is optional. If it is not set, after the files update the translations for changed strings will be removed. Use to fix typos and for minor changes in the source strings @@ -24,7 +24,7 @@ files: [ }, { "source" : "/Localization/ios-infoPlist.json", - "translation" : "/Localization/StringsConvertor/input/%two_letters_code%/%original_file_name%", + "translation" : "/Localization/StringsConvertor/input/%locale_with_underscore%/%original_file_name%", "update_option" : "update_as_unapproved", } ] \ No newline at end of file From a19f7cbb409964e631f963722e227b283ae1294e Mon Sep 17 00:00:00 2001 From: CMK Date: Mon, 2 Aug 2021 19:24:34 +0800 Subject: [PATCH 03/15] chore: move intent definition file into directory --- Mastodon.xcodeproj/project.pbxproj | 2 +- .../xcschemes/xcschememanagement.plist | 8 ++++---- .../Base.lproj}/Intents.intentdefinition | 0 {ar.lproj => MastodonIntent/ar.lproj}/Intents.strings | 0 {en.lproj => MastodonIntent/en.lproj}/Intents.strings | 0 5 files changed, 5 insertions(+), 5 deletions(-) rename {Base.lproj => MastodonIntent/Base.lproj}/Intents.intentdefinition (100%) rename {ar.lproj => MastodonIntent/ar.lproj}/Intents.strings (100%) rename {en.lproj => MastodonIntent/en.lproj}/Intents.strings (100%) diff --git a/Mastodon.xcodeproj/project.pbxproj b/Mastodon.xcodeproj/project.pbxproj index 1f3db09e..a3cb73ef 100644 --- a/Mastodon.xcodeproj/project.pbxproj +++ b/Mastodon.xcodeproj/project.pbxproj @@ -2033,7 +2033,6 @@ DB427DC925BAA00100D1B89D = { isa = PBXGroup; children = ( - DB0009A926AEE5DC009B9D2D /* Intents.intentdefinition */, DBF53F5F25C14E88008AAC7B /* Mastodon.xctestplan */, DBF53F6025C14E9D008AAC7B /* MastodonSDK.xctestplan */, DB3D0FED25BAA42200EAA174 /* MastodonSDK */, @@ -2599,6 +2598,7 @@ DB8FABC826AEC7B2008E5AF4 /* MastodonIntent */ = { isa = PBXGroup; children = ( + DB0009A926AEE5DC009B9D2D /* Intents.intentdefinition */, DB8FABD626AEC864008E5AF4 /* MastodonIntent.entitlements */, DB8FABC926AEC7B2008E5AF4 /* IntentHandler.swift */, DBB8AB4526AECDE200F6D281 /* SendPostIntentHandler.swift */, diff --git a/Mastodon.xcodeproj/xcuserdata/mainasuk.xcuserdatad/xcschemes/xcschememanagement.plist b/Mastodon.xcodeproj/xcuserdata/mainasuk.xcuserdatad/xcschemes/xcschememanagement.plist index 88e42553..0dd2f785 100644 --- a/Mastodon.xcodeproj/xcuserdata/mainasuk.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/Mastodon.xcodeproj/xcuserdata/mainasuk.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,12 +7,12 @@ AppShared.xcscheme_^#shared#^_ orderHint - 26 + 24 CoreDataStack.xcscheme_^#shared#^_ orderHint - 24 + 23 Mastodon - ASDK.xcscheme_^#shared#^_ @@ -37,7 +37,7 @@ MastodonIntent.xcscheme_^#shared#^_ orderHint - 25 + 26 MastodonIntents.xcscheme_^#shared#^_ @@ -57,7 +57,7 @@ ShareActionExtension.xcscheme_^#shared#^_ orderHint - 23 + 25 SuppressBuildableAutocreation diff --git a/Base.lproj/Intents.intentdefinition b/MastodonIntent/Base.lproj/Intents.intentdefinition similarity index 100% rename from Base.lproj/Intents.intentdefinition rename to MastodonIntent/Base.lproj/Intents.intentdefinition diff --git a/ar.lproj/Intents.strings b/MastodonIntent/ar.lproj/Intents.strings similarity index 100% rename from ar.lproj/Intents.strings rename to MastodonIntent/ar.lproj/Intents.strings diff --git a/en.lproj/Intents.strings b/MastodonIntent/en.lproj/Intents.strings similarity index 100% rename from en.lproj/Intents.strings rename to MastodonIntent/en.lproj/Intents.strings From bccdb6602320c2355482594bc4cadb3f9f08de85 Mon Sep 17 00:00:00 2001 From: CMK Date: Mon, 2 Aug 2021 19:24:46 +0800 Subject: [PATCH 04/15] chore: update README --- Localization/README.md | 13 ++++++++----- README.md | 3 +++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Localization/README.md b/Localization/README.md index b6baf178..ac32319c 100644 --- a/Localization/README.md +++ b/Localization/README.md @@ -1,20 +1,23 @@ # Localization +[![Crowdin](https://badges.crowdin.net/mastodon-for-ios/localized.svg)](https://crowdin.com/project/mastodon-for-ios) Mastodon localization template file ## How to contribute? -TBD +Please use the [Crodwin](https://crowdin.com/project/mastodon-for-ios) to contribute. If your language is not in the list. Please feel free to open the issue. ## How to maintains +The project use a script to generate Xcode localized strings files. + ```zsh // enter workdir cd Mastodon -// edit i18n json -open ./Localization/app.json -// update resource -update_localization.sh +// merge PR from Crowdin bot + +// update resource +./update_localization.sh ``` \ No newline at end of file diff --git a/README.md b/README.md index 7b119d56..d8f7a9c6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # Mastodon +[![CI](https://github.com/mastodon/mastodon-ios/actions/workflows/main.yml/badge.svg)](https://github.com/mastodon/mastodon-ios/actions/workflows/main.yml) [![Crowdin](https://badges.crowdin.net/mastodon-for-ios/localized.svg)](https://crowdin.com/project/mastodon-for-ios) + + Download on the App Store ## Requirements From 120fc83b16a402b89c360059ae15d19c3ba1bd62 Mon Sep 17 00:00:00 2001 From: CMK Date: Mon, 2 Aug 2021 19:29:57 +0800 Subject: [PATCH 05/15] chore: update Crowdin configuration --- crowdin.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crowdin.yml b/crowdin.yml index 6d47ef91..4b5310c7 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -26,5 +26,10 @@ files: [ "source" : "/Localization/ios-infoPlist.json", "translation" : "/Localization/StringsConvertor/input/%locale_with_underscore%/%original_file_name%", "update_option" : "update_as_unapproved", + }, + { + "source" : "/MastodonIntent/en.lproj/Intents.strings", + "translation" : "/Localization/StringsConvertor/Intents/input/%locale_with_underscore%/%original_file_name%", + "update_option" : "update_as_unapproved", } ] \ No newline at end of file From 777d4e9bc06a2c4b731a05618c3f7ef34cc89b45 Mon Sep 17 00:00:00 2001 From: CMK Date: Mon, 2 Aug 2021 19:42:55 +0800 Subject: [PATCH 06/15] fix: CI build issue --- Podfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Podfile b/Podfile index b976556b..868af1a9 100644 --- a/Podfile +++ b/Podfile @@ -55,4 +55,12 @@ plugin 'cocoapods-keys', { "notification_endpoint", "notification_endpoint_debug" ] -} \ No newline at end of file +} + +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET' + end + end +end \ No newline at end of file From 53e9243310183b626c4f50263d97afde4a500f41 Mon Sep 17 00:00:00 2001 From: CMK Date: Mon, 2 Aug 2021 19:55:14 +0800 Subject: [PATCH 07/15] chore: fix CI env issue --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e1bc703a..49216e03 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,8 +19,8 @@ jobs: steps: - name: checkout uses: actions/checkout@v2 - - name: force Xcode 12.2 - run: sudo xcode-select -switch /Applications/Xcode_12.2.app + - name: force Xcode 12.4 + run: sudo xcode-select -switch /Applications/Xcode_12.4.app - name: setup run: exec ./.github/scripts/setup.sh - name: build From c983faec1cc6092ac3f944b4fef756921d29b9bc Mon Sep 17 00:00:00 2001 From: CMK Date: Tue, 3 Aug 2021 16:56:06 +0800 Subject: [PATCH 08/15] chore: update pod --- .../xcschemes/xcschememanagement.plist | 8 ++++---- Podfile.lock | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Mastodon.xcodeproj/xcuserdata/mainasuk.xcuserdatad/xcschemes/xcschememanagement.plist b/Mastodon.xcodeproj/xcuserdata/mainasuk.xcuserdatad/xcschemes/xcschememanagement.plist index 0dd2f785..b0069747 100644 --- a/Mastodon.xcodeproj/xcuserdata/mainasuk.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/Mastodon.xcodeproj/xcuserdata/mainasuk.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,12 +7,12 @@ AppShared.xcscheme_^#shared#^_ orderHint - 24 + 25 CoreDataStack.xcscheme_^#shared#^_ orderHint - 23 + 24 Mastodon - ASDK.xcscheme_^#shared#^_ @@ -37,7 +37,7 @@ MastodonIntent.xcscheme_^#shared#^_ orderHint - 26 + 27 MastodonIntents.xcscheme_^#shared#^_ @@ -57,7 +57,7 @@ ShareActionExtension.xcscheme_^#shared#^_ orderHint - 25 + 23 SuppressBuildableAutocreation diff --git a/Podfile.lock b/Podfile.lock index c59f13a9..b2c540ab 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -78,6 +78,6 @@ SPEC CHECKSUMS: Texture: 2f109e937850d94d1d07232041c9c7313ccddb81 "UITextField+Shake": 298ac5a0f239d731bdab999b19b628c956ca0ac3 -PODFILE CHECKSUM: 1ea006302c191ee52b6206e4957aa78fb66fe690 +PODFILE CHECKSUM: 4db0bdf969729c5758bd923e33d9e097cb892086 -COCOAPODS: 1.10.1 +COCOAPODS: 1.10.2 From 9d39cec9b045f5dd1a59d45f66ecfdbdc0e12ed5 Mon Sep 17 00:00:00 2001 From: CMK Date: Tue, 3 Aug 2021 16:57:42 +0800 Subject: [PATCH 09/15] fix: register local not preferred language issue. resolve #238 --- .../MastodonRegisterViewController.swift | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Mastodon/Scene/Onboarding/Register/MastodonRegisterViewController.swift b/Mastodon/Scene/Onboarding/Register/MastodonRegisterViewController.swift index 5ea418e4..ffef3d87 100644 --- a/Mastodon/Scene/Onboarding/Register/MastodonRegisterViewController.swift +++ b/Mastodon/Scene/Onboarding/Register/MastodonRegisterViewController.swift @@ -744,13 +744,33 @@ extension MastodonRegisterViewController { let username = viewModel.username.value let email = viewModel.email.value let password = viewModel.password.value + + let locale: String = { + let fallbackLanguageCode = Locale.current.languageCode ?? "en" + guard let identifier = Locale.preferredLanguages.first else { + return fallbackLanguageCode + } + let local = Locale(identifier: identifier) + guard let languageCode = local.languageCode else { + return fallbackLanguageCode + } + switch languageCode { + case "zh": + // Check Simplified Chinese / Traditional Chinese + // https://github.com/gunchleoc/mastodon/blob/ed6153b8f24d3a8f5a124cc95683bd1f20aec882/app/helpers/settings_helper.rb + guard let regionCode = local.regionCode else { return languageCode } + return "zh" + "-" + regionCode + default: + return languageCode + } + }() let query = Mastodon.API.Account.RegisterQuery( reason: viewModel.reason.value, username: username, email: email, password: password, agreement: true, // user confirmed in the server rules scene - locale: Locale.current.languageCode ?? "en" + locale: locale ) // register without show server rules From 48ac5d13b0af4c0afe37c68d8639f79f144d678e Mon Sep 17 00:00:00 2001 From: CMK Date: Tue, 3 Aug 2021 17:13:22 +0800 Subject: [PATCH 10/15] fix: reply scope not respect issue. resolve #232 #242 --- Mastodon/Scene/Compose/ComposeViewModel.swift | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/Mastodon/Scene/Compose/ComposeViewModel.swift b/Mastodon/Scene/Compose/ComposeViewModel.swift index 9964dd2b..d9fa849a 100644 --- a/Mastodon/Scene/Compose/ComposeViewModel.swift +++ b/Mastodon/Scene/Compose/ComposeViewModel.swift @@ -95,7 +95,36 @@ final class ComposeViewModel: NSObject { case .post, .hashtag, .mention: self.title = CurrentValueSubject(L10n.Scene.Compose.Title.newPost) case .reply: self.title = CurrentValueSubject(L10n.Scene.Compose.Title.newReply) } - self.selectedStatusVisibility = CurrentValueSubject(context.authenticationService.activeMastodonAuthentication.value?.user.locked == true ? .private : .public) + self.selectedStatusVisibility = { + // default private when user locked + var visibility: ComposeToolbarView.VisibilitySelectionType = context.authenticationService.activeMastodonAuthentication.value?.user.locked == true ? .private : .public + // set visibility is replied post is DM + switch composeKind { + case .reply(let repliedToStatusObjectID): + context.managedObjectContext.performAndWait { + guard let status = try? context.managedObjectContext.existingObject(with: repliedToStatusObjectID) as? Status else { + assertionFailure() + return + } + guard let repliedStatusVisibility = status.visibilityEnum else { return } + switch repliedStatusVisibility { + case .public, .unlisted: + // keep default + break + case .private: + visibility = .private + case .direct: + visibility = .direct + case ._other: + assertionFailure() + break + } + } + default: + break + } + return CurrentValueSubject(visibility) + }() self.activeAuthentication = CurrentValueSubject(context.authenticationService.activeMastodonAuthentication.value) self.activeAuthenticationBox = CurrentValueSubject(context.authenticationService.activeMastodonAuthenticationBox.value) super.init() From 13204255643699f332dbcdd6c32417536f422cad Mon Sep 17 00:00:00 2001 From: CMK Date: Tue, 3 Aug 2021 17:19:12 +0800 Subject: [PATCH 11/15] chore: update comment --- Mastodon/Scene/Compose/ComposeViewModel.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mastodon/Scene/Compose/ComposeViewModel.swift b/Mastodon/Scene/Compose/ComposeViewModel.swift index d9fa849a..601aeae0 100644 --- a/Mastodon/Scene/Compose/ComposeViewModel.swift +++ b/Mastodon/Scene/Compose/ComposeViewModel.swift @@ -98,7 +98,7 @@ final class ComposeViewModel: NSObject { self.selectedStatusVisibility = { // default private when user locked var visibility: ComposeToolbarView.VisibilitySelectionType = context.authenticationService.activeMastodonAuthentication.value?.user.locked == true ? .private : .public - // set visibility is replied post is DM + // set visibility for reply post switch composeKind { case .reply(let repliedToStatusObjectID): context.managedObjectContext.performAndWait { From 3e77c72d32e27dec37715403960a7e108c546f61 Mon Sep 17 00:00:00 2001 From: CMK Date: Tue, 3 Aug 2021 17:33:24 +0800 Subject: [PATCH 12/15] feat: set setting footer to app version and add GitHub entry --- Mastodon/Diffiable/Item/SettingsItem.swift | 3 + Mastodon/Extension/MetaLabel.swift | 2 +- .../Settings/SettingsViewController.swift | 76 +++++++++++-------- .../Scene/Settings/SettingsViewModel.swift | 1 + 4 files changed, 50 insertions(+), 32 deletions(-) diff --git a/Mastodon/Diffiable/Item/SettingsItem.swift b/Mastodon/Diffiable/Item/SettingsItem.swift index e82d0e1f..ed472808 100644 --- a/Mastodon/Diffiable/Item/SettingsItem.swift +++ b/Mastodon/Diffiable/Item/SettingsItem.swift @@ -58,6 +58,7 @@ extension SettingsItem { enum Link: CaseIterable, Hashable { case accountSettings + case github case termsOfService case privacyPolicy case clearMediaCache @@ -66,6 +67,7 @@ extension SettingsItem { var title: String { switch self { case .accountSettings: return L10n.Scene.Settings.Section.BoringZone.accountSettings + case .github: return "GitHub" case .termsOfService: return L10n.Scene.Settings.Section.BoringZone.terms case .privacyPolicy: return L10n.Scene.Settings.Section.BoringZone.privacy case .clearMediaCache: return L10n.Scene.Settings.Section.SpicyZone.clear @@ -76,6 +78,7 @@ extension SettingsItem { var textColor: UIColor { switch self { case .accountSettings: return Asset.Colors.brandBlue.color + case .github: return Asset.Colors.brandBlue.color case .termsOfService: return Asset.Colors.brandBlue.color case .privacyPolicy: return Asset.Colors.brandBlue.color case .clearMediaCache: return .systemRed diff --git a/Mastodon/Extension/MetaLabel.swift b/Mastodon/Extension/MetaLabel.swift index e5a588e1..e1ea3273 100644 --- a/Mastodon/Extension/MetaLabel.swift +++ b/Mastodon/Extension/MetaLabel.swift @@ -66,7 +66,7 @@ extension MetaLabel { case .settingTableFooter: font = .preferredFont(forTextStyle: .body) - textColor = Asset.Colors.Label.primary.color + textColor = Asset.Colors.Label.secondary.color numberOfLines = 0 textContainer.maximumNumberOfLines = 0 paragraphStyle.alignment = .center diff --git a/Mastodon/Scene/Settings/SettingsViewController.swift b/Mastodon/Scene/Settings/SettingsViewController.swift index 9a240daa..c6e41e62 100644 --- a/Mastodon/Scene/Settings/SettingsViewController.swift +++ b/Mastodon/Scene/Settings/SettingsViewController.swift @@ -105,18 +105,18 @@ class SettingsViewController: UIViewController, NeedsDependency { }() let tableFooterLabel = MetaLabel(style: .settingTableFooter) -// lazy var tableFooterView: UIView = { -// // init with a frame to fix a conflict ('UIView-Encapsulated-Layout-Height' UIStackView:0x7ffe41e47da0.height == 0) -// let view = UIStackView(frame: CGRect(x: 0, y: 0, width: 320, height: 320)) -// view.isLayoutMarginsRelativeArrangement = true -// view.layoutMargins = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20) -// view.axis = .vertical -// view.alignment = .center -// -// tableFooterLabel.linkDelegate = self -// view.addArrangedSubview(tableFooterLabel) -// return view -// }() + lazy var tableFooterView: UIView = { + // init with a frame to fix a conflict ('UIView-Encapsulated-Layout-Height' UIStackView:0x7ffe41e47da0.height == 0) + let view = UIStackView(frame: CGRect(x: 0, y: 0, width: 320, height: 320)) + view.isLayoutMarginsRelativeArrangement = true + view.layoutMargins = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20) + view.axis = .vertical + view.alignment = .center + + // tableFooterLabel.linkDelegate = self + view.addArrangedSubview(tableFooterLabel) + return view + }() override func viewDidLoad() { super.viewDidLoad() @@ -188,24 +188,31 @@ class SettingsViewController: UIViewController, NeedsDependency { } .store(in: &disposeBag) - viewModel.currentInstance - .receive(on: RunLoop.main) - .sink { [weak self] instance in - guard let self = self else { return } - let version = instance?.version ?? "-" - let link = #"mastodon/mastodon"# - let content = L10n.Scene.Settings.Footer.mastodonDescription(link, version) - let mastodonContent = MastodonContent(content: content, emojis: [:]) - do { - let metaContent = try MastodonMetaContent.convert(document: mastodonContent) - self.tableFooterLabel.configure(content: metaContent) - } catch { - let metaContent = PlaintextMetaContent(string: "") - self.tableFooterLabel.configure(content: metaContent) - assertionFailure() - } - } - .store(in: &disposeBag) + + let footer = "Mastodon v\(UIApplication.appVersion()) (\(UIApplication.appBuild()))" + let metaContent = PlaintextMetaContent(string: footer) + tableFooterLabel.configure(content: metaContent) + + // FIXME: + // needs a workaround for GitHub link +// viewModel.currentInstance +// .receive(on: RunLoop.main) +// .sink { [weak self] instance in +// guard let self = self else { return } +// let version = instance?.version ?? "-" +// let link = #"mastodon/mastodon"# +// let content = L10n.Scene.Settings.Footer.mastodonDescription(link, version) +// let mastodonContent = MastodonContent(content: content, emojis: [:]) +// do { +// let metaContent = try MastodonMetaContent.convert(document: mastodonContent) +// self.tableFooterLabel.configure(content: metaContent) +// } catch { +// let metaContent = PlaintextMetaContent(string: "") +// self.tableFooterLabel.configure(content: metaContent) +// assertionFailure() +// } +// } +// .store(in: &disposeBag) } private func setupView() { @@ -259,7 +266,7 @@ class SettingsViewController: UIViewController, NeedsDependency { settingsAppearanceTableViewCellDelegate: self, settingsToggleCellDelegate: self ) - // tableView.tableFooterView = tableFooterView + tableView.tableFooterView = tableFooterView } func alertToSignout() { @@ -376,6 +383,13 @@ extension SettingsViewController: UITableViewDelegate { guard let box = context.authenticationService.activeMastodonAuthenticationBox.value, let url = URL(string: "https://\(box.domain)/auth/edit") else { return } viewModel.openAuthenticationPage(authenticateURL: url, presentationContextProvider: self) + case .github: + guard let url = URL(string: "https://github.com/mastodon/mastodon-ios") else { break } + coordinator.present( + scene: .safari(url: url), + from: self, + transition: .safariPresent(animated: true, completion: nil) + ) case .termsOfService, .privacyPolicy: // same URL guard let url = viewModel.privacyURL else { break } diff --git a/Mastodon/Scene/Settings/SettingsViewModel.swift b/Mastodon/Scene/Settings/SettingsViewModel.swift index 9bc0adce..9158e816 100644 --- a/Mastodon/Scene/Settings/SettingsViewModel.swift +++ b/Mastodon/Scene/Settings/SettingsViewModel.swift @@ -130,6 +130,7 @@ extension SettingsViewModel { let boringZoneSettingsItems: [SettingsItem] = { let links: [SettingsItem.Link] = [ .accountSettings, + .github, .termsOfService, .privacyPolicy ] From f6f6dde258c2b7dfaca3b0c910c67327eed4f7c2 Mon Sep 17 00:00:00 2001 From: CMK Date: Tue, 3 Aug 2021 17:40:36 +0800 Subject: [PATCH 13/15] chore: update version to 1.0.1 (51) --- Mastodon.xcodeproj/project.pbxproj | 64 +++++++++++++++--------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/Mastodon.xcodeproj/project.pbxproj b/Mastodon.xcodeproj/project.pbxproj index a3cb73ef..56674070 100644 --- a/Mastodon.xcodeproj/project.pbxproj +++ b/Mastodon.xcodeproj/project.pbxproj @@ -4482,7 +4482,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Mastodon/Mastodon.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 50; + CURRENT_PROJECT_VERSION = 51; DEVELOPMENT_ASSET_PATHS = "Mastodon/Resources/Preview\\ Assets.xcassets"; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = Mastodon/Info.plist; @@ -4490,7 +4490,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -4509,7 +4509,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Mastodon/Mastodon.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 50; + CURRENT_PROJECT_VERSION = 51; DEVELOPMENT_ASSET_PATHS = "Mastodon/Resources/Preview\\ Assets.xcassets"; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = Mastodon/Info.plist; @@ -4517,7 +4517,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -4772,7 +4772,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = MastodonIntent/MastodonIntent.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 50; + CURRENT_PROJECT_VERSION = 51; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = MastodonIntent/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -4780,7 +4780,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.MastodonIntent; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -4796,7 +4796,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = MastodonIntent/MastodonIntent.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 50; + CURRENT_PROJECT_VERSION = 51; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = MastodonIntent/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -4804,7 +4804,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.MastodonIntent; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -4820,7 +4820,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = MastodonIntent/MastodonIntent.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 50; + CURRENT_PROJECT_VERSION = 51; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = MastodonIntent/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -4828,7 +4828,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.MastodonIntent; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -4844,7 +4844,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = MastodonIntent/MastodonIntent.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 50; + CURRENT_PROJECT_VERSION = 51; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = MastodonIntent/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -4852,7 +4852,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.MastodonIntent; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -4868,7 +4868,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = ShareActionExtension/ShareActionExtension.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 50; + CURRENT_PROJECT_VERSION = 51; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = ShareActionExtension/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -4876,7 +4876,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.ShareActionExtension; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -4892,7 +4892,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = ShareActionExtension/ShareActionExtension.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 50; + CURRENT_PROJECT_VERSION = 51; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = ShareActionExtension/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -4900,7 +4900,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.ShareActionExtension; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -4916,7 +4916,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = ShareActionExtension/ShareActionExtension.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 50; + CURRENT_PROJECT_VERSION = 51; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = ShareActionExtension/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -4924,7 +4924,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.ShareActionExtension; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -4940,7 +4940,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = ShareActionExtension/ShareActionExtension.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 50; + CURRENT_PROJECT_VERSION = 51; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = ShareActionExtension/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -4948,7 +4948,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.ShareActionExtension; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -5030,7 +5030,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Mastodon/Mastodon.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 50; + CURRENT_PROJECT_VERSION = 51; DEVELOPMENT_ASSET_PATHS = "Mastodon/Resources/Preview\\ Assets.xcassets"; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = Mastodon/Info.plist; @@ -5038,7 +5038,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -5144,7 +5144,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 50; + CURRENT_PROJECT_VERSION = 51; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = NotificationService/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -5152,7 +5152,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.NotificationService; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -5264,7 +5264,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Mastodon/Mastodon.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 50; + CURRENT_PROJECT_VERSION = 51; DEVELOPMENT_ASSET_PATHS = "Mastodon/Resources/Preview\\ Assets.xcassets"; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = Mastodon/Info.plist; @@ -5272,7 +5272,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -5378,7 +5378,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 50; + CURRENT_PROJECT_VERSION = 51; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = NotificationService/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -5386,7 +5386,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.NotificationService; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -5432,7 +5432,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 50; + CURRENT_PROJECT_VERSION = 51; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = NotificationService/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -5440,7 +5440,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.NotificationService; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -5455,7 +5455,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 50; + CURRENT_PROJECT_VERSION = 51; DEVELOPMENT_TEAM = 5Z4GVSS33P; INFOPLIST_FILE = NotificationService/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -5463,7 +5463,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 1.0.1; PRODUCT_BUNDLE_IDENTIFIER = org.joinmastodon.app.NotificationService; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; From 9ae6d248e97e277a8cfb8766ecdf7d77926232ec Mon Sep 17 00:00:00 2001 From: CMK Date: Tue, 3 Aug 2021 17:50:04 +0800 Subject: [PATCH 14/15] chore: add issue template --- .github/ISSUE_TEMPLATE/issue.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/issue.md diff --git a/.github/ISSUE_TEMPLATE/issue.md b/.github/ISSUE_TEMPLATE/issue.md new file mode 100644 index 00000000..cc2855ed --- /dev/null +++ b/.github/ISSUE_TEMPLATE/issue.md @@ -0,0 +1,32 @@ +## Description + + + +## App version +> You can check the version and build number in app setting footer. + + +- Version: v0.0.0 +- Build: 0 + +## Detail + +### Steps to reproduce + + + +1. Tap … +2. … + +### Actual Behavior + + + +The app … + +### Expected behavior + + + +The app … + From 4adeef19796f8e9e0a4e10a095fc4f13c04f6128 Mon Sep 17 00:00:00 2001 From: CMK Date: Tue, 3 Aug 2021 18:12:06 +0800 Subject: [PATCH 15/15] fix: use wrong loader issue --- Mastodon/Scene/HomeTimeline/HomeTimelineViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mastodon/Scene/HomeTimeline/HomeTimelineViewController.swift b/Mastodon/Scene/HomeTimeline/HomeTimelineViewController.swift index e69d3bae..a08f162a 100644 --- a/Mastodon/Scene/HomeTimeline/HomeTimelineViewController.swift +++ b/Mastodon/Scene/HomeTimeline/HomeTimelineViewController.swift @@ -388,7 +388,7 @@ extension HomeTimelineViewController: LoadMoreConfigurableTableViewContainer { typealias BottomLoaderTableViewCell = TimelineBottomLoaderTableViewCell typealias LoadingState = HomeTimelineViewModel.LoadOldestState.Loading var loadMoreConfigurableTableView: UITableView { return tableView } - var loadMoreConfigurableStateMachine: GKStateMachine { return viewModel.loadLatestStateMachine } + var loadMoreConfigurableStateMachine: GKStateMachine { return viewModel.loadOldestStateMachine } } // MARK: - UITableViewDelegate