Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support noncompose accessors #38

Closed
humblerookie opened this issue Jan 25, 2024 · 0 comments · Fixed by humblerookie/lyricist#1 · May be fixed by #40
Closed

Support noncompose accessors #38

humblerookie opened this issue Jan 25, 2024 · 0 comments · Fixed by humblerookie/lyricist#1 · May be fixed by #40

Comments

@humblerookie
Copy link

humblerookie commented Jan 25, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant