I have this code
struct TestAppleSuggestion: View {
@Environment(\.locale) var locale: Locale
var body: some View {
VStack {
VStack {
Text("locale: \(locale.identifier)")
Text(AttributedString(localized: LocalizedStringResource(
"welcome",
locale: locale
)))
Text(AttributedString(localized:
"welcome",
locale: locale
))
}
}
}
}
#Preview {
TestAppleSuggestion().environment(\.locale, Locale(identifier: "fr-CA"))
}
Heres What I see in SwiftUi Previews
The Localization is working for the LocalizedStringResource but not to the AttributedString.
Why?