I have a few Text("dummy")
within SwiftUI previews. Every time I perform export localizations, these would get exported. Is there any way to manually mark them as "do not localize"?
Prevent Text("string") from being exported as localization
Asked Answered
Does this answer your question? Difference between Text("") and Text(verbatim: "") initializers in SwiftUI –
Ricebird
Use with verbatim constructor, like
Text(verbatim: "dummy")
Convenient way to use keep always safe and get rid of Text() localisation globally. It will override the default init and get rid of localisation.
extension Text {
public init<S>(_ content: S) where S : StringProtocol {
self.init(verbatim: String(content))
}
}
© 2022 - 2024 — McMap. All rights reserved.