#553 custom about text and link

This commit is contained in:
Balazs Perlaki-Horvath 2023-12-06 22:48:36 +01:00 committed by Kelson
parent e7ae346199
commit ef51bcb1e9
2 changed files with 6 additions and 2 deletions

View File

@ -34,6 +34,8 @@ enum Brand {
static let appName: String = Config.value(for: .displayName) ?? "Kiwix" static let appName: String = Config.value(for: .displayName) ?? "Kiwix"
static let appStoreId: String = Config.value(for: .appStoreID) ?? "id997079563" static let appStoreId: String = Config.value(for: .appStoreID) ?? "id997079563"
static let welcomeLogoImageName: String = "welcomeLogo" 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 { static var defaultExternalLinkPolicy: ExternalLinkLoadingPolicy {
guard let policyString: String = Config.value(for: .externalLinkDefaultPolicy), guard let policyString: String = Config.value(for: .externalLinkDefaultPolicy),
@ -62,6 +64,8 @@ enum Config: String {
case showExternalLinkSettings = "SETTINGS_SHOW_EXTERNAL_LINK_OPTION" case showExternalLinkSettings = "SETTINGS_SHOW_EXTERNAL_LINK_OPTION"
case externalLinkDefaultPolicy = "SETTINGS_DEFAULT_EXTERNAL_LINK_TO" case externalLinkDefaultPolicy = "SETTINGS_DEFAULT_EXTERNAL_LINK_TO"
case showSearchSnippetInSettings = "SETTINGS_SHOW_SEARCH_SNIPPET" 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 { static func value<T>(for key: Config) -> T? where T: LosslessStringConvertible {
guard let object = Bundle.main.object(forInfoDictionaryKey: key.rawValue) else { guard let object = Bundle.main.object(forInfoDictionaryKey: key.rawValue) else {

View File

@ -80,7 +80,7 @@ struct About: View {
} }
private var about: some View { private var about: some View {
Text("settings.about.description".localized) Text(Brand.aboutText)
} }
private var release: some View { private var release: some View {
@ -99,7 +99,7 @@ struct About: View {
private var ourWebsite: some View { private var ourWebsite: some View {
Button("settings.about.our_website.button".localized) { Button("settings.about.our_website.button".localized) {
externalLinkURL = URL(string: "https://www.kiwix.org") externalLinkURL = URL(string: "https://\(Brand.aboutWebsite)")
} }
} }