Swift, Swiftui, iOS Development, Ios Developer, Mobile Development.
.font(.title) .foregroundColor(Color("i18nColor", bundle: .i18n)) // Use Bundle.i18n } } struct ViewAPreview: PreviewProvider { static var previews: some View { VStack { ViewA() .environment(\.locale, .init(identifier: "zh-cn")) VStack { ViewA() .environment(\.locale, .init(identifier: "zh-cn")) }