Using this package with WidgetKit/App Intents #37
Unanswered
HarshilShah
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So this isn't directly related to how the package works, but just an issue that comes up if you don't use the system recommended way to do localisation.
The
AppIntents
framework usesLocalizedStringResource
quite heavily, but it does so in a strange way: It requires you to define the values right in the source code. My understanding is that this is done because the statically defined value is effectively used as the key for the field, in case you were to change the name between releases, for example. When I reference a resource generated by this package as the title for one of my widget configurations, I get this error:Any thoughts on how to work around this? I can plug in the code generated by the package directly here, but then that does add some extra flakiness and multiple sources of truth. I'm wondering if maybe macros could be helpful here, since those expand before other compilation, afaik, and so might be able to "place" the static key in my source, though I admit have zero idea what that would look like
Beta Was this translation helpful? Give feedback.
All reactions