-
Notifications
You must be signed in to change notification settings - Fork 133
Description
Question
Is it possibile to load a localized string without using the autogenerated MR.strings directly?
It would be nice to be able to do it directly in commonMain.
Use case
I have a fixed list of items with descriptions which are already localized in app and I receive the localization key from remote (API or push notification) and I would like to load the localized String.
Example
I have itemX_description key localizable from commonMain using MR.strings.itemX_description.localized().
From an API i receive the key itemY_description and I would like to retrieve the corresponding localized String but I can't find a way to easily do it.
I tried with StringDesc.Raw("itemY_description").toString(LocalContext.current) in a JetpackCompose environment but it returns simply itemY_description so I don't think the Raw path is the right one.
Should I use StringDesc.Resource but how can I convert my string to the StringResource?