Closed nicobelo91 closed 4 days ago
With markdown maybe ? "My name is %@"
R.swift has no special support for formatting.
But you can use the existing APIs like AttributedString
.
For example:
// Localizeable.strings
"name" = "My name is **%@**";
// ContentView.swift
if let attributedString = try? AttributedString(markdown: R.string.localizable.name("Mark")) {
Text(attributedString)
}
Let's say I have the following text in the
Localizable.swift
file:"name" = "My name is %@";
I'd like to make the part where the name would go bold, so that it would read something like "My name is Mark" whenever I useR.string.localizable.name("Mark")
. Is there a way to do that using R.swift?