This PR contains the work done to update the library and the attached example project to use the Swift 6.4 computer as a minimum supported version and also, to use the latest features introduced in it. Reviewed-on: #1 Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
18 lines
571 B
Swift
18 lines
571 B
Swift
internal import CPlaydate
|
|
|
|
extension System {
|
|
/// A system language. Wraps `PDLanguage`.
|
|
public enum Language: UInt32, Sendable {
|
|
case english = 0
|
|
case japanese = 1
|
|
/// The current system language; only meaningful for `localizedText(forKey:language:)`.
|
|
case system = 2
|
|
|
|
// Unknown C values fall back to English.
|
|
init(_ language: PDLanguage) {
|
|
self = Language(rawValue: UInt32(language.rawValue)) ?? .english
|
|
}
|
|
var cValue: PDLanguage { PDLanguage(PDLanguage.RawValue(rawValue)) }
|
|
}
|
|
}
|