mirror of
https://github.com/kiwix/kiwix-apple.git
synced 2025-09-27 22:10:57 -04:00
#553 custom about text and link
This commit is contained in:
parent
e7ae346199
commit
ef51bcb1e9
@ -34,6 +34,8 @@ enum Brand {
|
||||
static let appName: String = Config.value(for: .displayName) ?? "Kiwix"
|
||||
static let appStoreId: String = Config.value(for: .appStoreID) ?? "id997079563"
|
||||
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) ?? "www.kiwix.org"
|
||||
|
||||
static var defaultExternalLinkPolicy: ExternalLinkLoadingPolicy {
|
||||
guard let policyString: String = Config.value(for: .externalLinkDefaultPolicy),
|
||||
@ -62,6 +64,8 @@ enum Config: String {
|
||||
case showExternalLinkSettings = "SETTINGS_SHOW_EXTERNAL_LINK_OPTION"
|
||||
case externalLinkDefaultPolicy = "SETTINGS_DEFAULT_EXTERNAL_LINK_TO"
|
||||
case showSearchSnippetInSettings = "SETTINGS_SHOW_SEARCH_SNIPPET"
|
||||
case aboutText = "CUSTOM_ABOUT_TEXT"
|
||||
case aboutWebsite = "CUSTOM_ABOUT_WEBSITE"
|
||||
|
||||
static func value<T>(for key: Config) -> T? where T: LosslessStringConvertible {
|
||||
guard let object = Bundle.main.object(forInfoDictionaryKey: key.rawValue) else {
|
||||
|
@ -80,7 +80,7 @@ struct About: View {
|
||||
}
|
||||
|
||||
private var about: some View {
|
||||
Text("settings.about.description".localized)
|
||||
Text(Brand.aboutText)
|
||||
}
|
||||
|
||||
private var release: some View {
|
||||
@ -99,7 +99,7 @@ struct About: View {
|
||||
|
||||
private var ourWebsite: some View {
|
||||
Button("settings.about.our_website.button".localized) {
|
||||
externalLinkURL = URL(string: "https://www.kiwix.org")
|
||||
externalLinkURL = URL(string: "https://\(Brand.aboutWebsite)")
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user