mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-25 04:48:16 -04:00
Make support url brandable
This commit is contained in:
parent
35911bf366
commit
4a62d0d1ae
@ -103,13 +103,17 @@ struct RootView: View {
|
||||
}
|
||||
}
|
||||
.safeAreaInset(edge: .bottom) {
|
||||
Link(destination: URL(string: "donations.url".localized)!) {
|
||||
HStack {
|
||||
Image(systemName: "heart")
|
||||
Text("enum.navigation_item.donations".localized)
|
||||
.foregroundColor(.primary)
|
||||
if let url = URL(string: Brand.supportURLString) {
|
||||
Link(destination: url) {
|
||||
HStack {
|
||||
Image(systemName: "heart")
|
||||
Text("enum.navigation_item.donations".localizedWithFormat(withArgs: Brand.appName))
|
||||
.foregroundColor(.primary)
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
.padding()}
|
||||
.padding()
|
||||
}
|
||||
}
|
||||
.frame(minWidth: 150)
|
||||
.toolbar {
|
||||
|
@ -36,6 +36,7 @@ enum Brand {
|
||||
static let welcomeLogoImageName: String = "welcomeLogo"
|
||||
static let aboutText: String = Config.value(for: .aboutText) ?? "settings.about.description".localized
|
||||
static let aboutWebsite: String = Config.value(for: .aboutWebsite) ?? "https://www.kiwix.org"
|
||||
static let supportURLString: String = Config.value(for: .supportURL) ?? "https://kiwix.org/get-involved/"
|
||||
|
||||
static var defaultExternalLinkPolicy: ExternalLinkLoadingPolicy {
|
||||
guard let policyString: String = Config.value(for: .externalLinkDefaultPolicy),
|
||||
@ -66,6 +67,7 @@ enum Config: String {
|
||||
case showSearchSnippetInSettings = "SETTINGS_SHOW_SEARCH_SNIPPET"
|
||||
case aboutText = "CUSTOM_ABOUT_TEXT"
|
||||
case aboutWebsite = "CUSTOM_ABOUT_WEBSITE"
|
||||
case supportURL = "SUPPORT_URL"
|
||||
|
||||
static func value<T>(for key: Config) -> T? where T: LosslessStringConvertible {
|
||||
guard let object = Bundle.main.object(forInfoDictionaryKey: key.rawValue) else {
|
||||
|
@ -167,7 +167,7 @@
|
||||
"settings.miscellaneous.title" = "Misc";
|
||||
"settings.miscellaneous.button.feedback" = "Feedback";
|
||||
"settings.miscellaneous.button.rate_app" = "Rate the App";
|
||||
"settings.miscellaneous.button.donate" = "Support Kiwix";
|
||||
"settings.miscellaneous.button.donate" = "Support %@";
|
||||
"settings.miscellaneous.navigation.about" = "About";
|
||||
"settings.selected_language.title" = "Languages";
|
||||
"language_selector.name.title" = "Name";
|
||||
@ -264,10 +264,8 @@
|
||||
"enum.navigation_item.new" = "New";
|
||||
"enum.navigation_item.downloads" = "Downloads";
|
||||
"enum.navigation_item.settings" = "Settings";
|
||||
"enum.navigation_item.donations" = "Support Kiwix";
|
||||
"enum.navigation_item.donations" = "Support %@";
|
||||
"enum.search_result_snippet_mode.disabled" = "Disabled";
|
||||
"enum.search_result_snippet_mode.paragraph" = "First Paragraph";
|
||||
"enum.search_result_snippet_mode.sentence" = "First Sentence";
|
||||
"enum.search_result_snippet_mode.matches" = "Matches";
|
||||
|
||||
"donations.url" = "https://kiwix.org/get-involved/";
|
||||
|
@ -140,6 +140,7 @@
|
||||
"settings.miscellaneous.button.feedback" = "Button title in settings";
|
||||
"settings.miscellaneous.button.rate_app" = "Button title in settings";
|
||||
"settings.miscellaneous.navigation.about" = "Button title in settings opening the about page";
|
||||
"settings.miscellaneous.button.donate" = "Button title in settings, opening the external browser to support the app. The App Name being the argument, eg: Support Kiwix"
|
||||
"settings.selected_language.title" = "Label text for language picker in settings";
|
||||
"language_selector.name.title" = "Table header name in listing the languages and ZIM file count in each language in settings";
|
||||
"language_selector.count.table.title" = "Table header name in listing the languages and ZIM file count in each language in settings";
|
||||
@ -224,6 +225,7 @@
|
||||
"enum.navigation_item.new" = "Side navigation menu item title";
|
||||
"enum.navigation_item.downloads" = "Side navigation menu item title";
|
||||
"enum.navigation_item.settings" = "Side navigation menu item title";
|
||||
"enum.navigation_item.donations" = "Side navigation menu item title, with the App Name being the argument, eg: Support Kiwix"
|
||||
"enum.search_result_snippet_mode.disabled" = "Picker option title in settings. Search snippet: Disabled | First Paragraph | First Sentence | Matches";
|
||||
"enum.search_result_snippet_mode.paragraph" = "Picker option title in settings. Search snippet: Disabled | First Paragraph | First Sentence | Matches";
|
||||
"enum.search_result_snippet_mode.sentence" = "Picker option title in settings. Search snippet: Disabled | First Paragraph | First Sentence | Matches";
|
||||
|
@ -228,7 +228,10 @@ struct Settings: View {
|
||||
appStoreID: Brand.appStoreId)
|
||||
UIApplication.shared.open(url)
|
||||
}
|
||||
Link("settings.miscellaneous.button.donate".localized, destination: URL(string: "donations.url".localized)!)
|
||||
if let url = URL(string: Brand.supportURLString) {
|
||||
Link("settings.miscellaneous.button.donate".localizedWithFormat(withArgs: Brand.appName),
|
||||
destination: url)
|
||||
}
|
||||
NavigationLink("settings.miscellaneous.navigation.about".localized) { About() }
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user