0%

SwiftUI Localized

SwiftUI 根據Localized切換語言

Localized.strings file

1
2
widget_upcoming = "即將到來"
widget_upcoming = "UPCOMING"

顯示範例

1
2
3
4
5
6
struct todoList: View {
let widget_upcoming = NSLocalizedString("widget_upcoming", comment: "UPCOMING")
var body: some View {
Text(widget_upcoming)
}
}