mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-25 04:48:16 -04:00
Merge pull request #705 from DobleV55/660-add-supp…item-to-menu
Add support link item in side bar
This commit is contained in:
commit
bd992e690b
@ -102,6 +102,20 @@ struct RootView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.safeAreaInset(edge: .bottom) {
|
||||
if let url = URL(string: Brand.supportURLString) {
|
||||
Link(destination: url) {
|
||||
HStack {
|
||||
Image(systemName: "heart")
|
||||
Text("common.support.app_name".localizedWithFormat(withArgs: Brand.appName))
|
||||
.foregroundColor(.primary)
|
||||
.multilineTextAlignment(.leading)
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
}
|
||||
.frame(minWidth: 150)
|
||||
.toolbar {
|
||||
Button {
|
||||
|
@ -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 {
|
||||
|
@ -23,6 +23,7 @@
|
||||
"common.button.yes" = "Ja";
|
||||
"common.button.no" = "nein";
|
||||
"common.search" = "Suchen";
|
||||
"common.support.app_name" = "%@ unterstützen";
|
||||
"common.tab.manager.title" = "Tabs-Manager";
|
||||
"common.tab.navigation.title" = "Tabs";
|
||||
"common.tab.menu.new_tab" = "Neuer Tab";
|
||||
|
@ -39,6 +39,7 @@
|
||||
"common.tab.list.close" = "Close Tab";
|
||||
"common.tab.menu.library" = "Library";
|
||||
"common.tab.menu.settings" = "Settings";
|
||||
"common.support.app_name" = "Support %@";
|
||||
|
||||
"outline_button.outline.title" = "Outline";
|
||||
"outline_button.outline.help" = "Show article outline";
|
||||
|
@ -21,6 +21,7 @@
|
||||
"common.button.yes" = "It is a title in the summary table on macOS: we list the attributes of a ZIM file: does it contain pictures yes/no, does it contain Videos yes/no, Details? yes/no";
|
||||
"common.button.no" = "It is a title in the summary table on macOS: we list the attributes of a ZIM file: does it contain pictures yes/no, does it contain Videos yes/no, Details? yes/no";
|
||||
"common.search" = "The default placeholder text for searchbars, when the search input field is empty";
|
||||
"common.support.app_name" = "Button title, opening the external browser to support the app. The App Name being the argument, eg: Support Kiwix";
|
||||
"common.tab.manager.title" = "Accessibility label for button tab bar button that opens an overlay menu.";
|
||||
"common.tab.navigation.title" = "On iPad it is a title in the sidemenu grouping tabs related buttons";
|
||||
"common.tab.menu.new_tab" = "Button title of an item in the overflow menu on iOS, the default title for a new tab (that has no content loaded yet) on iPad";
|
||||
|
@ -228,6 +228,10 @@ struct Settings: View {
|
||||
appStoreID: Brand.appStoreId)
|
||||
UIApplication.shared.open(url)
|
||||
}
|
||||
if let url = URL(string: Brand.supportURLString) {
|
||||
Link("common.support.app_name".localizedWithFormat(withArgs: Brand.appName),
|
||||
destination: url)
|
||||
}
|
||||
NavigationLink("settings.miscellaneous.navigation.about".localized) { About() }
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user