COVIDSafe code from version 1.7 (#8)

This commit is contained in:
COVIDSafe Support 2020-07-03 14:26:13 +10:00 committed by GitHub
parent 2063cea613
commit 6f92ff8fb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 4504 additions and 1281 deletions

View file

@ -9,10 +9,19 @@ import Foundation
struct URLHelper {
static func getAustralianNumberURL() -> String {
return "https://www.covidsafe.gov.au/help-topics.html#verify-mobile-number-pin"
return "\(getHelpURL())#verify-mobile-number-pin"
}
static func getHelpURL() -> String {
return "https://www.covidsafe.gov.au/help-topics.html"
let localeId = Locale.current.identifier
let supportedLocales = Bundle.main.localizations
let matches = supportedLocales.filter { (supportedLocale) -> Bool in
return localeId.starts(with: supportedLocale)
}
guard let localeCode = matches.first, localeCode != "en" else {
return "https://www.covidsafe.gov.au/help-topics.html"
}
return "https://www.covidsafe.gov.au/help-topics/\(localeCode.lowercased()).html"
}
}