COVIDSafe code from version 1.7

This commit is contained in:
covidsafe-support 2020-07-03 13:54:10 +10:00
parent 2063cea613
commit 653f79ebe6
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"
}
}