You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
652 B
28 lines
652 B
//
|
|
// Locale+Extensions.swift
|
|
// PadelClub
|
|
//
|
|
// Created by Laurent Morvillier on 03/04/2024.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public extension Locale {
|
|
|
|
static func countries() -> [String] {
|
|
var countries: [String] = []
|
|
|
|
for countryCode in Locale.Region.isoRegions {
|
|
if let countryName = Locale.current.localizedString(forRegionCode: countryCode.identifier) {
|
|
countries.append(countryName)
|
|
}
|
|
}
|
|
|
|
return countries.sorted()
|
|
}
|
|
|
|
static func defaultCurrency() -> String {
|
|
// return "EUR"
|
|
Locale.current.currency?.identifier ?? "EUR"
|
|
}
|
|
}
|
|
|