WhatsNewKit
WhatsNewKit copied to clipboard
String localization
Is your feature request related to a problem?
No
What solution would you like?
It would be great if Strings I enter as title, subtitle etc. would be localized automatically.
What alternatives have you considered?
This does not work: title: WhatsNew.Title(stringLiteral: .init(localized: "Lorem Ipsum"))
And instead I have to use: title: "Lorem Ipsum?"
Any additional context?
Fyi: String(localized: )
does not change the string except you plan to translate it on purpose. So it will not lead to unintended behavior.
Hi @Meyssam120,
Thanks for opening up an issue.
The preferred way of passing in a localized String is via String(localized:)
as the WhatsNew.Title
is using an NSAttributedString
which doesn't accept a LocalizedStringResource
or LocalizedStringKey
.
WhatsNew.Title(
text: WhatsNew.Text(
String(
localized: "My localized String"
)
)
)
Closing due inactivity. Please feel free to re-open the issue at any time.