Skip to content

Commit e83e2ff

Browse files
committed
Use markdown for localized links in ShareVault footer
1 parent 87c8feb commit e83e2ff

File tree

3 files changed

+29
-43
lines changed

3 files changed

+29
-43
lines changed

Cryptomator/VaultDetail/ShareVault/ShareVaultView.swift

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,13 @@ struct ShareVaultView: View {
8181
}
8282

8383
if let footerText = viewModel.footerText,
84-
let docsButtonTitle = viewModel.docsButtonTitle,
8584
let docsURL = viewModel.docsURL {
8685
VStack(spacing: 0) {
87-
(Text(footerText)
88-
.foregroundColor(.secondary) +
89-
Text(" ") +
90-
Text(docsButtonTitle)
91-
.foregroundColor(.cryptomatorPrimary)
92-
.underline() +
93-
Text(".")
94-
.foregroundColor(.secondary))
86+
Text(LocalizedStringKey(String(format: footerText, docsURL.absoluteString)))
9587
.font(.footnote)
88+
.foregroundColor(.secondary)
89+
.accentColor(.cryptomatorPrimary)
9690
.multilineTextAlignment(.center)
97-
.onTapGesture {
98-
UIApplication.shared.open(docsURL)
99-
}
10091
}
10192
.padding(.top, 32)
10293
.padding(.horizontal, 32)
@@ -108,13 +99,13 @@ struct ShareVaultView: View {
10899
}
109100
}
110101

