Ios 如何在SwiftUI中使用超链接实现本地化文本
我有如下内容。我想通过本地化字符串实现它Ios 如何在SwiftUI中使用超链接实现本地化文本,ios,xcode,localization,swiftui,Ios,Xcode,Localization,Swiftui,我有如下内容。我想通过本地化字符串实现它 import SwiftUI struct ContentView: View { var body: some View { VStack { Text("By signing in, you agree to the ") HStack(spacing: 0) { Button("privacy policy&quo
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
Text("By signing in, you agree to the ")
HStack(spacing: 0) {
Button("privacy policy") {}
Text(" and ")
Button("terms of service") {}
Text(".")
}
}
}
}
是否有一种实现方法,如:
"bySignIn %@ and %@." = "By signing in, you agree to the %@ and %@.";
或
你有什么建议吗
"bySignIn %@ and %@." = "By signing in, you agree to the Button(%@) and Button(%@).";