Files
playdate-kit/Sources/PlaydateKit/System/Enumerations/Language.swift
T
javier c5037dd716 Swift 6.4 migration and exhancements (#1)
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>
2026-09-18 13:15:08 +00:00

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)) }
}
}