2020-05-08 17:49:14 +10:00
|
|
|
//
|
|
|
|
// URLHelper.swift
|
|
|
|
// CovidSafe
|
|
|
|
//
|
|
|
|
// Copyright © 2020 Australian Government. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
struct URLHelper {
|
|
|
|
static func getAustralianNumberURL() -> String {
|
2020-07-03 13:54:10 +10:00
|
|
|
return "\(getHelpURL())#verify-mobile-number-pin"
|
2020-05-08 17:49:14 +10:00
|
|
|
}
|
|
|
|
static func getHelpURL() -> String {
|
2020-07-03 13:54:10 +10:00
|
|
|
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"
|
2020-05-08 17:49:14 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|