lyricist icon indicating copy to clipboard operation
lyricist copied to clipboard

Support noncompose accessors

Open humblerookie opened this issue 1 year ago • 0 comments

Issue

Currently, the library allows you to access strings declared within the bounds of composables. On multiplatform, however, you'd have cases where you have APIs that need to access strings outside of compose. A simple use case would be displaying notifications as a result of some background task.

Proposal

Add a convenient accessor in the generated cafe.adriel.lyricist.Strings.kt file

fun getStrings():Strings {
    return  Strings[Locale.current.toLanguageTag()]?: defaultStrings
 }

Do let me know what you make of it or if you need more information.

humblerookie avatar Jan 25 '24 04:01 humblerookie