111-
if let url = viewModel.forTeamsURL {
102+
if let url = viewModel.hubURL {
112103
Button(
113104
action: {
114105
UIApplication.shared.open(url)
115106
},
116107
label: {
117-
Text(viewModel.forTeamsButtonTitle)
108+
Text(viewModel.hubButtonTitle)
118109
.font(.headline)
119110
.foregroundColor(.white)
120111
.frame(maxWidth: .infinity)

Cryptomator/VaultDetail/ShareVault/ShareVaultViewModel.swift

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ protocol ShareVaultViewModelProtocol: AnyObject {
2222
var featuresText: String? { get }
2323
var hubSteps: [(String, String)]? { get }
2424
var footerText: String? { get }
25-
var docsButtonTitle: String? { get }
2625
var docsURL: URL? { get }
27-
var forTeamsButtonTitle: String { get }
28-
var forTeamsURL: URL? { get }
26+
var hubButtonTitle: String { get }
27+
var hubURL: URL? { get }
2928
}
3029

3130
class ShareVaultViewModel: ShareVaultViewModelProtocol, ObservableObject {
@@ -36,23 +35,21 @@ class ShareVaultViewModel: ShareVaultViewModelProtocol, ObservableObject {
3635
let featuresText: String?
3736
let hubSteps: [(String, String)]?
3837
let footerText: String?
39-
let docsButtonTitle: String?
4038
let docsURL: URL?
41-
let forTeamsButtonTitle: String
42-
let forTeamsURL: URL?
39+
let hubButtonTitle: String
40+
let hubURL: URL?
4341

4442
init(type: ShareVaultType) {
4543
switch type {
4644
case .normal:
47-
self.headerTitle = LocalizedString.getValue("shareVault.header.title")
45+
self.headerTitle = LocalizedString.getValue("shareVault.normal.header.title")
4846
self.headerSubtitle = nil
49-
self.featuresText = LocalizedString.getValue("shareVault.header.features")
47+
self.featuresText = LocalizedString.getValue("shareVault.normal.header.features")
5048
self.hubSteps = nil
51-
self.footerText = LocalizedString.getValue("shareVault.footer.text")
52-
self.docsButtonTitle = LocalizedString.getValue("shareVault.footer.link")
49+
self.footerText = LocalizedString.getValue("shareVault.normal.footer.text")
5350
self.docsURL = URL(string: "https://docs.cryptomator.org/security/best-practices/#sharing-of-vaults")
54-
self.forTeamsButtonTitle = LocalizedString.getValue("shareVault.button.visitHub")
55-
self.forTeamsURL = URL(string: "https://cryptomator.org/for-teams/")
51+
self.hubButtonTitle = LocalizedString.getValue("shareVault.normal.button.visitHub")
52+
self.hubURL = URL(string: "https://cryptomator.org/for-teams/")
5653
case let .hub(hubURL):
5754
self.headerTitle = LocalizedString.getValue("shareVault.hub.header.title")
5855
self.headerSubtitle = LocalizedString.getValue("shareVault.hub.header.subtitle")
@@ -62,10 +59,9 @@ class ShareVaultViewModel: ShareVaultViewModelProtocol, ObservableObject {
6259
("2.circle.fill", LocalizedString.getValue("shareVault.hub.step2"))
6360
]
6461
self.footerText = nil
65-
self.docsButtonTitle = nil
6662
self.docsURL = nil
67-
self.forTeamsButtonTitle = LocalizedString.getValue("shareVault.hub.button.openHub")
68-
self.forTeamsURL = hubURL
63+
self.hubButtonTitle = LocalizedString.getValue("shareVault.hub.button.openHub")
64+
self.hubURL = hubURL
6965
}
7066
}
7167
}

SharedResources/en.lproj/Localizable.strings

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,19 @@
223223
"sharePoint.selectDrive.header.title" = "Select the SharePoint document library you want to work with.";
224224
"sharePoint.selectDrive.emptyList.footer" = "No Document Libraries Available";
225225

226+
"shareVault.title" = "Share Vault";
227+
"shareVault.normal.header.title" = "The secure way to work in teams";
228+
"shareVault.normal.header.features" = "Collaborate securely with your team. Grant and revoke access anytime without sharing passwords.";
229+
"shareVault.normal.footer.text" = "For more information, check out the best practices suggestions in our [docs](%@).";
230+
"shareVault.normal.button.visitHub" = "Visit Cryptomator Hub";
231+
"shareVault.hub.header.title" = "How to share a Hub vault";
232+
"shareVault.hub.header.subtitle" = "In order to share the vault content with another team member, you have to perform two steps:";
233+
"shareVault.hub.step1" = "Share access of the encrypted vault folder via cloud storage.";
234+
"shareVault.hub.step2" = "Grant access to team member in Cryptomator Hub.";
235+
"shareVault.hub.button.openHub" = "Open Cryptomator Hub";
236+
"shareVault.error.hubURLExtraction.title" = "Unable to Load Hub Information";
237+
"shareVault.error.hubURLExtraction.message" = "The vault's Hub configuration could not be loaded. Please check your vault settings or contact your Hub administrator.";
238+
226239
"snapshots.fileprovider.file1" = "/Accounting.numbers";
227240
"snapshots.fileprovider.file2" = "/Final Presentation.key";
228241
"snapshots.fileprovider.file3" = "/Product Trailer.mov";
@@ -285,20 +298,6 @@
285298
"vaultDetail.button.shareVault" = "Share Vault";
286299
"vaultDetail.shareVault.footer" = "Securely collaborate with your team using Cryptomator Hub.";
287300
"vaultDetail.changePassword.footer" = "Select a strong password for your vault that only you know and keep it in a safe place.";
288-
289-
"shareVault.title" = "Share Vault";
290-
"shareVault.header.title" = "The secure way to work in teams";
291-
"shareVault.header.features" = "Collaborate securely with your team. Grant and revoke access anytime without sharing passwords.";
292-
"shareVault.footer.text" = "For more information, check out the best practices suggestions in our";
293-
"shareVault.footer.link" = "docs";
294-
"shareVault.button.visitHub" = "Visit Cryptomator Hub";
295-
"shareVault.hub.header.title" = "How to share a Hub vault";
296-
"shareVault.hub.header.subtitle" = "In order to share the vault content with another team member, you have to perform two steps:";
297-
"shareVault.hub.step1" = "Share access of the encrypted vault folder via cloud storage.";
298-
"shareVault.hub.step2" = "Grant access to team member in Cryptomator Hub.";
299-
"shareVault.hub.button.openHub" = "Open Cryptomator Hub";
300-
"shareVault.error.hubURLExtraction.title" = "Unable to Load Hub Information";
301-
"shareVault.error.hubURLExtraction.message" = "The vault's Hub configuration could not be loaded. Please check your vault settings or contact your Hub administrator.";
302301
"vaultDetail.disabledBiometricalUnlock.footer" = "If you enable %@, your vault password will be stored in the iOS keychain.";
303302
"vaultDetail.enabledBiometricalUnlock.footer" = "Your vault password will only be required if %@ authentication fails.";
304303
"vaultDetail.info.footer.accessVault" = "Access the vault via the Files app.";

0 commit comments

Comments
 (0)