-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Just remove the lyricist processor as it always caused issues
- Loading branch information
1 parent
e7e29f5
commit f3e0d96
Showing
10 changed files
with
67 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package dev.schlaubi.tonbrett.app | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.ProvidableCompositionLocal | ||
import androidx.compose.runtime.staticCompositionLocalOf | ||
import androidx.compose.ui.text.intl.Locale | ||
import cafe.adriel.lyricist.Lyricist | ||
import cafe.adriel.lyricist.LanguageTag | ||
import cafe.adriel.lyricist.rememberStrings | ||
import cafe.adriel.lyricist.ProvideStrings | ||
import dev.schlaubi.tonbrett.app.strings.DeStrings | ||
import dev.schlaubi.tonbrett.app.strings.EnStrings | ||
import dev.schlaubi.tonbrett.app.strings.Strings | ||
|
||
public val Strings: Map<LanguageTag, Strings> = mapOf( | ||
"de" to DeStrings, | ||
"en" to EnStrings | ||
) | ||
|
||
public val LocalStrings: ProvidableCompositionLocal<Strings> = | ||
staticCompositionLocalOf { EnStrings } | ||
|
||
|
||
|
||
@Composable | ||
public fun rememberStrings( | ||
defaultLanguageTag: LanguageTag = "en", | ||
currentLanguageTag: LanguageTag = Locale.current.toLanguageTag(), | ||
): Lyricist<Strings> = | ||
rememberStrings(Strings, defaultLanguageTag, currentLanguageTag) | ||
|
||
@Composable | ||
public fun ProvideStrings( | ||
lyricist: Lyricist<Strings> = rememberStrings(), | ||
content: @Composable () -> Unit | ||
) { | ||
ProvideStrings(lyricist, LocalStrings, content) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters