Make WhatsNew.Text localizable #1

Open
opened 2025-10-14 15:54:16 -06:00 by navan · 0 comments
Owner

Originally created by @henrik-dmg on 9/7/2025

Context

When integrating WhatsNewKit into my app, I noticed WhatsNew.Text only supports String or (NS)AttributedString, which causes Xcode to not pick up strings you provide to it for the automatic translation catalogs.
This PR adds a simple new init that accepts a LocalizedStringResource that is then passed to AttributedString.

Changes

  • added new init
  • added . to the end of all summary comments in WhatsNew.Text, as recommended/enforced by swift-format's BeginDocumentationCommentWithOneLineSummary rule
  • added backticks to a couple of type names in the documentation

My Two-Cents

If you are open to releasing a new major version (aka introducing breaking API-changes), you could bump the iOS and macOS version requirement to 15 and 12 respectively.
That way you could remove the entire WhatsNew.Text struct and simply use AttributedString directly/everywhere.
If you like, I can open another PR for that, for this I wanted to keep the changes minimal.
Let me know what you think :)

*Originally created by @henrik-dmg on 9/7/2025* ## Context When integrating `WhatsNewKit` into my app, I noticed `WhatsNew.Text` only supports `String` or `(NS)AttributedString`, which causes Xcode to not pick up strings you provide to it for the automatic translation catalogs. This PR adds a simple new init that accepts a `LocalizedStringResource` that is then passed to `AttributedString`. ## Changes - added new init - added `.` to the end of all summary comments in `WhatsNew.Text`, as recommended/enforced by `swift-format`'s `BeginDocumentationCommentWithOneLineSummary` rule - added backticks to a couple of type names in the documentation ## My Two-Cents If you are open to releasing a new major version (aka introducing breaking API-changes), you could bump the iOS and macOS version requirement to 15 and 12 respectively. That way you could remove the entire `WhatsNew.Text` struct and simply use `AttributedString` directly/everywhere. If you like, I can open another PR for that, for this I wanted to keep the changes minimal. Let me know what you think :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github/WhatsNewKit#1
No description provided.